From ddde62caf455d5abd235c916c7db07214b161129 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 21 Apr 2021 17:27:39 -0400 Subject: [PATCH] Tracepoint API namespacing ctf_unused 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: I41531d9e69604f1809d035147779c8ceeed2add7 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/lttng/tp/lttng-ust-tracef.h | 2 +- include/lttng/tp/lttng-ust-tracelog.h | 2 +- include/lttng/tracepoint.h | 3 +++ include/lttng/ust-tracepoint-event-nowrite.h | 6 +++--- include/lttng/ust-tracepoint-event-reset.h | 12 +++++------ include/lttng/ust-tracepoint-event-write.h | 6 +++--- include/lttng/ust-tracepoint-event.h | 20 +++++++++---------- .../lttng-ust-cyg-profile-fast.h | 2 +- src/lib/lttng-ust-dl/ust_dl.h | 10 +++++----- src/lib/lttng-ust-libc-wrapper/ust_libc.h | 12 +++++------ .../lttng-ust-pthread-wrapper/ust_pthread.h | 8 ++++---- .../lttng-ust/lttng-ust-statedump-provider.h | 12 +++++------ src/lib/lttng-ust/ust_lib.h | 8 ++++---- 13 files changed, 53 insertions(+), 50 deletions(-) diff --git a/include/lttng/tp/lttng-ust-tracef.h b/include/lttng/tp/lttng-ust-tracef.h index 1bbf33a3..5bce593e 100644 --- a/include/lttng/tp/lttng-ust-tracef.h +++ b/include/lttng/tp/lttng-ust-tracef.h @@ -11,7 +11,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_tracef, event, LTTNG_UST_TP_ARGS(const char *, msg, unsigned int, len, void *, ip), LTTNG_UST_TP_FIELDS( lttng_ust_field_sequence_text(char, msg, msg, unsigned int, len) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_tracef, event, LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG) diff --git a/include/lttng/tp/lttng-ust-tracelog.h b/include/lttng/tp/lttng-ust-tracelog.h index 76b0cb30..5e8d9f0d 100644 --- a/include/lttng/tp/lttng-ust-tracelog.h +++ b/include/lttng/tp/lttng-ust-tracelog.h @@ -15,7 +15,7 @@ LTTNG_UST_TRACEPOINT_EVENT_CLASS(lttng_ust_tracelog, tlclass, lttng_ust_field_string(file, file) lttng_ust_field_string(func, func) lttng_ust_field_sequence_text(char, msg, msg, unsigned int, len) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 9ec52ef9..beb2c409 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -621,6 +621,9 @@ lttng_ust__tracepoints__ptrs_destroy(void) #define ctf_string lttng_ust_field_string #define ctf_string_nowrite lttng_ust_field_string_nowrite + +#define ctf_unused lttng_ust_field_unused +#define ctf_unused_nowrite lttng_ust_field_unused_nowrite #endif /* #if LTTNG_UST_COMPAT_API(0) */ #ifdef __cplusplus diff --git a/include/lttng/ust-tracepoint-event-nowrite.h b/include/lttng/ust-tracepoint-event-nowrite.h index 3ae96855..d5406c83 100644 --- a/include/lttng/ust-tracepoint-event-nowrite.h +++ b/include/lttng/ust-tracepoint-event-nowrite.h @@ -63,9 +63,9 @@ #define lttng_ust_field_string_nowrite(_item, _src) \ lttng_ust__field_string(_item, _src, 1) -#undef ctf_unused_nowrite -#define ctf_unused_nowrite(_src) \ - _ctf_unused(_src) +#undef lttng_ust_field_unused_nowrite +#define lttng_ust_field_unused_nowrite(_src) \ + lttng_ust__field_unused(_src) #undef ctf_enum_nowrite #define ctf_enum_nowrite(_provider, _name, _type, _item, _src) \ diff --git a/include/lttng/ust-tracepoint-event-reset.h b/include/lttng/ust-tracepoint-event-reset.h index 3262e0b0..ed1c465e 100644 --- a/include/lttng/ust-tracepoint-event-reset.h +++ b/include/lttng/ust-tracepoint-event-reset.h @@ -45,8 +45,8 @@ #undef lttng_ust__field_string #define lttng_ust__field_string(_item, _src, _nowrite) -#undef _ctf_unused -#define _ctf_unused(_src) +#undef lttng_ust__field_unused +#define lttng_ust__field_unused(_src) #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) @@ -100,8 +100,8 @@ #undef lttng_ust_field_string #define lttng_ust_field_string(_item, _src) -#undef ctf_unused -#define ctf_unused(_src) +#undef lttng_ust_field_unused +#define lttng_ust_field_unused(_src) #undef ctf_enum #define ctf_enum(_provider, _name, _type, _item, _src) @@ -146,8 +146,8 @@ #undef lttng_ust_field_string_nowrite #define lttng_ust_field_string_nowrite(_item, _src) -#undef ctf_unused_nowrite -#define ctf_unused_nowrite(_src) +#undef lttng_ust_field_unused_nowrite +#define lttng_ust_field_unused_nowrite(_src) #undef ctf_enum_nowrite #define ctf_enum_nowrite(_provider, _name, _type, _item, _src) diff --git a/include/lttng/ust-tracepoint-event-write.h b/include/lttng/ust-tracepoint-event-write.h index 1e019672..3c542980 100644 --- a/include/lttng/ust-tracepoint-event-write.h +++ b/include/lttng/ust-tracepoint-event-write.h @@ -78,9 +78,9 @@ #define lttng_ust_field_string(_item, _src) \ lttng_ust__field_string(_item, _src, 0) -#undef ctf_unused -#define ctf_unused(_src) \ - _ctf_unused(_src) +#undef lttng_ust_field_unused +#define lttng_ust_field_unused(_src) \ + lttng_ust__field_unused(_src) #undef ctf_enum #define ctf_enum(_provider, _name, _type, _item, _src) \ diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 8ddf89c4..9399be21 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -343,8 +343,8 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG .nofilter = 0, \ }), -#undef _ctf_unused -#define _ctf_unused(_src) +#undef lttng_ust__field_unused +#define lttng_ust__field_unused(_src) #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \ @@ -451,8 +451,8 @@ static void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_D __event_len += __dynamic_len[__dynamic_len_idx++] = \ strlen((_src) ? (_src) : LTTNG_UST__NULL_STRING) + 1; -#undef _ctf_unused -#define _ctf_unused(_src) \ +#undef lttng_ust__field_unused +#define lttng_ust__field_unused(_src) \ if (0) \ (void) (_src); /* Unused */ @@ -620,8 +620,8 @@ size_t lttng_ust__event_get_size__##_provider##___##_name( \ __stack_data += sizeof(void *); \ } -#undef _ctf_unused -#define _ctf_unused(_src) \ +#undef lttng_ust__field_unused +#define lttng_ust__field_unused(_src) \ if (0) \ (void) (_src); @@ -695,8 +695,8 @@ void lttng_ust__event_prepare_interpreter_stack__##_provider##___##_name(char *_ if (0) \ (void) (_src); /* Unused */ -#undef _ctf_unused -#define _ctf_unused(_src) \ +#undef lttng_ust__field_unused +#define lttng_ust__field_unused(_src) \ if (0) \ (void) (_src); /* Unused */ @@ -781,8 +781,8 @@ size_t lttng_ust__event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_PR lttng_ust__get_dynamic_len(dest)); \ } -#undef _ctf_unused -#define _ctf_unused(_src) +#undef lttng_ust__field_unused +#define lttng_ust__field_unused(_src) #undef _ctf_enum #define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \ diff --git a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.h b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.h index 41776565..690108e8 100644 --- a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.h +++ b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.h @@ -30,7 +30,7 @@ LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile_fast, func_entry, LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_cyg_profile_fast, func_exit, LTTNG_UST_TP_ARGS(void *, func_addr), LTTNG_UST_TP_FIELDS( - ctf_unused(func_addr) + lttng_ust_field_unused(func_addr) ) ) diff --git a/src/lib/lttng-ust-dl/ust_dl.h b/src/lib/lttng-ust-dl/ust_dl.h index f3fa0db1..2808f76b 100644 --- a/src/lib/lttng-ust-dl/ust_dl.h +++ b/src/lib/lttng-ust-dl/ust_dl.h @@ -27,7 +27,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_dl, dlopen, int, flags, uint64_t, memsz, uint8_t, has_build_id, uint8_t, has_debug_link), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint64_t, memsz, memsz) lttng_ust_field_integer_hex(int, flags, flags) @@ -44,7 +44,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_dl, dlmopen, uint64_t, memsz, uint8_t, has_build_id, uint8_t, has_debug_link), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint64_t, memsz, memsz) lttng_ust_field_integer(Lmid_t, nsid, nsid) @@ -64,7 +64,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_dl, build_id, size_t, build_id_len ), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_sequence_hex(uint8_t, build_id, build_id, size_t, build_id_len) @@ -79,7 +79,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_dl, debug_link, uint32_t, crc ), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint32_t, crc, crc) lttng_ust_field_string(filename, filename) @@ -89,7 +89,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_dl, debug_link, LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_dl, dlclose, LTTNG_UST_TP_ARGS(void *, ip, void *, baddr), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) ) ) diff --git a/src/lib/lttng-ust-libc-wrapper/ust_libc.h b/src/lib/lttng-ust-libc-wrapper/ust_libc.h index 8893fdb7..56e9a14d 100644 --- a/src/lib/lttng-ust-libc-wrapper/ust_libc.h +++ b/src/lib/lttng-ust-libc-wrapper/ust_libc.h @@ -21,7 +21,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_libc, malloc, LTTNG_UST_TP_FIELDS( lttng_ust_field_integer(size_t, size, size) lttng_ust_field_integer_hex(void *, ptr, ptr) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -29,7 +29,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_libc, free, LTTNG_UST_TP_ARGS(void *, ptr, void *, ip), LTTNG_UST_TP_FIELDS( lttng_ust_field_integer_hex(void *, ptr, ptr) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -39,7 +39,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_libc, calloc, lttng_ust_field_integer(size_t, nmemb, nmemb) lttng_ust_field_integer(size_t, size, size) lttng_ust_field_integer_hex(void *, ptr, ptr) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -49,7 +49,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_libc, realloc, lttng_ust_field_integer_hex(void *, in_ptr, in_ptr) lttng_ust_field_integer(size_t, size, size) lttng_ust_field_integer_hex(void *, ptr, ptr) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -59,7 +59,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_libc, memalign, lttng_ust_field_integer(size_t, alignment, alignment) lttng_ust_field_integer(size_t, size, size) lttng_ust_field_integer_hex(void *, ptr, ptr) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -70,7 +70,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_libc, posix_memalign, lttng_ust_field_integer(size_t, alignment, alignment) lttng_ust_field_integer(size_t, size, size) lttng_ust_field_integer(int, result, result) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) diff --git a/src/lib/lttng-ust-pthread-wrapper/ust_pthread.h b/src/lib/lttng-ust-pthread-wrapper/ust_pthread.h index 50b04040..c5d50328 100644 --- a/src/lib/lttng-ust-pthread-wrapper/ust_pthread.h +++ b/src/lib/lttng-ust-pthread-wrapper/ust_pthread.h @@ -20,7 +20,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_req, LTTNG_UST_TP_ARGS(pthread_mutex_t *, mutex, void *, ip), LTTNG_UST_TP_FIELDS( lttng_ust_field_integer_hex(void *, mutex, mutex) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -29,7 +29,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_acq, LTTNG_UST_TP_FIELDS( lttng_ust_field_integer_hex(void *, mutex, mutex) lttng_ust_field_integer(int, status, status) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -38,7 +38,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_trylock, LTTNG_UST_TP_FIELDS( lttng_ust_field_integer_hex(void *, mutex, mutex) lttng_ust_field_integer(int, status, status) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) @@ -47,7 +47,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_unlock, LTTNG_UST_TP_FIELDS( lttng_ust_field_integer_hex(void *, mutex, mutex) lttng_ust_field_integer(int, status, status) - ctf_unused(ip) + lttng_ust_field_unused(ip) ) ) diff --git a/src/lib/lttng-ust/lttng-ust-statedump-provider.h b/src/lib/lttng-ust/lttng-ust-statedump-provider.h index a77e3fd0..0cad9ad8 100644 --- a/src/lib/lttng-ust/lttng-ust-statedump-provider.h +++ b/src/lib/lttng-ust/lttng-ust-statedump-provider.h @@ -26,7 +26,7 @@ extern "C" { LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, start, LTTNG_UST_TP_ARGS(struct lttng_ust_session *, session), LTTNG_UST_TP_FIELDS( - ctf_unused(session) + lttng_ust_field_unused(session) ) ) @@ -41,7 +41,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, bin_info, uint8_t, has_debug_link ), LTTNG_UST_TP_FIELDS( - ctf_unused(session) + lttng_ust_field_unused(session) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint64_t, memsz, memsz) lttng_ust_field_string(path, path) @@ -59,7 +59,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, build_id, size_t, build_id_len ), LTTNG_UST_TP_FIELDS( - ctf_unused(session) + lttng_ust_field_unused(session) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_sequence_hex(uint8_t, build_id, build_id, size_t, build_id_len) @@ -74,7 +74,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, debug_link, uint32_t, crc ), LTTNG_UST_TP_FIELDS( - ctf_unused(session) + lttng_ust_field_unused(session) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint32_t, crc, crc) lttng_ust_field_string(filename, filename) @@ -87,7 +87,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, procname, char *, name ), LTTNG_UST_TP_FIELDS( - ctf_unused(session) + lttng_ust_field_unused(session) lttng_ust_field_array_text(char, procname, name, LTTNG_UST_ABI_PROCNAME_LEN) ) ) @@ -95,7 +95,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, procname, LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, end, LTTNG_UST_TP_ARGS(struct lttng_ust_session *, session), LTTNG_UST_TP_FIELDS( - ctf_unused(session) + lttng_ust_field_unused(session) ) ) diff --git a/src/lib/lttng-ust/ust_lib.h b/src/lib/lttng-ust/ust_lib.h index ca521a80..63269f0b 100644 --- a/src/lib/lttng-ust/ust_lib.h +++ b/src/lib/lttng-ust/ust_lib.h @@ -28,7 +28,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_lib, load, uint64_t, memsz, uint8_t, has_build_id, uint8_t, has_debug_link), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint64_t, memsz, memsz) lttng_ust_field_string(path, path) @@ -45,7 +45,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_lib, build_id, size_t, build_id_len ), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_sequence_hex(uint8_t, build_id, build_id, size_t, build_id_len) @@ -60,7 +60,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_lib, debug_link, uint32_t, crc ), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) lttng_ust_field_integer(uint32_t, crc, crc) lttng_ust_field_string(filename, filename) @@ -70,7 +70,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_lib, debug_link, LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_lib, unload, LTTNG_UST_TP_ARGS(void *, ip, void *, baddr), LTTNG_UST_TP_FIELDS( - ctf_unused(ip) + lttng_ust_field_unused(ip) lttng_ust_field_integer_hex(void *, baddr, baddr) ) ) -- 2.34.1