cleanup: Namespace public utils macros
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 23 Mar 2021 15:17:53 +0000 (11:17 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 29 Mar 2021 17:57:23 +0000 (13:57 -0400)
Namespace utils macros in public headers under the 'lttng_ust_' prefix
and regroup them in single header file.

Change-Id: I65f133b25c54f8ef59070c9b56c79fbaf5ca84d2
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
40 files changed:
include/Makefile.am
include/lttng/ringbuffer-context.h
include/lttng/ust-abi.h
include/lttng/ust-align.h [deleted file]
include/lttng/ust-bug.h [deleted file]
include/lttng/ust-ctl.h
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
include/lttng/ust-tracer.h
include/lttng/ust-utils.h [new file with mode: 0644]
libcounter/shm.c
liblttng-ust/lttng-bytecode-specialize.c
liblttng-ust/lttng-context-cgroup-ns.c
liblttng-ust/lttng-context-cpu-id.c
liblttng-ust/lttng-context-ip.c
liblttng-ust/lttng-context-ipc-ns.c
liblttng-ust/lttng-context-mnt-ns.c
liblttng-ust/lttng-context-net-ns.c
liblttng-ust/lttng-context-perf-counters.c
liblttng-ust/lttng-context-pid-ns.c
liblttng-ust/lttng-context-pthread-id.c
liblttng-ust/lttng-context-time-ns.c
liblttng-ust/lttng-context-user-ns.c
liblttng-ust/lttng-context-uts-ns.c
liblttng-ust/lttng-context-vegid.c
liblttng-ust/lttng-context-veuid.c
liblttng-ust/lttng-context-vgid.c
liblttng-ust/lttng-context-vpid.c
liblttng-ust/lttng-context-vsgid.c
liblttng-ust/lttng-context-vsuid.c
liblttng-ust/lttng-context-vtid.c
liblttng-ust/lttng-context-vuid.c
liblttng-ust/lttng-ust-comm.c
liblttng-ust/lttng-ust-dynamic-type.c
liblttng-ust/lttng-ust-elf.c
liblttng-ust/ust-events-internal.h
libringbuffer/ring_buffer_backend.c
libringbuffer/ring_buffer_frontend.c
libringbuffer/ringbuffer-config.h
libringbuffer/shm.c

index 9583c8b6d7d9dd2dcc5ce4226c9b700fefc683c7..2b7547a47229b61f25ebf4320ce77042b3b84cdd 100644 (file)
@@ -23,8 +23,7 @@ nobase_include_HEADERS = \
        lttng/ust.h \
        lttng/ust-endian.h \
        lttng/ringbuffer-context.h \
-       lttng/ust-align.h \
-       lttng/ust-bug.h \
+       lttng/ust-utils.h \
        lttng/ust-error.h \
        lttng/tracef.h \
        lttng/tp/lttng-ust-tracef.h \
index 8a7b5758a09cc26884cc3ac142838a4c280ef395..1b200f7c7f458a422c8abf3966f19ea2f34d6b85 100644 (file)
@@ -16,7 +16,7 @@
 #include <string.h>
 
 #include <lttng/ust-tracer.h>
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 #include <lttng/ust-compiler.h>
 
 struct lttng_ust_lib_ring_buffer;
index 6fe5acd63cd06df90d9ed0449ef3132412b50370..bc699a0c708942de399b158ad299b7af0cf8f979 100644 (file)
 #include <stdint.h>
 #include <lttng/ust-compiler.h>
 
-#ifndef __ust_stringify
-#define __ust_stringify1(x)    #x
-#define __ust_stringify(x)     __ust_stringify1(x)
-#endif /* __ust_stringify */
-
 #define LTTNG_UST_ABI_SYM_NAME_LEN                     256
 #define LTTNG_UST_ABI_PROCNAME_LEN             16
 
diff --git a/include/lttng/ust-align.h b/include/lttng/ust-align.h
deleted file mode 100644 (file)
index 00da854..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_UST_ALIGN_H
-#define _LTTNG_UST_ALIGN_H
-
-#include <lttng/ust-bug.h>
-
-/**
- * lttng_ust_offset_align - Calculate the offset needed to align an object on
- *                its natural alignment towards higher addresses.
- * @align_drift:  object offset from an "alignment"-aligned address.
- * @alignment:    natural object alignment. Must be non-zero, power of 2.
- *
- * Returns the offset that must be added to align towards higher
- * addresses.
- */
-#define lttng_ust_offset_align(align_drift, alignment)                        \
-       ({                                                                     \
-               LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0                    \
-                                  || ((alignment) & ((alignment) - 1)));      \
-               (((alignment) - (align_drift)) & ((alignment) - 1));           \
-       })
-
-/**
- * lttng_ust_offset_align_floor - Calculate the offset needed to align an
- *                object on its natural alignment towards lower addresses.
- * @align_drift:  object offset from an "alignment"-aligned address.
- * @alignment:    natural object alignment. Must be non-zero, power of 2.
- *
- * Returns the offset that must be substracted to align towards lower addresses.
- */
-#define lttng_ust_offset_align_floor(align_drift, alignment)                  \
-       ({                                                                     \
-               LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0                    \
-                                  || ((alignment) & ((alignment) - 1)));      \
-               (((align_drift) - (alignment)) & ((alignment) - 1));           \
-       })
-
-#endif /* _LTTNG_UST_ALIGN_H */
diff --git a/include/lttng/ust-bug.h b/include/lttng/ust-bug.h
deleted file mode 100644 (file)
index 0b388c1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_UST_BUG_H
-#define _LTTNG_UST_BUG_H
-
-#include <urcu/compiler.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define LTTNG_BUG_ON(condition)                                                \
-       do {                                                            \
-               if (caa_unlikely(condition)) {                          \
-                       fprintf(stderr,                                 \
-                               "LTTng BUG in file %s, line %d.\n",     \
-                               __FILE__, __LINE__);                    \
-                       exit(EXIT_FAILURE);                             \
-               }                                                       \
-       } while (0)
-
-#define LTTNG_BUILD_BUG_ON(condition)                                  \
-       ((void) sizeof(char[-!!(condition)]))
-
-/**
- * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime
- * @condition: the condition which should be false.
- *
- * If the condition is a constant and true, the compiler will generate a build
- * error. If the condition is not constant, a BUG will be triggered at runtime
- * if the condition is ever true. If the condition is constant and false, no
- * code is emitted.
- */
-#define LTTNG_BUILD_RUNTIME_BUG_ON(condition)                  \
-       do {                                                    \
-               if (__builtin_constant_p(condition))            \
-                       LTTNG_BUILD_BUG_ON(condition);          \
-               else                                            \
-                       LTTNG_BUG_ON(condition);                \
-       } while (0)
-
-#endif
index bb9cf3ac218035725ef1f572a54df20ef88216bb..9cf724a784f5c894ba80b54c102ab884ab908426 100644 (file)
@@ -15,6 +15,7 @@
 #include <sys/types.h>
 
 #include <lttng/ust-abi.h>
+#include <lttng/ust-utils.h>
 
 #ifndef LTTNG_UST_UUID_LEN
 #define LTTNG_UST_UUID_LEN     16
@@ -23,7 +24,7 @@
 /* Default unix socket path */
 #define LTTNG_UST_SOCK_FILENAME                                        \
        "lttng-ust-sock-"                                       \
-       __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION)
+       lttng_ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION)
 
 /*
  * Shared memory files path are automatically related to shm root, e.g.
@@ -31,7 +32,7 @@
  */
 #define LTTNG_UST_WAIT_FILENAME                                        \
        "lttng-ust-wait-"                                       \
-       __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION)
+       lttng_ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION)
 
 struct lttng_ust_lib_ring_buffer;
 
index 1f55c00a3758dc4b4cbff8005e3abb17654ebffd..8b45cb7f89ac2e2088f0ad01f48201f52fb77b13 100644 (file)
@@ -124,7 +124,7 @@ struct lttng_ust_type_integer {
                .struct_size = sizeof(struct lttng_ust_type_integer),   \
                .size = sizeof(_type) * CHAR_BIT,                       \
                .alignment = lttng_alignof(_type) * CHAR_BIT,           \
-               .signedness = lttng_is_signed_type(_type),              \
+               .signedness = lttng_ust_is_signed_type(_type),          \
                .reverse_byte_order = _byte_order != BYTE_ORDER,        \
                .base = _base,                                          \
        }))
index fcd5303170d29babaa4fb8f3972f9df8b9ad6b3e..7cde38cfcfdfdc560e7e970e386918d1839fa2f9 100644 (file)
@@ -151,14 +151,14 @@ void __event_template_proto___##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)
        __LTTNG_COMPOUND_LITERAL(struct lttng_ust_enum_entry, {         \
                .struct_size = sizeof(struct lttng_ust_enum_entry),             \
                .start = {                                              \
-                       .value = lttng_is_signed_type(__typeof__(_value)) ? \
+                       .value = lttng_ust_is_signed_type(__typeof__(_value)) ? \
                                (long long) (_value) : (_value),        \
-                       .signedness = lttng_is_signed_type(__typeof__(_value)), \
+                       .signedness = lttng_ust_is_signed_type(__typeof__(_value)), \
                },                                                      \
                .end = {                                                \
-                       .value = lttng_is_signed_type(__typeof__(_value)) ? \
+                       .value = lttng_ust_is_signed_type(__typeof__(_value)) ? \
                                (long long) (_value) : (_value),        \
-                       .signedness = lttng_is_signed_type(__typeof__(_value)), \
+                       .signedness = lttng_ust_is_signed_type(__typeof__(_value)), \
                },                                                      \
                .string = (_string),                                    \
        }),
@@ -169,14 +169,14 @@ void __event_template_proto___##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)
        __LTTNG_COMPOUND_LITERAL(struct lttng_ust_enum_entry, {         \
                .struct_size = sizeof(struct lttng_ust_enum_entry),             \
                .start = {                                              \
-                       .value = lttng_is_signed_type(__typeof__(_range_start)) ? \
+                       .value = lttng_ust_is_signed_type(__typeof__(_range_start)) ? \
                                (long long) (_range_start) : (_range_start), \
-                       .signedness = lttng_is_signed_type(__typeof__(_range_start)), \
+                       .signedness = lttng_ust_is_signed_type(__typeof__(_range_start)), \
                },                                                      \
                .end = {                                                \
-                       .value = lttng_is_signed_type(__typeof__(_range_end)) ? \
+                       .value = lttng_ust_is_signed_type(__typeof__(_range_end)) ? \
                                (long long) (_range_end) : (_range_end), \
-                       .signedness = lttng_is_signed_type(__typeof__(_range_end)), \
+                       .signedness = lttng_ust_is_signed_type(__typeof__(_range_end)), \
                },                                                      \
                .string = (_string),                                    \
        }),
@@ -224,13 +224,13 @@ void __event_template_proto___##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)
 #define _ctf_array_encoded(_type, _item, _src, _byte_order,    \
                        _length, _encoding, _nowrite,           \
                        _elem_type_base)                        \
-       _lttng_array_element_type_is_supported(_type, _item)
+       lttng_ust_ctf_array_element_type_is_supported(_type, _item)
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _byte_order, \
                        _length_type, _src_length, _encoding, _nowrite, \
                        _elem_type_base)                        \
-       _lttng_array_element_type_is_supported(_type, _item)
+       lttng_ust_ctf_array_element_type_is_supported(_type, _item)
 
 #undef TP_FIELDS
 #define TP_FIELDS(...) __VA_ARGS__     /* Only one used in this phase */
@@ -477,7 +477,7 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS
 
 #undef _ctf_integer_ext
 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite)     \
-       if (lttng_is_signed_type(_type)) {                                     \
+       if (lttng_ust_is_signed_type(_type)) {                                 \
                int64_t __ctf_tmp_int64;                                       \
                switch (sizeof(_type)) {                                       \
                case 1:                                                        \
index 410be46b0ca9831b760c15254909e02bd4eed68d..acc475bfe1dde65bb16a239652b359568da6448c 100644 (file)
 
 #include <limits.h>
 
-#if defined (__cplusplus)
-#include <type_traits>
-#endif
-
 #include <lttng/ust-arch.h>
 #include <lttng/ust-compiler.h>
 #include <lttng/ust-config.h>
+#include <lttng/ust-utils.h>
 #include <lttng/ust-version.h>
 
 #ifndef LTTNG_UST_ARCH_HAS_EFFICIENT_UNALIGNED_ACCESS
 #define lttng_alignof(type)    1
 #endif
 
-#define lttng_is_signed_type(type)           ((type) -1 < (type) 1)
-
-/*
- * This macro adds a compilation assertion that CTF arrays and sequences
- * declared by the users are of an integral type.
- */
-
-#if defined(__cplusplus)
-#define _lttng_is_integer(type) (std::is_integral<type>::value)
-#else
-#define _lttng_is_integer(type) (__builtin_types_compatible_p(type, _Bool) || \
-               __builtin_types_compatible_p(type, char) || \
-               __builtin_types_compatible_p(type, unsigned char) || \
-               __builtin_types_compatible_p(type, short) || \
-               __builtin_types_compatible_p(type, unsigned short) || \
-               __builtin_types_compatible_p(type, int) || \
-               __builtin_types_compatible_p(type, unsigned int) || \
-               __builtin_types_compatible_p(type, long) || \
-               __builtin_types_compatible_p(type, unsigned long) || \
-               __builtin_types_compatible_p(type, long long) || \
-               __builtin_types_compatible_p(type, unsigned long long))
-#endif
-
-#define _lttng_array_element_type_is_supported(_type, _item) \
-               lttng_static_assert(_lttng_is_integer(_type), \
-                       "Non-integer type `" #_item "` not supported as element of CTF_ARRAY or CTF_SEQUENCE", \
-                       Non_integer_type__##_item##__not_supported_as_element_of_CTF_ARRAY_or_CTF_SEQUENCE);
-
 #endif /* _LTTNG_UST_TRACER_H */
diff --git a/include/lttng/ust-utils.h b/include/lttng/ust-utils.h
new file mode 100644 (file)
index 0000000..23d1a07
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_UST_UTILS_H
+#define _LTTNG_UST_UTILS_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <urcu/compiler.h>
+
+/* For lttng_ust_is_integer_type */
+#if defined (__cplusplus)
+#include <type_traits>
+#endif
+
+
+/**
+ * lttng_ust_stringify - convert a literal value to a C string
+ */
+#define __lttng_ust_stringify1(x)      #x
+#define lttng_ust_stringify(x) __lttng_ust_stringify1(x)
+
+/**
+ * lttng_ust_is_signed_type - check if type is signed
+ *
+ * Returns true if the type of @type is signed.
+ */
+#define lttng_ust_is_signed_type(type)           ((type) -1 < (type) 1)
+
+
+/**
+ * lttng_ust_is_integer_type - check if type is an integer
+ *
+ * Returns true if the type of @type is an integer.
+ */
+#if defined(__cplusplus)
+#define lttng_ust_is_integer_type(type) (std::is_integral<type>::value)
+#else
+#define lttng_ust_is_integer_type(type) \
+               (__builtin_types_compatible_p(type, _Bool) || \
+               __builtin_types_compatible_p(type, char) || \
+               __builtin_types_compatible_p(type, unsigned char) || \
+               __builtin_types_compatible_p(type, short) || \
+               __builtin_types_compatible_p(type, unsigned short) || \
+               __builtin_types_compatible_p(type, int) || \
+               __builtin_types_compatible_p(type, unsigned int) || \
+               __builtin_types_compatible_p(type, long) || \
+               __builtin_types_compatible_p(type, unsigned long) || \
+               __builtin_types_compatible_p(type, long long) || \
+               __builtin_types_compatible_p(type, unsigned long long))
+#endif
+
+/**
+ * lttng_ust_ctf_array_element_type_is_supported -
+ *
+ * Adds a compilation assertion that CTF arrays and sequences declared by the
+ * user are of an integral type.
+ */
+#define lttng_ust_ctf_array_element_type_is_supported(type, item) \
+               lttng_static_assert(lttng_ust_is_integer_type(type), \
+                       "Non-integer type `" #item "` not supported as element of CTF_ARRAY or CTF_SEQUENCE", \
+                       Non_integer_type__##item##__not_supported_as_element_of_CTF_ARRAY_or_CTF_SEQUENCE);
+
+
+/**
+ * lttng_ust_runtime_bug_on - check condition at runtime
+ * @condition: the condition which should be false.
+ *
+ * If the condition is true, a BUG will be triggered at runtime.
+ */
+#define lttng_ust_runtime_bug_on(condition)                            \
+       do {                                                            \
+               if (caa_unlikely(condition)) {                          \
+                       fprintf(stderr,                                 \
+                               "LTTng BUG in file %s, line %d.\n",     \
+                               __FILE__, __LINE__);                    \
+                       exit(EXIT_FAILURE);                             \
+               }                                                       \
+       } while (0)
+
+
+/**
+ * lttng_ust_build_bug_on - check condition at build
+ * @condition: the condition which should be false.
+ *
+ * If the condition is true, the compiler will generate a build error.
+ */
+#define lttng_ust_build_bug_on(condition)                      \
+       ((void) sizeof(char[-!!(condition)]))
+
+
+/**
+ * lttng_ust_build_runtime_bug_on - check condition at build (if constant) or runtime
+ * @condition: the condition which should be false.
+ *
+ * If the condition is a constant and true, the compiler will generate a build
+ * error. If the condition is not constant, a BUG will be triggered at runtime
+ * if the condition is ever true. If the condition is constant and false, no
+ * code is emitted.
+ */
+#define lttng_ust_build_runtime_bug_on(condition)              \
+       do {                                                    \
+               if (__builtin_constant_p(condition))            \
+                       lttng_ust_build_bug_on(condition);      \
+               else                                            \
+                       lttng_ust_runtime_bug_on(condition);    \
+       } while (0)
+
+
+/**
+ * lttng_ust_offset_align - Calculate the offset needed to align an object on
+ *                its natural alignment towards higher addresses.
+ * @align_drift:  object offset from an "alignment"-aligned address.
+ * @alignment:    natural object alignment. Must be non-zero, power of 2.
+ *
+ * Returns the offset that must be added to align towards higher
+ * addresses.
+ */
+#define lttng_ust_offset_align(align_drift, alignment)                        \
+       ({                                                                     \
+               lttng_ust_build_runtime_bug_on((alignment) == 0                \
+                                  || ((alignment) & ((alignment) - 1)));      \
+               (((alignment) - (align_drift)) & ((alignment) - 1));           \
+       })
+
+
+/**
+ * lttng_ust_offset_align_floor - Calculate the offset needed to align an
+ *                object on its natural alignment towards lower addresses.
+ * @align_drift:  object offset from an "alignment"-aligned address.
+ * @alignment:    natural object alignment. Must be non-zero, power of 2.
+ *
+ * Returns the offset that must be substracted to align towards lower addresses.
+ */
+#define lttng_ust_offset_align_floor(align_drift, alignment)                  \
+       ({                                                                     \
+               lttng_ust_build_runtime_bug_on((alignment) == 0                \
+                                  || ((alignment) & ((alignment) - 1)));      \
+               (((align_drift) - (alignment)) & ((alignment) - 1));           \
+       })
+
+#endif /* _LTTNG_UST_UTILS_H */
index 70651e6a44ee38876d642da34fa6dba72967f556..b8a07e132d2985aaf7b0caace7368de2562f22e0 100644 (file)
@@ -25,7 +25,7 @@
 #include <numaif.h>
 #endif
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 
 #include <ust-helper.h>
 #include <ust-fd.h>
index 065c0eb24a16ae848bfa34b921a3ad83e80c17e9..130b4edf76d028b55c491756aee08cc40a9bbd0b 100644 (file)
@@ -10,7 +10,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 
 #include "context-internal.h"
 #include "lttng-bytecode.h"
index 8d32cdb44adf7bde906cb87ddb61628fe0b9e050..623689cc12dfa1632f17318c7453152825c8f85f 100644 (file)
@@ -126,7 +126,7 @@ int lttng_add_cgroup_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index a3fdb9c6dd0b18a5ff1f4f7fcc1a0ba510f8e331..baa1a8893e87411496e2912511f1fb3bd567bcd4 100644 (file)
@@ -60,7 +60,7 @@ int lttng_add_cpu_id_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(int) * CHAR_BIT,
                        lttng_alignof(int) * CHAR_BIT,
-                       lttng_is_signed_type(int),
+                       lttng_ust_is_signed_type(int),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index b56e0db157e43cafd57a64e2e04e415cb84f7595..d163a6e04f69450502a1937c4f2c5dd5a1d1dae6 100644 (file)
@@ -46,7 +46,7 @@ int lttng_add_ip_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(void *) * CHAR_BIT,
                        lttng_alignof(void *) * CHAR_BIT,
-                       lttng_is_signed_type(void *),
+                       lttng_ust_is_signed_type(void *),
                        BYTE_ORDER, 16);
        if (!type)
                return -ENOMEM;
index 30a9c59950e239825f37bbc198ab0f71212e8e00..836bca5092003f7f3aec0c6ca020b6f191c7bf98 100644 (file)
@@ -125,7 +125,7 @@ int lttng_add_ipc_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 60c4805753b78272a958acfaa4e9a9ab27b4b973..19fa0c74f6495513ff180c2f7056813e7c071a58 100644 (file)
@@ -108,7 +108,7 @@ int lttng_add_mnt_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index d9293a6b287936a83318f07d908ec260c8242df3..1efcceda9f7a60ac1bdd6de3193f71db843e2bbe 100644 (file)
@@ -125,7 +125,7 @@ int lttng_add_net_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 6979143985de74f58fcdab13b67fdd3511d7651c..e3378a7daa75d5ef55067dbbec03ff012554609f 100644 (file)
@@ -547,7 +547,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
        }
        ust_type = lttng_ust_create_type_integer(sizeof(uint64_t) * CHAR_BIT,
                        lttng_alignof(uint64_t) * CHAR_BIT,
-                       lttng_is_signed_type(uint64_t),
+                       lttng_ust_is_signed_type(uint64_t),
                        BYTE_ORDER, 10);
        if (!ust_type) {
                ret = -ENOMEM;
index 25210e92b7237cceeacdc7cd9c0972c547d2d119..d52c0b9b9abe101db137685885c54310c0742e61 100644 (file)
@@ -111,7 +111,7 @@ int lttng_add_pid_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 59a6f3815ed26822fcf9baa024d06b0a429254d5..65f77d9be5b3d1709225f9b31da2dfd9fae8f6e7 100644 (file)
@@ -52,7 +52,7 @@ int lttng_add_pthread_id_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(unsigned long) * CHAR_BIT,
                        lttng_alignof(unsigned long) * CHAR_BIT,
-                       lttng_is_signed_type(unsigned long),
+                       lttng_ust_is_signed_type(unsigned long),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index fa85b5da6be9b6d9afa9a42a891d246945b1efab..a82d12af7e558e31ae7c1e2499ef7ce04df1010b 100644 (file)
@@ -124,7 +124,7 @@ int lttng_add_time_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index e4bb1dd2e6f49dcb341aa5ccda6f428298d98db6..464e7368a084ff8cbf28441a4da1ad5ac22e6485 100644 (file)
@@ -108,7 +108,7 @@ int lttng_add_user_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 3037d084b52d285a6aa75b32e2aa8afb69826820..729f934f62e9b728d99a33f7cb9c3eed7d788da1 100644 (file)
@@ -126,7 +126,7 @@ int lttng_add_uts_ns_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(ino_t) * CHAR_BIT,
                        lttng_alignof(ino_t) * CHAR_BIT,
-                       lttng_is_signed_type(ino_t),
+                       lttng_ust_is_signed_type(ino_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index ca0555e3d099ab879cd298e037a56c1796b14a77..b504b714299ef9fc7ff9ed846462eeec6c90760c 100644 (file)
@@ -97,7 +97,7 @@ int lttng_add_vegid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(gid_t) * CHAR_BIT,
                        lttng_alignof(gid_t) * CHAR_BIT,
-                       lttng_is_signed_type(gid_t),
+                       lttng_ust_is_signed_type(gid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 8cd29acecb6ca9b6b12139364ea384dc025bd60d..5099d202eb1752db158cc7edc44813cfc6bb950e 100644 (file)
@@ -97,7 +97,7 @@ int lttng_add_veuid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(uid_t) * CHAR_BIT,
                        lttng_alignof(uid_t) * CHAR_BIT,
-                       lttng_is_signed_type(uid_t),
+                       lttng_ust_is_signed_type(uid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 7536d382a6242ca9a73f82ae26d236d2f6f432a4..6e413d93caa320651fc95b971d835ebe1e01db48 100644 (file)
@@ -97,7 +97,7 @@ int lttng_add_vgid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(gid_t) * CHAR_BIT,
                        lttng_alignof(gid_t) * CHAR_BIT,
-                       lttng_is_signed_type(gid_t),
+                       lttng_ust_is_signed_type(gid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 0c532ddf3ebd55d7b118df5aa8c11cfe6280b3b7..514c69fc64d5f2504040006cd6a80f09b13bda2f 100644 (file)
@@ -80,7 +80,7 @@ int lttng_add_vpid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(pid_t) * CHAR_BIT,
                        lttng_alignof(pid_t) * CHAR_BIT,
-                       lttng_is_signed_type(pid_t),
+                       lttng_ust_is_signed_type(pid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index a63c190117b153c6242765fe148c54b7f04c978f..07a2ccadb756a5c35e71bb615ffbc916ad0411b1 100644 (file)
@@ -101,7 +101,7 @@ int lttng_add_vsgid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(gid_t) * CHAR_BIT,
                        lttng_alignof(gid_t) * CHAR_BIT,
-                       lttng_is_signed_type(gid_t),
+                       lttng_ust_is_signed_type(gid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 3413c3a9cb3147f7fe0f12e0f1db4b58be2ce4cd..ed00301ec56654879035b7112c18aab2eae551a1 100644 (file)
@@ -101,7 +101,7 @@ int lttng_add_vsuid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(uid_t) * CHAR_BIT,
                        lttng_alignof(uid_t) * CHAR_BIT,
-                       lttng_is_signed_type(uid_t),
+                       lttng_ust_is_signed_type(uid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 1648d8db83f9c676ac90639f73429ab9717f9c9e..57abdf733fc100287f7fb66b80ba63f83c92abee 100644 (file)
@@ -84,7 +84,7 @@ int lttng_add_vtid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(pid_t) * CHAR_BIT,
                        lttng_alignof(pid_t) * CHAR_BIT,
-                       lttng_is_signed_type(pid_t),
+                       lttng_ust_is_signed_type(pid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index b2edf870bc541fcfe181f88bd3649e246799189b..5bfb92a22bf74c04d56280fbedbccf4ebf7931ea 100644 (file)
@@ -97,7 +97,7 @@ int lttng_add_vuid_to_ctx(struct lttng_ust_ctx **ctx)
 
        type = lttng_ust_create_type_integer(sizeof(uid_t) * CHAR_BIT,
                        lttng_alignof(uid_t) * CHAR_BIT,
-                       lttng_is_signed_type(uid_t),
+                       lttng_ust_is_signed_type(uid_t),
                        BYTE_ORDER, 10);
        if (!type)
                return -ENOMEM;
index 428108646b765d00b9e5df272ec7e97de0bcc1ed..5800d9d612bae2a60040050a5ee9cab2c377f845 100644 (file)
@@ -29,6 +29,7 @@
 #include <urcu/compiler.h>
 #include <lttng/urcu/urcu-ust.h>
 
+#include <lttng/ust-utils.h>
 #include <lttng/ust-events.h>
 #include <lttng/ust-abi.h>
 #include <lttng/ust.h>
@@ -53,7 +54,7 @@
 #include "ust-compat.h"
 
 /* Concatenate lttng ust shared library name with its major version number. */
-#define LTTNG_UST_LIB_SO_NAME "liblttng-ust.so." __ust_stringify(CONFIG_LTTNG_UST_LIBRARY_VERSION_MAJOR)
+#define LTTNG_UST_LIB_SO_NAME "liblttng-ust.so." lttng_ust_stringify(CONFIG_LTTNG_UST_LIBRARY_VERSION_MAJOR)
 
 /*
  * Has lttng ust comm constructor been called ?
index 4b58d82cde474a2990b5f07021075ee83bb1284c..c94d6cc4ae139a0a87d4197a2cf1dfbdd913f86d 100644 (file)
        __LTTNG_COMPOUND_LITERAL(struct lttng_ust_enum_entry, {         \
                .struct_size = sizeof(struct lttng_ust_enum_entry),             \
                .start = {                                              \
-                       .signedness = lttng_is_signed_type(__typeof__(_value)), \
-                       .value = lttng_is_signed_type(__typeof__(_value)) ? \
+                       .signedness = lttng_ust_is_signed_type(__typeof__(_value)), \
+                       .value = lttng_ust_is_signed_type(__typeof__(_value)) ? \
                                (long long) (_value) : (_value),        \
                },                                                      \
                .end = {                                                \
-                       .signedness = lttng_is_signed_type(__typeof__(_value)), \
-                       .value = lttng_is_signed_type(__typeof__(_value)) ? \
+                       .signedness = lttng_ust_is_signed_type(__typeof__(_value)), \
+                       .value = lttng_ust_is_signed_type(__typeof__(_value)) ? \
                                (long long) (_value) : (_value),        \
                },                                                      \
                .string = (_string),                                    \
index 8a02ceb38a4d8e16fbef35ef321b9559f15c9518..74b3f3ca661aac9fe3b9e4e43f7dbe6f8c8388fd 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 
 #include <ust-elf.h>
 #include <ust-fd.h>
index e632050434c83a2fa06ab790c7570f90a0b5db6d..1ce6b4b511bc0c434a69a927be74f9fc28e8ac8a 100644 (file)
@@ -508,7 +508,7 @@ struct lttng_ust_type_common *lttng_ust_create_type_array_text(unsigned int leng
        array_type->alignment = 0;
        array_type->encoding = lttng_ust_string_encoding_UTF8;
        array_type->elem_type = lttng_ust_create_type_integer(sizeof(char) * CHAR_BIT,
-                       lttng_alignof(char) * CHAR_BIT, lttng_is_signed_type(char),
+                       lttng_alignof(char) * CHAR_BIT, lttng_ust_is_signed_type(char),
                        BYTE_ORDER, 10);
        if (!array_type->elem_type)
                goto error_elem;
index 264201883862daae95f622f8f8f62193ac43ad90..ac45446b8a4ea09525e63fc128b8a9d58039a8be 100644 (file)
@@ -11,7 +11,7 @@
 #include <urcu/arch.h>
 #include <limits.h>
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 #include <lttng/ringbuffer-context.h>
 
 #include "ringbuffer-config.h"
index 72ee4c9ce09d39afb1c38743a68021355e45cba7..e09294bfb86bba43aae2d8f635639a056b52fd6d 100644 (file)
@@ -52,7 +52,7 @@
 #include <poll.h>
 #include <ust-helper.h>
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 #include <lttng/ringbuffer-context.h>
 
 #include "smp.h"
index badf7566cf0329756c689a5ea9ce921c9a4fbf2b..f0871811c8a1a58d95b4b89ac70c31288c690f6c 100644 (file)
@@ -16,7 +16,7 @@
 #include <urcu/arch.h>
 #include <string.h>
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 #include <lttng/ust-compiler.h>
 #include <lttng/ust-tracer.h>
 
index 6f5c9f5fd4763fad9b72d5a4c0dfbf8449e7f8ea..e4f818fce8f366f4f5a5899ee9e79eb96014febb 100644 (file)
@@ -25,7 +25,7 @@
 #include <numaif.h>
 #endif
 
-#include <lttng/ust-align.h>
+#include <lttng/ust-utils.h>
 
 #include <ust-helper.h>
 #include <ust-fd.h>
This page took 0.045795 seconds and 4 git commands to generate.