From baa8acf3af23bc5d9373144bef8147744b5ae01f Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 21 Apr 2021 12:42:21 -0400 Subject: [PATCH] Tracepoint API namespacing ust-endian The ABI bump gives us the opportunity to namespace all public symbols under the 'lttng_ust_' prefix. Namespace all API symbols and macros under 'lttng_ust_' / 'LTTNG_UST_' and add compat macros to keep compatibility with the previous API. Change-Id: Iaab4a3630f3cd75adf540e4e849fb374076d87b4 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-endian.h | 51 +++++++++---------- include/lttng/ust-events.h | 4 +- include/lttng/ust-tracepoint-event-nowrite.h | 22 ++++---- include/lttng/ust-tracepoint-event-write.h | 28 +++++----- include/lttng/ust-tracepoint-event.h | 36 ++++++------- src/common/bitfield.h | 14 ++--- src/common/elf.c | 8 +-- src/common/elf.h | 8 +-- src/common/events.h | 4 +- src/common/jhash.h | 10 ++-- src/lib/lttng-ust-ctl/ustctl.c | 10 ++-- .../lttng-ust/event-notifier-notification.c | 12 ++--- .../lttng-ust/lttng-bytecode-interpreter.c | 16 +++--- src/lib/lttng-ust/lttng-context-cgroup-ns.c | 2 +- src/lib/lttng-ust/lttng-context-cpu-id.c | 2 +- src/lib/lttng-ust/lttng-context-ip.c | 2 +- src/lib/lttng-ust/lttng-context-ipc-ns.c | 2 +- src/lib/lttng-ust/lttng-context-mnt-ns.c | 2 +- src/lib/lttng-ust/lttng-context-net-ns.c | 2 +- .../lttng-ust/lttng-context-perf-counters.c | 2 +- src/lib/lttng-ust/lttng-context-pid-ns.c | 2 +- src/lib/lttng-ust/lttng-context-pthread-id.c | 2 +- src/lib/lttng-ust/lttng-context-time-ns.c | 2 +- src/lib/lttng-ust/lttng-context-user-ns.c | 2 +- src/lib/lttng-ust/lttng-context-uts-ns.c | 2 +- src/lib/lttng-ust/lttng-context-vegid.c | 2 +- src/lib/lttng-ust/lttng-context-veuid.c | 2 +- src/lib/lttng-ust/lttng-context-vgid.c | 2 +- src/lib/lttng-ust/lttng-context-vpid.c | 2 +- src/lib/lttng-ust/lttng-context-vsgid.c | 2 +- src/lib/lttng-ust/lttng-context-vsuid.c | 2 +- src/lib/lttng-ust/lttng-context-vtid.c | 2 +- src/lib/lttng-ust/lttng-context-vuid.c | 2 +- src/lib/lttng-ust/lttng-ust-dynamic-type.c | 18 +++---- 34 files changed, 140 insertions(+), 141 deletions(-) diff --git a/include/lttng/ust-endian.h b/include/lttng/ust-endian.h index 06f82364..7f1d79f5 100644 --- a/include/lttng/ust-endian.h +++ b/include/lttng/ust-endian.h @@ -32,37 +32,36 @@ #if (defined(__linux__) || defined(__CYGWIN__)) #include #include -#elif defined(__FreeBSD__) -#include -#define bswap_16(x) bswap16(x) -#define bswap_32(x) bswap32(x) -#define bswap_64(x) bswap64(x) -#else -#error "Please add support for your OS." -#endif -/* - * BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN are only defined on Linux - * if __USE_BSD is defined. Force their definition. - */ -#ifndef BYTE_ORDER -#define BYTE_ORDER __BYTE_ORDER -#endif +#define lttng_ust_bswap_16(x) bswap_16(x) +#define lttng_ust_bswap_32(x) bswap_32(x) +#define lttng_ust_bswap_64(x) bswap_64(x) -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN __LITTLE_ENDIAN -#endif - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN __BIG_ENDIAN -#endif +#define LTTNG_UST_BYTE_ORDER __BYTE_ORDER +#define LTTNG_UST_LITTLE_ENDIAN __LITTLE_ENDIAN +#define LTTNG_UST_BIG_ENDIAN __BIG_ENDIAN -#ifndef FLOAT_WORD_ORDER #ifdef __FLOAT_WORD_ORDER -#define FLOAT_WORD_ORDER __FLOAT_WORD_ORDER +#define LTTNG_UST_FLOAT_WORD_ORDER __FLOAT_WORD_ORDER #else /* __FLOAT_WORD_ORDER */ -#define FLOAT_WORD_ORDER BYTE_ORDER +#define LTTNG_UST_FLOAT_WORD_ORDER __BYTE_ORDER #endif /* __FLOAT_WORD_ORDER */ -#endif /* FLOAT_WORD_ORDER */ + +#elif defined(__FreeBSD__) + +#include + +#define lttng_ust_bswap_16(x) bswap16(x) +#define lttng_ust_bswap_32(x) bswap32(x) +#define lttng_ust_bswap_64(x) bswap64(x) + +#define LTTNG_UST_BYTE_ORDER BYTE_ORDER +#define LTTNG_UST_LITTLE_ENDIAN LITTLE_ENDIAN +#define LTTNG_UST_BIG_ENDIAN BIG_ENDIAN +#define FLOAT_WORD_ORDER BYTE_ORDER + +#else +#error "Please add support for your OS." +#endif #endif /* _LTTNG_UST_ENDIAN_H */ diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index cf1045bb..5e94bafe 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -125,7 +125,7 @@ struct lttng_ust_type_integer { .size = sizeof(_type) * CHAR_BIT, \ .alignment = lttng_ust_rb_alignof(_type) * CHAR_BIT, \ .signedness = lttng_ust_is_signed_type(_type), \ - .reverse_byte_order = _byte_order != BYTE_ORDER, \ + .reverse_byte_order = _byte_order != LTTNG_UST_BYTE_ORDER, \ .base = _base, \ })) @@ -157,7 +157,7 @@ struct lttng_ust_type_float { - lttng_ust_float_mant_dig(_type), \ .mant_dig = lttng_ust_float_mant_dig(_type), \ .alignment = lttng_ust_rb_alignof(_type) * CHAR_BIT, \ - .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \ + .reverse_byte_order = LTTNG_UST_BYTE_ORDER != LTTNG_UST_FLOAT_WORD_ORDER, \ })) diff --git a/include/lttng/ust-tracepoint-event-nowrite.h b/include/lttng/ust-tracepoint-event-nowrite.h index 3193d702..7ee01e38 100644 --- a/include/lttng/ust-tracepoint-event-nowrite.h +++ b/include/lttng/ust-tracepoint-event-nowrite.h @@ -6,7 +6,7 @@ #undef ctf_integer_nowrite #define ctf_integer_nowrite(_type, _item, _src) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, 1) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, 1) #undef ctf_float_nowrite #define ctf_float_nowrite(_type, _item, _src) \ @@ -14,49 +14,49 @@ #undef ctf_array_nowrite #define ctf_array_nowrite(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, none, 1, 10) + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, _length, none, 1, 10) #undef ctf_array_nowrite_hex #define ctf_array_nowrite_hex(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, none, 1, 16) + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, _length, none, 1, 16) #undef ctf_array_network_nowrite #define ctf_array_network_nowrite(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length, none, 1, 10) #undef ctf_array_network_nowrite_hex #define ctf_array_network_nowrite_hex(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length, none, 1, 16) #undef ctf_array_text_nowrite #define ctf_array_text_nowrite(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, UTF8, 1, 10) + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, _length, UTF8, 1, 10) #undef ctf_sequence_nowrite #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length_type, _src_length, none, 1, 10) #undef ctf_sequence_nowrite_hex #define ctf_sequence_nowrite_hex(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length_type, _src_length, none, 1, 16) #undef ctf_sequence_network_nowrite #define ctf_sequence_network_nowrite(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length_type, _src_length, none, 1, 10) #undef ctf_sequence_network_nowrite_hex #define ctf_sequence_network_nowrite_hex(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length_type, _src_length, none, 1, 16) #undef ctf_sequence_text_nowrite #define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length_type, _src_length, UTF8, 1, 10) #undef ctf_string_nowrite diff --git a/include/lttng/ust-tracepoint-event-write.h b/include/lttng/ust-tracepoint-event-write.h index 87f621cd..6e7e6ceb 100644 --- a/include/lttng/ust-tracepoint-event-write.h +++ b/include/lttng/ust-tracepoint-event-write.h @@ -6,19 +6,19 @@ #undef ctf_integer #define ctf_integer(_type, _item, _src) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, 0) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, 0) #undef ctf_integer_hex #define ctf_integer_hex(_type, _item, _src) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 16, 0) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 16, 0) #undef ctf_integer_network #define ctf_integer_network(_type, _item, _src) \ - _ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 10, 0) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, 10, 0) #undef ctf_integer_network_hex #define ctf_integer_network_hex(_type, _item, _src) \ - _ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 16, 0) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, 16, 0) #undef ctf_float #define ctf_float(_type, _item, _src) \ @@ -26,52 +26,52 @@ #undef ctf_array #define ctf_array(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length, none, 0, 10) #undef ctf_array_hex #define ctf_array_hex(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length, none, 0, 16) #undef ctf_array_network #define ctf_array_network(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length, none, 0, 10) #undef ctf_array_network_hex #define ctf_array_network_hex(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length, none, 0, 16) #undef ctf_array_text #define ctf_array_text(_type, _item, _src, _length) \ - _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length, UTF8, 0, 10) #undef ctf_sequence #define ctf_sequence(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length_type, _src_length, none, 0, 10) #undef ctf_sequence_hex #define ctf_sequence_hex(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length_type, _src_length, none, 0, 16) #undef ctf_sequence_network #define ctf_sequence_network(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length_type, _src_length, none, 0, 10) #undef ctf_sequence_network_hex #define ctf_sequence_network_hex(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, \ _length_type, _src_length, none, 0, 16) #undef ctf_sequence_text #define ctf_sequence_text(_type, _item, _src, _length_type, _src_length) \ - _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ + _ctf_sequence_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, \ _length_type, _src_length, UTF8, 0, 10) #undef ctf_string diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 10b47b2c..fb5d0654 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -306,7 +306,7 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \ .struct_size = sizeof(struct lttng_ust_event_field), \ .name = "_" #_item "_length", \ - .type = lttng_ust_type_integer_define(_length_type, BYTE_ORDER, 10), \ + .type = lttng_ust_type_integer_define(_length_type, LTTNG_UST_BYTE_ORDER, 10), \ .nowrite = _nowrite, \ .nofilter = 1, \ }), \ @@ -357,7 +357,7 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG }, \ .struct_size = sizeof(struct lttng_ust_type_enum), \ .desc = &__enum_##_provider##_##_name, \ - .container_type = lttng_ust_type_integer_define(_type, BYTE_ORDER, 10), \ + .container_type = lttng_ust_type_integer_define(_type, LTTNG_UST_BYTE_ORDER, 10), \ }), \ .nowrite = _nowrite, \ .nofilter = 0, \ @@ -458,7 +458,7 @@ static void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_D #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, _nowrite) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite) #undef LTTNG_UST_TP_ARGS #define LTTNG_UST_TP_ARGS(...) __VA_ARGS__ @@ -514,24 +514,24 @@ size_t lttng_ust__event_get_size__##_provider##___##_name( \ case 2: \ { \ union { _type t; int16_t v; } __tmp = { (_type) (_src) }; \ - if (_byte_order != BYTE_ORDER) \ - __tmp.v = bswap_16(__tmp.v); \ + if (_byte_order != LTTNG_UST_BYTE_ORDER) \ + __tmp.v = lttng_ust_bswap_16(__tmp.v); \ __ctf_tmp_int64 = (int64_t) __tmp.v; \ break; \ } \ case 4: \ { \ union { _type t; int32_t v; } __tmp = { (_type) (_src) }; \ - if (_byte_order != BYTE_ORDER) \ - __tmp.v = bswap_32(__tmp.v); \ + if (_byte_order != LTTNG_UST_BYTE_ORDER) \ + __tmp.v = lttng_ust_bswap_32(__tmp.v); \ __ctf_tmp_int64 = (int64_t) __tmp.v; \ break; \ } \ case 8: \ { \ union { _type t; int64_t v; } __tmp = { (_type) (_src) }; \ - if (_byte_order != BYTE_ORDER) \ - __tmp.v = bswap_64(__tmp.v); \ + if (_byte_order != LTTNG_UST_BYTE_ORDER) \ + __tmp.v = lttng_ust_bswap_64(__tmp.v); \ __ctf_tmp_int64 = (int64_t) __tmp.v; \ break; \ } \ @@ -551,24 +551,24 @@ size_t lttng_ust__event_get_size__##_provider##___##_name( \ case 2: \ { \ union { _type t; uint16_t v; } __tmp = { (_type) (_src) }; \ - if (_byte_order != BYTE_ORDER) \ - __tmp.v = bswap_16(__tmp.v); \ + if (_byte_order != LTTNG_UST_BYTE_ORDER) \ + __tmp.v = lttng_ust_bswap_16(__tmp.v); \ __ctf_tmp_uint64 = (uint64_t) __tmp.v; \ break; \ } \ case 4: \ { \ union { _type t; uint32_t v; } __tmp = { (_type) (_src) }; \ - if (_byte_order != BYTE_ORDER) \ - __tmp.v = bswap_32(__tmp.v); \ + if (_byte_order != LTTNG_UST_BYTE_ORDER) \ + __tmp.v = lttng_ust_bswap_32(__tmp.v); \ __ctf_tmp_uint64 = (uint64_t) __tmp.v; \ break; \ } \ case 8: \ { \ union { _type t; uint64_t v; } __tmp = { (_type) (_src) }; \ - if (_byte_order != BYTE_ORDER) \ - __tmp.v = bswap_64(__tmp.v); \ + if (_byte_order != LTTNG_UST_BYTE_ORDER) \ + __tmp.v = lttng_ust_bswap_64(__tmp.v); \ __ctf_tmp_uint64 = (uint64_t) __tmp.v; \ break; \ } \ @@ -627,7 +627,7 @@ size_t lttng_ust__event_get_size__##_provider##___##_name( \ #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, _nowrite) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite) #undef LTTNG_UST_TP_ARGS #define LTTNG_UST_TP_ARGS(...) __VA_ARGS__ @@ -702,7 +702,7 @@ void lttng_ust__event_prepare_interpreter_stack__##_provider##___##_name(char *_ #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, _nowrite) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite) #undef LTTNG_UST_TP_ARGS #define LTTNG_UST_TP_ARGS(...) __VA_ARGS__ @@ -786,7 +786,7 @@ size_t lttng_ust__event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_PR #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \ - _ctf_integer_ext(_type, _item, _src, BYTE_ORDER, 10, _nowrite) + _ctf_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite) /* Beware: this get len actually consumes the len value */ #undef lttng_ust__get_dynamic_len diff --git a/src/common/bitfield.h b/src/common/bitfield.h index 7cb5b32d..63ae1efd 100644 --- a/src/common/bitfield.h +++ b/src/common/bitfield.h @@ -10,7 +10,7 @@ #include /* C99 5.2.4.2 Numerical limits */ #include /* C99 5.2.4.2 Numerical limits */ #include /* C99 7.16 bool type */ -#include /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */ +#include /* Non-standard LTTNG_UST_BIG_ENDIAN, LTTNG_UST_LITTLE_ENDIAN, LTTNG_UST_BYTE_ORDER */ /* * This header strictly follows the C99 standard, except for use of the @@ -310,7 +310,7 @@ do { \ * bt_bitfield_write_be - write integer to a bitfield in big endian */ -#if (BYTE_ORDER == LITTLE_ENDIAN) +#if (LTTNG_UST_BYTE_ORDER == LTTNG_UST_LITTLE_ENDIAN) #define bt_bitfield_write(ptr, type, start, length, v) \ _bt_bitfield_write_le(ptr, type, start, length, v) @@ -321,7 +321,7 @@ do { \ #define bt_bitfield_write_be(ptr, type, start, length, v) \ _bt_bitfield_write_be(ptr, unsigned char, start, length, v) -#elif (BYTE_ORDER == BIG_ENDIAN) +#elif (LTTNG_UST_BYTE_ORDER == LTTNG_UST_BIG_ENDIAN) #define bt_bitfield_write(ptr, type, start, length, v) \ _bt_bitfield_write_be(ptr, type, start, length, v) @@ -332,7 +332,7 @@ do { \ #define bt_bitfield_write_be(ptr, type, start, length, v) \ _bt_bitfield_write_be(ptr, type, start, length, v) -#else /* (BYTE_ORDER == PDP_ENDIAN) */ +#else /* (LTTNG_UST_BYTE_ORDER == PDP_ENDIAN) */ #error "Byte order not supported" @@ -478,7 +478,7 @@ do { \ * bt_bitfield_read_be - read integer from a bitfield in big endian */ -#if (BYTE_ORDER == LITTLE_ENDIAN) +#if (LTTNG_UST_BYTE_ORDER == LTTNG_UST_LITTLE_ENDIAN) #define bt_bitfield_read(ptr, type, start, length, vptr) \ _bt_bitfield_read_le(ptr, type, start, length, vptr) @@ -489,7 +489,7 @@ do { \ #define bt_bitfield_read_be(ptr, type, start, length, vptr) \ _bt_bitfield_read_be(ptr, unsigned char, start, length, vptr) -#elif (BYTE_ORDER == BIG_ENDIAN) +#elif (LTTNG_UST_BYTE_ORDER == LTTNG_UST_BIG_ENDIAN) #define bt_bitfield_read(ptr, type, start, length, vptr) \ _bt_bitfield_read_be(ptr, type, start, length, vptr) @@ -500,7 +500,7 @@ do { \ #define bt_bitfield_read_be(ptr, type, start, length, vptr) \ _bt_bitfield_read_be(ptr, type, start, length, vptr) -#else /* (BYTE_ORDER == PDP_ENDIAN) */ +#else /* (LTTNG_UST_BYTE_ORDER == PDP_ENDIAN) */ #error "Byte order not supported" diff --git a/src/common/elf.c b/src/common/elf.c index b418176b..cec10052 100644 --- a/src/common/elf.c +++ b/src/common/elf.c @@ -456,9 +456,9 @@ int lttng_ust_elf_get_build_id_from_segment( } if (!is_elf_native_endian(elf)) { - nhdr.n_namesz = bswap_32(nhdr.n_namesz); - nhdr.n_descsz = bswap_32(nhdr.n_descsz); - nhdr.n_type = bswap_32(nhdr.n_type); + nhdr.n_namesz = lttng_ust_bswap_32(nhdr.n_namesz); + nhdr.n_descsz = lttng_ust_bswap_32(nhdr.n_descsz); + nhdr.n_type = lttng_ust_bswap_32(nhdr.n_type); } offset += sizeof(nhdr) + nhdr.n_namesz; @@ -629,7 +629,7 @@ int lttng_ust_elf_get_debug_link_from_section(struct lttng_ust_elf *elf, goto error; } if (!is_elf_native_endian(elf)) { - _crc = bswap_32(_crc); + _crc = lttng_ust_bswap_32(_crc); } end: diff --git a/src/common/elf.h b/src/common/elf.h index 17f94676..9a6b2984 100644 --- a/src/common/elf.h +++ b/src/common/elf.h @@ -74,7 +74,7 @@ struct lttng_ust_elf { * Determine native endianness in order to convert when reading an ELF * file if there is a mismatch. */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if LTTNG_UST_BYTE_ORDER == LTTNG_UST_LITTLE_ENDIAN #define NATIVE_ELF_ENDIANNESS ELFDATA2LSB #else #define NATIVE_ELF_ENDIANNESS ELFDATA2MSB @@ -100,13 +100,13 @@ struct lttng_ust_elf { do { \ switch (sizeof(x)) { \ case 8: \ - x = bswap_64(x); \ + x = lttng_ust_bswap_64(x); \ break; \ case 4: \ - x = bswap_32(x); \ + x = lttng_ust_bswap_32(x); \ break; \ case 2: \ - x = bswap_16(x); \ + x = lttng_ust_bswap_16(x); \ break; \ case 1: \ break; \ diff --git a/src/common/events.h b/src/common/events.h index e827f71d..5fdec870 100644 --- a/src/common/events.h +++ b/src/common/events.h @@ -514,7 +514,7 @@ const struct lttng_ust_type_struct *lttng_ust_get_type_struct(const struct lttng .size = (_size), \ .alignment = (_alignment), \ .signedness = (_signedness), \ - .reverse_byte_order = (_byte_order) != BYTE_ORDER, \ + .reverse_byte_order = (_byte_order) != LTTNG_UST_BYTE_ORDER, \ .base = (_base), \ })) @@ -529,7 +529,7 @@ const struct lttng_ust_type_struct *lttng_ust_get_type_struct(const struct lttng .encoding = lttng_ust_string_encoding_UTF8, \ .elem_type = lttng_ust_static_type_integer(sizeof(char) * CHAR_BIT, \ lttng_ust_rb_alignof(char) * CHAR_BIT, lttng_ust_is_signed_type(char), \ - BYTE_ORDER, 10), \ + LTTNG_UST_BYTE_ORDER, 10), \ })) #define lttng_ust_static_event_field(_name, _type, _nowrite, _nofilter) \ diff --git a/src/common/jhash.h b/src/common/jhash.h index 4941b945..d2560af4 100644 --- a/src/common/jhash.h +++ b/src/common/jhash.h @@ -41,10 +41,10 @@ do { \ c ^= b; c -= rot(b, 24); \ } -#if (BYTE_ORDER == LITTLE_ENDIAN) -#define HASH_LITTLE_ENDIAN 1 +#if (LTTNG_UST_BYTE_ORDER == LTTNG_UST_LITTLE_ENDIAN) +#define HASH_LTTNG_UST_LITTLE_ENDIAN 1 #else -#define HASH_LITTLE_ENDIAN 0 +#define HASH_LTTNG_UST_LITTLE_ENDIAN 0 #endif /* @@ -85,7 +85,7 @@ uint32_t hashlittle(const void *key, size_t length, uint32_t initval) a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; u.ptr = key; - if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { + if (HASH_LTTNG_UST_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { const uint32_t *k = (const uint32_t *) key; /* read 32-bit chunks */ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ @@ -128,7 +128,7 @@ uint32_t hashlittle(const void *key, size_t length, uint32_t initval) } } - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { + } else if (HASH_LTTNG_UST_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { const uint16_t *k = (const uint16_t *) key; /* read 16-bit chunks */ const uint8_t *k8; diff --git a/src/lib/lttng-ust-ctl/ustctl.c b/src/lib/lttng-ust-ctl/ustctl.c index 75b3a25e..137bf433 100644 --- a/src/lib/lttng-ust-ctl/ustctl.c +++ b/src/lib/lttng-ust-ctl/ustctl.c @@ -2125,11 +2125,11 @@ int ustctl_recv_reg_msg(int sock, return len; if (reg_msg.magic == LTTNG_UST_ABI_COMM_MAGIC) { - *byte_order = BYTE_ORDER == BIG_ENDIAN ? - BIG_ENDIAN : LITTLE_ENDIAN; - } else if (reg_msg.magic == bswap_32(LTTNG_UST_ABI_COMM_MAGIC)) { - *byte_order = BYTE_ORDER == BIG_ENDIAN ? - LITTLE_ENDIAN : BIG_ENDIAN; + *byte_order = LTTNG_UST_BYTE_ORDER == LTTNG_UST_BIG_ENDIAN ? + LTTNG_UST_BIG_ENDIAN : LTTNG_UST_LITTLE_ENDIAN; + } else if (reg_msg.magic == lttng_ust_bswap_32(LTTNG_UST_ABI_COMM_MAGIC)) { + *byte_order = LTTNG_UST_BYTE_ORDER == LTTNG_UST_BIG_ENDIAN ? + LTTNG_UST_LITTLE_ENDIAN : LTTNG_UST_BIG_ENDIAN; } else { return -LTTNG_UST_ERR_INVAL_MAGIC; } diff --git a/src/lib/lttng-ust/event-notifier-notification.c b/src/lib/lttng-ust/event-notifier-notification.c index 51f10b2e..fe228c5d 100644 --- a/src/lib/lttng-ust/event-notifier-notification.c +++ b/src/lib/lttng-ust/event-notifier-notification.c @@ -79,7 +79,7 @@ int64_t capture_sequence_element_signed(uint8_t *ptr, int16_t tmp; tmp = *(int16_t *) ptr; if (byte_order_reversed) - tmp = bswap_16(tmp); + tmp = lttng_ust_bswap_16(tmp); value = tmp; break; @@ -89,7 +89,7 @@ int64_t capture_sequence_element_signed(uint8_t *ptr, int32_t tmp; tmp = *(int32_t *) ptr; if (byte_order_reversed) - tmp = bswap_32(tmp); + tmp = lttng_ust_bswap_32(tmp); value = tmp; break; @@ -99,7 +99,7 @@ int64_t capture_sequence_element_signed(uint8_t *ptr, int64_t tmp; tmp = *(int64_t *) ptr; if (byte_order_reversed) - tmp = bswap_64(tmp); + tmp = lttng_ust_bswap_64(tmp); value = tmp; break; @@ -128,7 +128,7 @@ uint64_t capture_sequence_element_unsigned(uint8_t *ptr, uint16_t tmp; tmp = *(uint16_t *) ptr; if (byte_order_reversed) - tmp = bswap_16(tmp); + tmp = lttng_ust_bswap_16(tmp); value = tmp; break; @@ -138,7 +138,7 @@ uint64_t capture_sequence_element_unsigned(uint8_t *ptr, uint32_t tmp; tmp = *(uint32_t *) ptr; if (byte_order_reversed) - tmp = bswap_32(tmp); + tmp = lttng_ust_bswap_32(tmp); value = tmp; break; @@ -148,7 +148,7 @@ uint64_t capture_sequence_element_unsigned(uint8_t *ptr, uint64_t tmp; tmp = *(uint64_t *) ptr; if (byte_order_reversed) - tmp = bswap_64(tmp); + tmp = lttng_ust_bswap_64(tmp); value = tmp; break; diff --git a/src/lib/lttng-ust/lttng-bytecode-interpreter.c b/src/lib/lttng-ust/lttng-bytecode-interpreter.c index 141e57f4..0afa8ae6 100644 --- a/src/lib/lttng-ust/lttng-bytecode-interpreter.c +++ b/src/lib/lttng-ust/lttng-bytecode-interpreter.c @@ -457,7 +457,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field s16\n"); tmp = *(int16_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_16(tmp); + tmp = lttng_ust_bswap_16(tmp); stack_top->u.v = tmp; stack_top->type = REG_S64; break; @@ -469,7 +469,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field s32\n"); tmp = *(int32_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_32(tmp); + tmp = lttng_ust_bswap_32(tmp); stack_top->u.v = tmp; stack_top->type = REG_S64; break; @@ -481,7 +481,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field s64\n"); tmp = *(int64_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_64(tmp); + tmp = lttng_ust_bswap_64(tmp); stack_top->u.v = tmp; stack_top->type = REG_S64; break; @@ -493,7 +493,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field signed enumeration\n"); tmp = *(int64_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_64(tmp); + tmp = lttng_ust_bswap_64(tmp); stack_top->u.v = tmp; stack_top->type = REG_S64; break; @@ -510,7 +510,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field u16\n"); tmp = *(uint16_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_16(tmp); + tmp = lttng_ust_bswap_16(tmp); stack_top->u.v = tmp; stack_top->type = REG_U64; break; @@ -522,7 +522,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field u32\n"); tmp = *(uint32_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_32(tmp); + tmp = lttng_ust_bswap_32(tmp); stack_top->u.v = tmp; stack_top->type = REG_U64; break; @@ -534,7 +534,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field u64\n"); tmp = *(uint64_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_64(tmp); + tmp = lttng_ust_bswap_64(tmp); stack_top->u.v = tmp; stack_top->type = REG_U64; break; @@ -546,7 +546,7 @@ static int dynamic_load_field(struct estack_entry *stack_top) dbg_printf("op load field unsigned enumeration\n"); tmp = *(uint64_t *) stack_top->u.ptr.ptr; if (stack_top->u.ptr.rev_bo) - tmp = bswap_64(tmp); + tmp = lttng_ust_bswap_64(tmp); stack_top->u.v = tmp; stack_top->type = REG_U64; break; diff --git a/src/lib/lttng-ust/lttng-context-cgroup-ns.c b/src/lib/lttng-ust/lttng-context-cgroup-ns.c index 7e992d86..3f86f175 100644 --- a/src/lib/lttng-ust/lttng-context-cgroup-ns.c +++ b/src/lib/lttng-ust/lttng-context-cgroup-ns.c @@ -125,7 +125,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), cgroup_ns_get_size, cgroup_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-cpu-id.c b/src/lib/lttng-ust/lttng-context-cpu-id.c index f1455ea1..0b87bd3c 100644 --- a/src/lib/lttng-ust/lttng-context-cpu-id.c +++ b/src/lib/lttng-ust/lttng-context-cpu-id.c @@ -58,7 +58,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(int) * CHAR_BIT, lttng_ust_rb_alignof(int) * CHAR_BIT, lttng_ust_is_signed_type(int), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), cpu_id_get_size, cpu_id_record, diff --git a/src/lib/lttng-ust/lttng-context-ip.c b/src/lib/lttng-ust/lttng-context-ip.c index 2a652913..00ed8b06 100644 --- a/src/lib/lttng-ust/lttng-context-ip.c +++ b/src/lib/lttng-ust/lttng-context-ip.c @@ -44,7 +44,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(void *) * CHAR_BIT, lttng_ust_rb_alignof(void *) * CHAR_BIT, lttng_ust_is_signed_type(void *), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), ip_get_size, ip_record, diff --git a/src/lib/lttng-ust/lttng-context-ipc-ns.c b/src/lib/lttng-ust/lttng-context-ipc-ns.c index d6206bd4..fcf6b0cc 100644 --- a/src/lib/lttng-ust/lttng-context-ipc-ns.c +++ b/src/lib/lttng-ust/lttng-context-ipc-ns.c @@ -123,7 +123,7 @@ const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), ipc_ns_get_size, ipc_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-mnt-ns.c b/src/lib/lttng-ust/lttng-context-mnt-ns.c index e7b32e64..d62bc860 100644 --- a/src/lib/lttng-ust/lttng-context-mnt-ns.c +++ b/src/lib/lttng-ust/lttng-context-mnt-ns.c @@ -106,7 +106,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), mnt_ns_get_size, mnt_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-net-ns.c b/src/lib/lttng-ust/lttng-context-net-ns.c index 5a8086f4..5b269c61 100644 --- a/src/lib/lttng-ust/lttng-context-net-ns.c +++ b/src/lib/lttng-ust/lttng-context-net-ns.c @@ -123,7 +123,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), net_ns_get_size, net_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-perf-counters.c b/src/lib/lttng-ust/lttng-context-perf-counters.c index 328980c4..5a7dec4a 100644 --- a/src/lib/lttng-ust/lttng-context-perf-counters.c +++ b/src/lib/lttng-ust/lttng-context-perf-counters.c @@ -531,7 +531,7 @@ static const struct lttng_ust_type_common *ust_type = lttng_ust_static_type_integer(sizeof(uint64_t) * CHAR_BIT, lttng_ust_rb_alignof(uint64_t) * CHAR_BIT, lttng_ust_is_signed_type(uint64_t), - BYTE_ORDER, 10); + LTTNG_UST_BYTE_ORDER, 10); /* Called with UST lock held */ int lttng_add_perf_counter_to_ctx(uint32_t type, diff --git a/src/lib/lttng-ust/lttng-context-pid-ns.c b/src/lib/lttng-ust/lttng-context-pid-ns.c index f8e5aa4f..f1bb48fa 100644 --- a/src/lib/lttng-ust/lttng-context-pid-ns.c +++ b/src/lib/lttng-ust/lttng-context-pid-ns.c @@ -109,7 +109,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), pid_ns_get_size, pid_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-pthread-id.c b/src/lib/lttng-ust/lttng-context-pthread-id.c index 8a608c24..af98816b 100644 --- a/src/lib/lttng-ust/lttng-context-pthread-id.c +++ b/src/lib/lttng-ust/lttng-context-pthread-id.c @@ -50,7 +50,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(unsigned long) * CHAR_BIT, lttng_ust_rb_alignof(unsigned long) * CHAR_BIT, lttng_ust_is_signed_type(unsigned long), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), pthread_id_get_size, pthread_id_record, diff --git a/src/lib/lttng-ust/lttng-context-time-ns.c b/src/lib/lttng-ust/lttng-context-time-ns.c index 328d9e08..78423298 100644 --- a/src/lib/lttng-ust/lttng-context-time-ns.c +++ b/src/lib/lttng-ust/lttng-context-time-ns.c @@ -122,7 +122,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), time_ns_get_size, time_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-user-ns.c b/src/lib/lttng-ust/lttng-context-user-ns.c index ab49e34c..97612bc6 100644 --- a/src/lib/lttng-ust/lttng-context-user-ns.c +++ b/src/lib/lttng-ust/lttng-context-user-ns.c @@ -106,7 +106,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), user_ns_get_size, user_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-uts-ns.c b/src/lib/lttng-ust/lttng-context-uts-ns.c index 9ca666eb..0ec8ed44 100644 --- a/src/lib/lttng-ust/lttng-context-uts-ns.c +++ b/src/lib/lttng-ust/lttng-context-uts-ns.c @@ -124,7 +124,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, lttng_ust_is_signed_type(ino_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), uts_ns_get_size, uts_ns_record, diff --git a/src/lib/lttng-ust/lttng-context-vegid.c b/src/lib/lttng-ust/lttng-context-vegid.c index 9fcd43ec..682f7d9a 100644 --- a/src/lib/lttng-ust/lttng-context-vegid.c +++ b/src/lib/lttng-ust/lttng-context-vegid.c @@ -95,7 +95,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(gid_t) * CHAR_BIT, lttng_ust_rb_alignof(gid_t) * CHAR_BIT, lttng_ust_is_signed_type(gid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vegid_get_size, vegid_record, diff --git a/src/lib/lttng-ust/lttng-context-veuid.c b/src/lib/lttng-ust/lttng-context-veuid.c index 201ee2f3..505a1b63 100644 --- a/src/lib/lttng-ust/lttng-context-veuid.c +++ b/src/lib/lttng-ust/lttng-context-veuid.c @@ -95,7 +95,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(uid_t) * CHAR_BIT, lttng_ust_rb_alignof(uid_t) * CHAR_BIT, lttng_ust_is_signed_type(uid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), veuid_get_size, veuid_record, diff --git a/src/lib/lttng-ust/lttng-context-vgid.c b/src/lib/lttng-ust/lttng-context-vgid.c index 312580e3..c19be225 100644 --- a/src/lib/lttng-ust/lttng-context-vgid.c +++ b/src/lib/lttng-ust/lttng-context-vgid.c @@ -95,7 +95,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(gid_t) * CHAR_BIT, lttng_ust_rb_alignof(gid_t) * CHAR_BIT, lttng_ust_is_signed_type(gid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vgid_get_size, vgid_record, diff --git a/src/lib/lttng-ust/lttng-context-vpid.c b/src/lib/lttng-ust/lttng-context-vpid.c index 47b5a8e1..1558ee98 100644 --- a/src/lib/lttng-ust/lttng-context-vpid.c +++ b/src/lib/lttng-ust/lttng-context-vpid.c @@ -78,7 +78,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(pid_t) * CHAR_BIT, lttng_ust_rb_alignof(pid_t) * CHAR_BIT, lttng_ust_is_signed_type(pid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vpid_get_size, vpid_record, diff --git a/src/lib/lttng-ust/lttng-context-vsgid.c b/src/lib/lttng-ust/lttng-context-vsgid.c index e05e680d..f66b6b76 100644 --- a/src/lib/lttng-ust/lttng-context-vsgid.c +++ b/src/lib/lttng-ust/lttng-context-vsgid.c @@ -99,7 +99,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(gid_t) * CHAR_BIT, lttng_ust_rb_alignof(gid_t) * CHAR_BIT, lttng_ust_is_signed_type(gid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vsgid_get_size, vsgid_record, diff --git a/src/lib/lttng-ust/lttng-context-vsuid.c b/src/lib/lttng-ust/lttng-context-vsuid.c index ee2f022b..2e442c94 100644 --- a/src/lib/lttng-ust/lttng-context-vsuid.c +++ b/src/lib/lttng-ust/lttng-context-vsuid.c @@ -99,7 +99,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(uid_t) * CHAR_BIT, lttng_ust_rb_alignof(uid_t) * CHAR_BIT, lttng_ust_is_signed_type(uid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vsuid_get_size, vsuid_record, diff --git a/src/lib/lttng-ust/lttng-context-vtid.c b/src/lib/lttng-ust/lttng-context-vtid.c index 732a8205..6a206a90 100644 --- a/src/lib/lttng-ust/lttng-context-vtid.c +++ b/src/lib/lttng-ust/lttng-context-vtid.c @@ -82,7 +82,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(pid_t) * CHAR_BIT, lttng_ust_rb_alignof(pid_t) * CHAR_BIT, lttng_ust_is_signed_type(pid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vtid_get_size, vtid_record, diff --git a/src/lib/lttng-ust/lttng-context-vuid.c b/src/lib/lttng-ust/lttng-context-vuid.c index 3e72d05e..d96a8c9b 100644 --- a/src/lib/lttng-ust/lttng-context-vuid.c +++ b/src/lib/lttng-ust/lttng-context-vuid.c @@ -95,7 +95,7 @@ static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_type_integer(sizeof(uid_t) * CHAR_BIT, lttng_ust_rb_alignof(uid_t) * CHAR_BIT, lttng_ust_is_signed_type(uid_t), - BYTE_ORDER, 10), + LTTNG_UST_BYTE_ORDER, 10), false, false), vuid_get_size, vuid_record, diff --git a/src/lib/lttng-ust/lttng-ust-dynamic-type.c b/src/lib/lttng-ust/lttng-ust-dynamic-type.c index 06333906..4147e3a7 100644 --- a/src/lib/lttng-ust/lttng-ust-dynamic-type.c +++ b/src/lib/lttng-ust/lttng-ust-dynamic-type.c @@ -69,49 +69,49 @@ const struct lttng_ust_event_field *dt_var_fields[_NR_LTTNG_UST_DYNAMIC_TYPES] = [LTTNG_UST_DYNAMIC_TYPE_S8] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "int8", - .type = lttng_ust_type_integer_define(int8_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(int8_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_S16] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "int16", - .type = lttng_ust_type_integer_define(int16_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(int16_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_S32] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "int32", - .type = lttng_ust_type_integer_define(int32_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(int32_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_S64] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "int64", - .type = lttng_ust_type_integer_define(int64_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(int64_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_U8] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "uint8", - .type = lttng_ust_type_integer_define(uint8_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(uint8_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_U16] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "uint16", - .type = lttng_ust_type_integer_define(uint16_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(uint16_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_U32] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "uint32", - .type = lttng_ust_type_integer_define(uint32_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(uint32_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_U64] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { .struct_size = sizeof(struct lttng_ust_event_field), .name = "uint64", - .type = lttng_ust_type_integer_define(uint64_t, BYTE_ORDER, 10), + .type = lttng_ust_type_integer_define(uint64_t, LTTNG_UST_BYTE_ORDER, 10), .nowrite = 0, }), [LTTNG_UST_DYNAMIC_TYPE_FLOAT] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { @@ -149,7 +149,7 @@ static const struct lttng_ust_event_field dt_enum_field = { }, .struct_size = sizeof(struct lttng_ust_type_enum), .desc = &dt_enum_desc, - .container_type = lttng_ust_type_integer_define(char, BYTE_ORDER, 10), + .container_type = lttng_ust_type_integer_define(char, LTTNG_UST_BYTE_ORDER, 10), }), .nowrite = 0, }; -- 2.34.1