From: Michael Jeanson Date: Tue, 20 Apr 2021 20:57:45 +0000 (-0400) Subject: Tracepoint API namespacing 'TP_IP_PARAM' X-Git-Tag: v2.13.0-rc1~45 X-Git-Url: https://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=c28c4a88a1cad73bbeeae2e33546e7b77d1608a1 Tracepoint API namespacing 'TP_IP_PARAM' 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: Ie01946b463b9b7a517699b3d7063ef97da134a43 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h index 0bbecce8..24b387d3 100644 --- a/include/lttng/tracepoint-event.h +++ b/include/lttng/tracepoint-event.h @@ -57,6 +57,12 @@ # endif #endif /* #if LTTNG_UST_COMPAT_API(0) */ +#if LTTNG_UST_COMPAT_API(0) +# if defined(TP_IP_PARAM) && !defined(LTTNG_UST_TP_IP_PARAM) +# define LTTNG_UST_TP_IP_PARAM +# endif +#endif /* #if LTTNG_UST_COMPAT_API(0) */ + #include LTTNG_UST_TRACEPOINT_INCLUDE #include diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index bf7c8377..0df951a4 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -816,15 +816,16 @@ size_t lttng_ust__event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_PR * architecture for now by always using the NULL value for the ip * context. */ -#undef _TP_IP_PARAM -#ifdef TP_IP_PARAM -#define _TP_IP_PARAM(x) (x) +#undef LTTNG_UST__TP_IP_PARAM + +#ifdef LTTNG_UST_TP_IP_PARAM +#define LTTNG_UST__TP_IP_PARAM(x) (x) #else /* TP_IP_PARAM */ #if defined(LTTNG_UST_ARCH_PPC) && !defined(LTTNG_UST_ARCH_PPC64) -#define _TP_IP_PARAM(x) NULL +#define LTTNG_UST__TP_IP_PARAM(x) NULL #else -#define _TP_IP_PARAM(x) __builtin_return_address(0) +#define LTTNG_UST__TP_IP_PARAM(x) __builtin_return_address(0) #endif #endif /* TP_IP_PARAM */ @@ -898,7 +899,7 @@ void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PRO LTTNG_UST__TP_ARGS_DATA_VAR(_args)); \ lttng_ust__event_align = lttng_ust__event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_VAR(_args)); \ lttng_ust_ring_buffer_ctx_init(&__ctx, lttng_ust__event_recorder, __event_len, lttng_ust__event_align, \ - _TP_IP_PARAM(TP_IP_PARAM)); \ + LTTNG_UST__TP_IP_PARAM(LTTNG_UST_TP_IP_PARAM)); \ __ret = __chan->ops->event_reserve(&__ctx); \ if (__ret < 0) \ return; \ diff --git a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c index 2d91d8ac..c50aee9d 100644 --- a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c +++ b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c @@ -11,7 +11,7 @@ #define LTTNG_UST_TRACEPOINT_DEFINE #define LTTNG_UST_TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM func_addr +#define LTTNG_UST_TP_IP_PARAM func_addr #include "lttng-ust-cyg-profile-fast.h" void __cyg_profile_func_enter(void *this_fn, void *call_site) diff --git a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c index e0a0dd61..33f721c7 100644 --- a/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c +++ b/src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.c @@ -11,7 +11,7 @@ #define LTTNG_UST_TRACEPOINT_DEFINE #define LTTNG_UST_TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM func_addr +#define LTTNG_UST_TP_IP_PARAM func_addr #include "lttng-ust-cyg-profile.h" void __cyg_profile_func_enter(void *this_fn, void *call_site) diff --git a/src/lib/lttng-ust-dl/ust_dl.c b/src/lib/lttng-ust-dl/ust_dl.c index 234857ae..3c18a0c6 100644 --- a/src/lib/lttng-ust-dl/ust_dl.c +++ b/src/lib/lttng-ust-dl/ust_dl.c @@ -6,5 +6,5 @@ #define _LGPL_SOURCE #define LTTNG_UST_TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM ip +#define LTTNG_UST_TP_IP_PARAM ip #include "ust_dl.h" diff --git a/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c b/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c index d51c5ab3..19c60340 100644 --- a/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -32,7 +32,7 @@ #define LTTNG_UST_TRACEPOINT_DEFINE #define LTTNG_UST_TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM ip +#define LTTNG_UST_TP_IP_PARAM ip #include "ust_libc.h" #define STATIC_CALLOC_LEN 4096 diff --git a/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c b/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c index 09881e2b..71d21431 100644 --- a/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c +++ b/src/lib/lttng-ust-pthread-wrapper/lttng-ust-pthread.c @@ -18,7 +18,7 @@ #define LTTNG_UST_TRACEPOINT_DEFINE #define LTTNG_UST_TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM ip +#define LTTNG_UST_TP_IP_PARAM ip #include "ust_pthread.h" static __thread int thread_in_trace; diff --git a/src/lib/lttng-ust/lttng-ust-tracef-provider.h b/src/lib/lttng-ust/lttng-ust-tracef-provider.h index 3dc50961..de85552b 100644 --- a/src/lib/lttng-ust/lttng-ust-tracef-provider.h +++ b/src/lib/lttng-ust/lttng-ust-tracef-provider.h @@ -14,7 +14,7 @@ #endif /* _TRACEPOINT_LTTNG_UST_TRACEF_PROVIDER_H */ -#define TP_IP_PARAM ip /* IP context received as parameter */ +#define LTTNG_UST_TP_IP_PARAM ip /* IP context received as parameter */ #undef LTTNG_UST_TRACEPOINT_INCLUDE #define LTTNG_UST_TRACEPOINT_INCLUDE "./tp/lttng-ust-tracef.h" diff --git a/src/lib/lttng-ust/lttng-ust-tracelog-provider.h b/src/lib/lttng-ust/lttng-ust-tracelog-provider.h index 7c70ee79..d9466489 100644 --- a/src/lib/lttng-ust/lttng-ust-tracelog-provider.h +++ b/src/lib/lttng-ust/lttng-ust-tracelog-provider.h @@ -14,7 +14,7 @@ #endif /* _TRACEPOINT_LTTNG_UST_TRACEF_PROVIDER_H */ -#define TP_IP_PARAM ip /* IP context received as parameter */ +#define LTTNG_UST_TP_IP_PARAM ip /* IP context received as parameter */ #undef LTTNG_UST_TRACEPOINT_INCLUDE #define LTTNG_UST_TRACEPOINT_INCLUDE "./tp/lttng-ust-tracelog.h" diff --git a/src/lib/lttng-ust/ust_lib.c b/src/lib/lttng-ust/ust_lib.c index e56a43f6..12cb3a8a 100644 --- a/src/lib/lttng-ust/ust_lib.c +++ b/src/lib/lttng-ust/ust_lib.c @@ -7,5 +7,5 @@ #define _LGPL_SOURCE #define LTTNG_UST_TRACEPOINT_CREATE_PROBES -#define TP_IP_PARAM ip +#define LTTNG_UST_TP_IP_PARAM ip #include "ust_lib.h"