From: Michael Jeanson Date: Tue, 23 Mar 2021 15:17:53 +0000 (-0400) Subject: cleanup: Namespace public utils macros X-Git-Tag: v2.13.0-rc1~197 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=eae3c72949135b48639440468dc78ea1d5e937e9;p=lttng-ust.git cleanup: Namespace public utils macros 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/include/Makefile.am b/include/Makefile.am index 9583c8b6..2b7547a4 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -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 \ diff --git a/include/lttng/ringbuffer-context.h b/include/lttng/ringbuffer-context.h index 8a7b5758..1b200f7c 100644 --- a/include/lttng/ringbuffer-context.h +++ b/include/lttng/ringbuffer-context.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include struct lttng_ust_lib_ring_buffer; diff --git a/include/lttng/ust-abi.h b/include/lttng/ust-abi.h index 6fe5acd6..bc699a0c 100644 --- a/include/lttng/ust-abi.h +++ b/include/lttng/ust-abi.h @@ -12,11 +12,6 @@ #include #include -#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 index 00da854e..00000000 --- a/include/lttng/ust-align.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (C) 2010-2011 Mathieu Desnoyers - */ - -#ifndef _LTTNG_UST_ALIGN_H -#define _LTTNG_UST_ALIGN_H - -#include - -/** - * 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 index 0b388c14..00000000 --- a/include/lttng/ust-bug.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (C) 2010-2011 Mathieu Desnoyers - */ - -#ifndef _LTTNG_UST_BUG_H -#define _LTTNG_UST_BUG_H - -#include -#include -#include - -#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 diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index bb9cf3ac..9cf724a7 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -15,6 +15,7 @@ #include #include +#include #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; diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 1f55c00a..8b45cb7f 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -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, \ })) diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index fcd53031..7cde38cf 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -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: \ diff --git a/include/lttng/ust-tracer.h b/include/lttng/ust-tracer.h index 410be46b..acc475bf 100644 --- a/include/lttng/ust-tracer.h +++ b/include/lttng/ust-tracer.h @@ -11,13 +11,10 @@ #include -#if defined (__cplusplus) -#include -#endif - #include #include #include +#include #include #ifndef LTTNG_UST_ARCH_HAS_EFFICIENT_UNALIGNED_ACCESS @@ -35,32 +32,4 @@ #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::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 index 00000000..23d1a07c --- /dev/null +++ b/include/lttng/ust-utils.h @@ -0,0 +1,145 @@ +/* + * SPDX-License-Identifier: MIT + * + * Copyright (C) 2010-2011 Mathieu Desnoyers + */ + +#ifndef _LTTNG_UST_UTILS_H +#define _LTTNG_UST_UTILS_H + +#include +#include +#include + +/* For lttng_ust_is_integer_type */ +#if defined (__cplusplus) +#include +#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::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 */ diff --git a/libcounter/shm.c b/libcounter/shm.c index 70651e6a..b8a07e13 100644 --- a/libcounter/shm.c +++ b/libcounter/shm.c @@ -25,7 +25,7 @@ #include #endif -#include +#include #include #include diff --git a/liblttng-ust/lttng-bytecode-specialize.c b/liblttng-ust/lttng-bytecode-specialize.c index 065c0eb2..130b4edf 100644 --- a/liblttng-ust/lttng-bytecode-specialize.c +++ b/liblttng-ust/lttng-bytecode-specialize.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include "context-internal.h" #include "lttng-bytecode.h" diff --git a/liblttng-ust/lttng-context-cgroup-ns.c b/liblttng-ust/lttng-context-cgroup-ns.c index 8d32cdb4..623689cc 100644 --- a/liblttng-ust/lttng-context-cgroup-ns.c +++ b/liblttng-ust/lttng-context-cgroup-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-cpu-id.c b/liblttng-ust/lttng-context-cpu-id.c index a3fdb9c6..baa1a889 100644 --- a/liblttng-ust/lttng-context-cpu-id.c +++ b/liblttng-ust/lttng-context-cpu-id.c @@ -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; diff --git a/liblttng-ust/lttng-context-ip.c b/liblttng-ust/lttng-context-ip.c index b56e0db1..d163a6e0 100644 --- a/liblttng-ust/lttng-context-ip.c +++ b/liblttng-ust/lttng-context-ip.c @@ -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; diff --git a/liblttng-ust/lttng-context-ipc-ns.c b/liblttng-ust/lttng-context-ipc-ns.c index 30a9c599..836bca50 100644 --- a/liblttng-ust/lttng-context-ipc-ns.c +++ b/liblttng-ust/lttng-context-ipc-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-mnt-ns.c b/liblttng-ust/lttng-context-mnt-ns.c index 60c48057..19fa0c74 100644 --- a/liblttng-ust/lttng-context-mnt-ns.c +++ b/liblttng-ust/lttng-context-mnt-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-net-ns.c b/liblttng-ust/lttng-context-net-ns.c index d9293a6b..1efcceda 100644 --- a/liblttng-ust/lttng-context-net-ns.c +++ b/liblttng-ust/lttng-context-net-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index 69791439..e3378a7d 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -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; diff --git a/liblttng-ust/lttng-context-pid-ns.c b/liblttng-ust/lttng-context-pid-ns.c index 25210e92..d52c0b9b 100644 --- a/liblttng-ust/lttng-context-pid-ns.c +++ b/liblttng-ust/lttng-context-pid-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-pthread-id.c b/liblttng-ust/lttng-context-pthread-id.c index 59a6f381..65f77d9b 100644 --- a/liblttng-ust/lttng-context-pthread-id.c +++ b/liblttng-ust/lttng-context-pthread-id.c @@ -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; diff --git a/liblttng-ust/lttng-context-time-ns.c b/liblttng-ust/lttng-context-time-ns.c index fa85b5da..a82d12af 100644 --- a/liblttng-ust/lttng-context-time-ns.c +++ b/liblttng-ust/lttng-context-time-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-user-ns.c b/liblttng-ust/lttng-context-user-ns.c index e4bb1dd2..464e7368 100644 --- a/liblttng-ust/lttng-context-user-ns.c +++ b/liblttng-ust/lttng-context-user-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-uts-ns.c b/liblttng-ust/lttng-context-uts-ns.c index 3037d084..729f934f 100644 --- a/liblttng-ust/lttng-context-uts-ns.c +++ b/liblttng-ust/lttng-context-uts-ns.c @@ -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; diff --git a/liblttng-ust/lttng-context-vegid.c b/liblttng-ust/lttng-context-vegid.c index ca0555e3..b504b714 100644 --- a/liblttng-ust/lttng-context-vegid.c +++ b/liblttng-ust/lttng-context-vegid.c @@ -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; diff --git a/liblttng-ust/lttng-context-veuid.c b/liblttng-ust/lttng-context-veuid.c index 8cd29ace..5099d202 100644 --- a/liblttng-ust/lttng-context-veuid.c +++ b/liblttng-ust/lttng-context-veuid.c @@ -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; diff --git a/liblttng-ust/lttng-context-vgid.c b/liblttng-ust/lttng-context-vgid.c index 7536d382..6e413d93 100644 --- a/liblttng-ust/lttng-context-vgid.c +++ b/liblttng-ust/lttng-context-vgid.c @@ -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; diff --git a/liblttng-ust/lttng-context-vpid.c b/liblttng-ust/lttng-context-vpid.c index 0c532ddf..514c69fc 100644 --- a/liblttng-ust/lttng-context-vpid.c +++ b/liblttng-ust/lttng-context-vpid.c @@ -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; diff --git a/liblttng-ust/lttng-context-vsgid.c b/liblttng-ust/lttng-context-vsgid.c index a63c1901..07a2ccad 100644 --- a/liblttng-ust/lttng-context-vsgid.c +++ b/liblttng-ust/lttng-context-vsgid.c @@ -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; diff --git a/liblttng-ust/lttng-context-vsuid.c b/liblttng-ust/lttng-context-vsuid.c index 3413c3a9..ed00301e 100644 --- a/liblttng-ust/lttng-context-vsuid.c +++ b/liblttng-ust/lttng-context-vsuid.c @@ -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; diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index 1648d8db..57abdf73 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -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; diff --git a/liblttng-ust/lttng-context-vuid.c b/liblttng-ust/lttng-context-vuid.c index b2edf870..5bfb92a2 100644 --- a/liblttng-ust/lttng-context-vuid.c +++ b/liblttng-ust/lttng-context-vuid.c @@ -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; diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 42810864..5800d9d6 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -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 ? diff --git a/liblttng-ust/lttng-ust-dynamic-type.c b/liblttng-ust/lttng-ust-dynamic-type.c index 4b58d82c..c94d6cc4 100644 --- a/liblttng-ust/lttng-ust-dynamic-type.c +++ b/liblttng-ust/lttng-ust-dynamic-type.c @@ -19,13 +19,13 @@ __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), \ diff --git a/liblttng-ust/lttng-ust-elf.c b/liblttng-ust/lttng-ust-elf.c index 8a02ceb3..74b3f3ca 100644 --- a/liblttng-ust/lttng-ust-elf.c +++ b/liblttng-ust/lttng-ust-elf.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index e6320504..1ce6b4b5 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -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; diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index 26420188..ac45446b 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include "ringbuffer-config.h" diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 72ee4c9c..e09294bf 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include "smp.h" diff --git a/libringbuffer/ringbuffer-config.h b/libringbuffer/ringbuffer-config.h index badf7566..f0871811 100644 --- a/libringbuffer/ringbuffer-config.h +++ b/libringbuffer/ringbuffer-config.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index 6f5c9f5f..e4f818fc 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -25,7 +25,7 @@ #include #endif -#include +#include #include #include