Tracepoint API namespacing ctor, dtor and sections
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 20 Apr 2021 16:05:13 +0000 (12:05 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Apr 2021 15:01:18 +0000 (11:01 -0400)
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: Ibffb8334fdd001671fb6b9c5e001598648499a54
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h
src/lib/lttng-ust/lttng-ust-statedump.c

index 7e7f7aca1360f696d45a0107b81c8cf257a140b1..96f3fe3a629c1099df9b61394077c9ad10c9bd72 100644 (file)
@@ -373,10 +373,10 @@ lttng_ust_tracepoint__init_urcu_sym(void)
 #endif
 
 static void
-__tracepoints__init(void)
+lttng_ust__tracepoints__init(void)
        lttng_ust_notrace __attribute__((constructor));
 static void
-__tracepoints__init(void)
+lttng_ust__tracepoints__init(void)
 {
        if (lttng_ust_tracepoint_registered++) {
                if (!lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle)
@@ -396,10 +396,10 @@ __tracepoints__init(void)
 }
 
 static void
-__tracepoints__destroy(void)
+lttng_ust__tracepoints__destroy(void)
        lttng_ust_notrace __attribute__((destructor));
 static void
-__tracepoints__destroy(void)
+lttng_ust__tracepoints__destroy(void)
 {
        int ret;
 
@@ -440,9 +440,9 @@ __tracepoints__destroy(void)
  * registering only _one_ instance of the tracepoints per shared-ojbect
  * (or for the whole main program).
  */
-extern struct lttng_ust_tracepoint * const __start___tracepoints_ptrs[]
+extern struct lttng_ust_tracepoint * const __start_lttng_ust_tracepoints_ptrs[]
        __attribute__((weak, visibility("hidden")));
-extern struct lttng_ust_tracepoint * const __stop___tracepoints_ptrs[]
+extern struct lttng_ust_tracepoint * const __stop_lttng_ust_tracepoints_ptrs[]
        __attribute__((weak, visibility("hidden")));
 
 /*
@@ -462,7 +462,7 @@ extern struct lttng_ust_tracepoint * const __stop___tracepoints_ptrs[]
 
 /*
  * Note: to allow PIC code, we need to allow the linker to update the pointers
- * in the __tracepoints_ptrs section.
+ * in the lttng_ust_tracepoints_ptrs section.
  * Therefore, this section is _not_ const (read-only).
  */
 #define _TP_EXTRACT_STRING(...)        #__VA_ARGS__
@@ -471,13 +471,13 @@ extern struct lttng_ust_tracepoint * const __stop___tracepoints_ptrs[]
        lttng_ust_tracepoint_validate_name_len(_provider, _name);               \
        extern int lttng_ust_tracepoint_provider_##_provider;                           \
        static const char __tp_provider_strtab_##_provider##___##_name[]        \
-               __attribute__((section("__tracepoints_strings"))) =             \
+               __attribute__((section("lttng_ust_tracepoints_strings"))) =             \
                        #_provider;                                             \
        static const char __tp_name_strtab_##_provider##___##_name[]            \
-               __attribute__((section("__tracepoints_strings"))) =             \
+               __attribute__((section("lttng_ust_tracepoints_strings"))) =             \
                        #_name;                                                 \
        struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name        \
-               __attribute__((section("__tracepoints"))) = {                   \
+               __attribute__((section("lttng_ust_tracepoints"))) = {                   \
                        sizeof(struct lttng_ust_tracepoint),                    \
                        __tp_provider_strtab_##_provider##___##_name,           \
                        __tp_name_strtab_##_provider##___##_name,               \
@@ -488,15 +488,15 @@ extern struct lttng_ust_tracepoint * const __stop___tracepoints_ptrs[]
                };                                                              \
        static struct lttng_ust_tracepoint *                                    \
                lttng_ust_tracepoint_ptr_##_provider##___##_name                        \
-               __attribute__((section("__tracepoints_ptrs"), used))            \
+               __attribute__((section("lttng_ust_tracepoints_ptrs"), used))            \
                __lttng_ust_variable_attribute_no_sanitize_address =            \
                        &lttng_ust_tracepoint_##_provider##___##_name;
 
 static void
-__tracepoints__ptrs_init(void)
+lttng_ust__tracepoints__ptrs_init(void)
        lttng_ust_notrace __attribute__((constructor));
 static void
-__tracepoints__ptrs_init(void)
+lttng_ust__tracepoints__ptrs_init(void)
 {
        if (lttng_ust_tracepoint_ptrs_registered++)
                return;
@@ -527,17 +527,17 @@ __tracepoints__ptrs_init(void)
                                        "tp_get_destructors_state"));
        lttng_ust_tracepoint__init_urcu_sym();
        if (lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib) {
-               lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib(__start___tracepoints_ptrs,
-                               __stop___tracepoints_ptrs -
-                               __start___tracepoints_ptrs);
+               lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib(__start_lttng_ust_tracepoints_ptrs,
+                               __stop_lttng_ust_tracepoints_ptrs -
+                               __start_lttng_ust_tracepoints_ptrs);
        }
 }
 
 static void
-__tracepoints__ptrs_destroy(void)
+lttng_ust__tracepoints__ptrs_destroy(void)
        lttng_ust_notrace __attribute__((destructor));
 static void
-__tracepoints__ptrs_destroy(void)
+lttng_ust__tracepoints__ptrs_destroy(void)
 {
        int ret;
 
@@ -548,7 +548,7 @@ __tracepoints__ptrs_destroy(void)
        if (!lttng_ust_tracepoint_destructors_syms_ptr)
                lttng_ust_tracepoint_destructors_syms_ptr = &lttng_ust_tracepoint_destructors_syms;
        if (lttng_ust_tracepoint_dlopen_ptr->tracepoint_unregister_lib)
-               lttng_ust_tracepoint_dlopen_ptr->tracepoint_unregister_lib(__start___tracepoints_ptrs);
+               lttng_ust_tracepoint_dlopen_ptr->tracepoint_unregister_lib(__start_lttng_ust_tracepoints_ptrs);
        if (lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle
                        && lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state
                        && lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state()
index 1251c3bd9e2aac90f39215631fa40ce61d63f040..31626f8c5fc4d614f7255f6f47b6159844e964b7 100644 (file)
@@ -628,8 +628,8 @@ int do_lttng_ust_statedump(void *owner)
 
 void lttng_ust_statedump_init(void)
 {
-       __tracepoints__init();
-       __tracepoints__ptrs_init();
+       lttng_ust__tracepoints__init();
+       lttng_ust__tracepoints__ptrs_init();
        __lttng_ust_events_init__lttng_ust_statedump();
        lttng_ust_dl_update(LTTNG_UST_CALLER_IP());
 }
@@ -653,7 +653,7 @@ void ust_dl_state_destroy(void)
 void lttng_ust_statedump_destroy(void)
 {
        __lttng_ust_events_exit__lttng_ust_statedump();
-       __tracepoints__ptrs_destroy();
-       __tracepoints__destroy();
+       lttng_ust__tracepoints__ptrs_destroy();
+       lttng_ust__tracepoints__destroy();
        ust_dl_state_destroy();
 }
This page took 0.028807 seconds and 4 git commands to generate.