From: Michael Jeanson Date: Mon, 19 Apr 2021 20:28:55 +0000 (-0400) Subject: Tracepoint API namespacing 'tracepoint_destructors_syms' X-Git-Tag: v2.13.0-rc1~72 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=62eb90f370c02ef86b20f02892b0c0b76bd6f048;p=lttng-ust.git Tracepoint API namespacing 'tracepoint_destructors_syms' 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: I775858f7533c6fc2fad4a1d51e5a677c1a7d5cbb Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 5358f1ce..31cafe4d 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -312,25 +312,25 @@ struct lttng_ust_tracepoint_destructors_syms { /* End of base ABI. Fields below should be used after checking struct_size. */ }; -extern struct lttng_ust_tracepoint_destructors_syms tracepoint_destructors_syms; -extern struct lttng_ust_tracepoint_destructors_syms *tracepoint_destructors_syms_ptr; +extern struct lttng_ust_tracepoint_destructors_syms lttng_ust_tracepoint_destructors_syms; +extern struct lttng_ust_tracepoint_destructors_syms *lttng_ust_tracepoint_destructors_syms_ptr; -struct lttng_ust_tracepoint_destructors_syms tracepoint_destructors_syms +struct lttng_ust_tracepoint_destructors_syms lttng_ust_tracepoint_destructors_syms __attribute__((weak, visibility("hidden"))) = { .struct_size = sizeof(struct lttng_ust_tracepoint_destructors_syms), }; -struct lttng_ust_tracepoint_destructors_syms *tracepoint_destructors_syms_ptr +struct lttng_ust_tracepoint_destructors_syms *lttng_ust_tracepoint_destructors_syms_ptr __attribute__((weak, visibility("hidden"))); static inline void tracepoint_disable_destructors(void) { if (!lttng_ust_tracepoint_dlopen_ptr) lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen; - if (!tracepoint_destructors_syms_ptr) - tracepoint_destructors_syms_ptr = &tracepoint_destructors_syms; + if (!lttng_ust_tracepoint_destructors_syms_ptr) + lttng_ust_tracepoint_destructors_syms_ptr = <tng_ust_tracepoint_destructors_syms; if (lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle - && tracepoint_destructors_syms_ptr->tracepoint_disable_destructors) - tracepoint_destructors_syms_ptr->tracepoint_disable_destructors(); + && lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_disable_destructors) + lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_disable_destructors(); } #ifndef _LGPL_SOURCE @@ -407,8 +407,8 @@ __tracepoints__destroy(void) return; if (!lttng_ust_tracepoint_dlopen_ptr) lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen; - if (!tracepoint_destructors_syms_ptr) - tracepoint_destructors_syms_ptr = &tracepoint_destructors_syms; + if (!lttng_ust_tracepoint_destructors_syms_ptr) + lttng_ust_tracepoint_destructors_syms_ptr = <tng_ust_tracepoint_destructors_syms; if (!lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle) return; if (__tracepoint_ptrs_registered) @@ -416,8 +416,8 @@ __tracepoints__destroy(void) /* * Lookup if destructors must be executed using the new method. */ - if (tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state - && !tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state()) { + if (lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state + && !lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state()) { /* * The tracepoint_get_destructors_state symbol was found with * dlsym but its returned value is 0 meaning that destructors @@ -507,8 +507,8 @@ __tracepoints__ptrs_init(void) dlopen(LTTNG_UST_TRACEPOINT_LIB_SONAME, RTLD_NOW | RTLD_GLOBAL); if (!lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle) return; - if (!tracepoint_destructors_syms_ptr) - tracepoint_destructors_syms_ptr = &tracepoint_destructors_syms; + if (!lttng_ust_tracepoint_destructors_syms_ptr) + lttng_ust_tracepoint_destructors_syms_ptr = <tng_ust_tracepoint_destructors_syms; lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib = URCU_FORCE_CAST(int (*)(struct lttng_ust_tracepoint * const *, int), dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle, @@ -517,11 +517,11 @@ __tracepoints__ptrs_init(void) URCU_FORCE_CAST(int (*)(struct lttng_ust_tracepoint * const *), dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle, "tracepoint_unregister_lib")); - tracepoint_destructors_syms_ptr->tracepoint_disable_destructors = + lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_disable_destructors = URCU_FORCE_CAST(void (*)(void), dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle, "tp_disable_destructors")); - tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state = + lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state = URCU_FORCE_CAST(int (*)(void), dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle, "tp_get_destructors_state")); @@ -545,13 +545,13 @@ __tracepoints__ptrs_destroy(void) return; if (!lttng_ust_tracepoint_dlopen_ptr) lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen; - if (!tracepoint_destructors_syms_ptr) - tracepoint_destructors_syms_ptr = &tracepoint_destructors_syms; + if (!lttng_ust_tracepoint_destructors_syms_ptr) + lttng_ust_tracepoint_destructors_syms_ptr = <tng_ust_tracepoint_destructors_syms; if (lttng_ust_tracepoint_dlopen_ptr->tracepoint_unregister_lib) lttng_ust_tracepoint_dlopen_ptr->tracepoint_unregister_lib(__start___tracepoints_ptrs); if (lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle - && tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state - && tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state() + && lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state + && lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state() && !__tracepoint_ptrs_registered) { ret = dlclose(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle); if (ret) {