Tracepoint API namespacing 'tracepoint_(un)register'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 20 Apr 2021 16:42:50 +0000 (12:42 -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: I4eb585902ed4ec4b2207d4c32b744d9a8b454ae6
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-tracepoint/tracepoint.c

index dbaf795d15a81aba40881a476e4408a2cd665792..b02ec3301893d563b0ca17bf1ddf4279a623ddae 100644 (file)
@@ -251,9 +251,9 @@ struct lttng_ust_tracepoint_dlopen {
 
        void *liblttngust_handle;
 
-       int (*tracepoint_register_lib)(struct lttng_ust_tracepoint * const *tracepoints_start,
+       int (*lttng_ust_tracepoint_register_lib)(struct lttng_ust_tracepoint * const *tracepoints_start,
                int tracepoints_count);
-       int (*tracepoint_unregister_lib)(struct lttng_ust_tracepoint * const *tracepoints_start);
+       int (*lttng_ust_tracepoint_unregister_lib)(struct lttng_ust_tracepoint * const *tracepoints_start);
        void (*rcu_read_lock_sym)(void);
        void (*rcu_read_unlock_sym)(void);
        void *(*rcu_dereference_sym)(void *p);
@@ -516,25 +516,25 @@ lttng_ust__tracepoints__ptrs_init(void)
                return;
        if (!lttng_ust_tracepoint_destructors_syms_ptr)
                lttng_ust_tracepoint_destructors_syms_ptr = &lttng_ust_tracepoint_destructors_syms;
-       lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib =
+       lttng_ust_tracepoint_dlopen_ptr->lttng_ust_tracepoint_register_lib =
                URCU_FORCE_CAST(int (*)(struct lttng_ust_tracepoint * const *, int),
                                dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
-                                       "tracepoint_register_lib"));
-       lttng_ust_tracepoint_dlopen_ptr->tracepoint_unregister_lib =
+                                       "lttng_ust_tracepoint_register_lib"));
+       lttng_ust_tracepoint_dlopen_ptr->lttng_ust_tracepoint_unregister_lib =
                URCU_FORCE_CAST(int (*)(struct lttng_ust_tracepoint * const *),
                                dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
-                                       "tracepoint_unregister_lib"));
+                                       "lttng_ust_tracepoint_unregister_lib"));
        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"));
+                                       "lttng_ust_tp_disable_destructors"));
        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"));
+                                       "lttng_ust_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_lttng_ust_tracepoints_ptrs,
+       if (lttng_ust_tracepoint_dlopen_ptr->lttng_ust_tracepoint_register_lib) {
+               lttng_ust_tracepoint_dlopen_ptr->lttng_ust_tracepoint_register_lib(__start_lttng_ust_tracepoints_ptrs,
                                __stop_lttng_ust_tracepoints_ptrs -
                                __start_lttng_ust_tracepoints_ptrs);
        }
@@ -554,8 +554,8 @@ lttng_ust__tracepoints__ptrs_destroy(void)
                lttng_ust_tracepoint_dlopen_ptr = &lttng_ust_tracepoint_dlopen;
        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_lttng_ust_tracepoints_ptrs);
+       if (lttng_ust_tracepoint_dlopen_ptr->lttng_ust_tracepoint_unregister_lib)
+               lttng_ust_tracepoint_dlopen_ptr->lttng_ust_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 2e9a2c0960761cf5348f063e187d515f78f3449d..e166372b4612df63cd7554959dd0416e8ea75b76 100644 (file)
@@ -74,8 +74,8 @@ static CDS_LIST_HEAD(libs);
  * The tracepoint mutex protects the library tracepoints, the hash table, and
  * the library list.
  * All calls to the tracepoint API must be protected by the tracepoint mutex,
- * excepts calls to tracepoint_register_lib and
- * tracepoint_unregister_lib, which take the tracepoint mutex themselves.
+ * excepts calls to lttng_ust_tracepoint_register_lib and
+ * lttng_ust_tracepoint_unregister_lib, which take the tracepoint mutex themselves.
  */
 
 /*
@@ -877,9 +877,9 @@ static void new_tracepoints(struct lttng_ust_tracepoint * const *start,
  * against recent liblttng-ust headers require a recent liblttng-ust
  * runtime for those tracepoints to be taken into account.
  */
-int tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_start,
+int lttng_ust_tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_start,
                             int tracepoints_count);
-int tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_start,
+int lttng_ust_tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_start,
                             int tracepoints_count)
 {
        struct tracepoint_lib *pl, *iter;
@@ -932,8 +932,8 @@ lib_added:
        return 0;
 }
 
-int tracepoint_unregister_lib(struct lttng_ust_tracepoint * const *tracepoints_start);
-int tracepoint_unregister_lib(struct lttng_ust_tracepoint * const *tracepoints_start)
+int lttng_ust_tracepoint_unregister_lib(struct lttng_ust_tracepoint * const *tracepoints_start);
+int lttng_ust_tracepoint_unregister_lib(struct lttng_ust_tracepoint * const *tracepoints_start)
 {
        struct tracepoint_lib *lib;
 
@@ -1023,16 +1023,16 @@ void *tp_rcu_dereference_sym(void *p)
 /*
  * Programs that have threads that survive after they exit, and therefore call
  * library destructors, should disable the tracepoint destructors by calling
- * tp_disable_destructors(). This will leak the tracepoint
+ * lttng_ust_tp_disable_destructors(). This will leak the tracepoint
  * instrumentation library shared object, leaving its teardown to the operating
  * system process teardown.
  *
  * To access and/or modify this value, users need to use a combination of
  * dlopen(3) and dlsym(3) to get an handle on the
- * tp_disable_destructors and tp_get_destructors_state symbols below.
+ * lttng_ust_tp_disable_destructors and lttng_ust_tp_get_destructors_state symbols below.
  */
-void tp_disable_destructors(void);
-void tp_disable_destructors(void)
+void lttng_ust_tp_disable_destructors(void);
+void lttng_ust_tp_disable_destructors(void)
 {
        uatomic_set(&tracepoint_destructors_state, 0);
 }
@@ -1041,8 +1041,8 @@ void tp_disable_destructors(void)
  * Returns 1 if the destructors are enabled and should be executed.
  * Returns 0 if the destructors are disabled.
  */
-int tp_get_destructors_state(void);
-int tp_get_destructors_state(void)
+int lttng_ust_tp_get_destructors_state(void);
+int lttng_ust_tp_get_destructors_state(void)
 {
        return uatomic_read(&tracepoint_destructors_state);
 }
This page took 0.028879 seconds and 4 git commands to generate.