Tracepoint API namespacing tracepoint-rcu
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 21 Apr 2021 18:33:28 +0000 (14:33 -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: Ia07f15d7dd01c6d1e86033c83d329888bb52553f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint-rcu.h
include/lttng/tracepoint.h
include/lttng/ust-tracepoint-event.h
src/lib/lttng-ust-tracepoint/tracepoint.c

index 552af64ae8d1e438524e62791adb2ed03f574581..2898845834beaeaebeebfcf284f49f6f50ac8b1d 100644 (file)
@@ -9,27 +9,35 @@
 
 #include <urcu/compiler.h>
 #include <lttng/urcu/pointer.h>
+#include <lttng/ust-api-compat.h>
 
 #ifdef _LGPL_SOURCE
 
 #include <lttng/urcu/urcu-ust.h>
 
-#define tp_rcu_read_lock       lttng_ust_urcu_read_lock
-#define tp_rcu_read_unlock     lttng_ust_urcu_read_unlock
-#define tp_rcu_dereference     lttng_ust_rcu_dereference
-#define TP_RCU_LINK_TEST()     1
+#define lttng_ust_tp_rcu_read_lock     lttng_ust_urcu_read_lock
+#define lttng_ust_tp_rcu_read_unlock   lttng_ust_urcu_read_unlock
+#define lttng_ust_tp_rcu_dereference   lttng_ust_rcu_dereference
+#define LTTNG_UST_TP_RCU_LINK_TEST()   1
 
 #else  /* _LGPL_SOURCE */
 
-#define tp_rcu_read_lock       lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym
-#define tp_rcu_read_unlock     lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym
+#define lttng_ust_tp_rcu_read_lock     lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym
+#define lttng_ust_tp_rcu_read_unlock   lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym
 
-#define tp_rcu_dereference(p)                                             \
+#define lttng_ust_tp_rcu_dereference(p)                                                   \
                URCU_FORCE_CAST(__typeof__(p),                             \
                        lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym(URCU_FORCE_CAST(void *, p)))
 
-#define TP_RCU_LINK_TEST()     (lttng_ust_tracepoint_dlopen_ptr && tp_rcu_read_lock)
+#define LTTNG_UST_TP_RCU_LINK_TEST()   (lttng_ust_tracepoint_dlopen_ptr && tp_rcu_read_lock)
 
 #endif /* _LGPL_SOURCE */
 
+#if LTTNG_UST_COMPAT_API(0)
+#define tp_rcu_read_lock       lttng_ust_tp_rcu_read_lock
+#define tp_rcu_read_unlock     lttng_ust_tp_rcu_read_unlock
+#define tp_rcu_dereference     lttng_ust_tp_rcu_dereference
+#define TP_RCU_LINK_TEST       LTTNG_UST_TP_RCU_LINK_TEST
+#endif
+
 #endif /* _LTTNG_TRACEPOINT_RCU_H */
index 268271c48c933fe8be2f1df6f5c4a8d5b8d81c91..420657673e9c6e74800bf2cbb24e91facebefd56 100644 (file)
@@ -191,10 +191,10 @@ void lttng_ust_tracepoint_cb_##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(__
 {                                                                                      \
        struct lttng_ust_tracepoint_probe *__tp_probe;                                  \
                                                                                        \
-       if (caa_unlikely(!TP_RCU_LINK_TEST()))                                          \
+       if (caa_unlikely(!LTTNG_UST_TP_RCU_LINK_TEST()))                                                \
                return;                                                                 \
-       tp_rcu_read_lock();                                                             \
-       __tp_probe = tp_rcu_dereference(lttng_ust_tracepoint_##_provider##___##_name.probes);   \
+       lttng_ust_tp_rcu_read_lock();                                                           \
+       __tp_probe = lttng_ust_tp_rcu_dereference(lttng_ust_tracepoint_##_provider##___##_name.probes); \
        if (caa_unlikely(!__tp_probe))                                                  \
                goto end;                                                               \
        do {                                                                            \
@@ -205,7 +205,7 @@ void lttng_ust_tracepoint_cb_##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(__
                                (LTTNG_UST__TP_ARGS_DATA_VAR(__VA_ARGS__));                     \
        } while ((++__tp_probe)->func);                                                 \
 end:                                                                                   \
-       tp_rcu_read_unlock();                                                           \
+       lttng_ust_tp_rcu_read_unlock();                                                         \
 }                                                                                      \
 static inline                                                                          \
 void lttng_ust_tracepoint_register_##_provider##___##_name(char *provider_name, char *event_name, \
@@ -350,17 +350,17 @@ lttng_ust_tracepoint__init_urcu_sym(void)
                lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym =
                        URCU_FORCE_CAST(void (*)(void),
                                dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
-                                       "tp_rcu_read_lock"));
+                                       "lttng_ust_tp_rcu_read_lock"));
        if (!lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym)
                lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym =
                        URCU_FORCE_CAST(void (*)(void),
                                dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
-                                       "tp_rcu_read_unlock"));
+                                       "lttng_ust_tp_rcu_read_unlock"));
        if (!lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym)
                lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym =
                        URCU_FORCE_CAST(void *(*)(void *p),
                                dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
-                                       "tp_rcu_dereference_sym"));
+                                       "lttng_ust_tp_rcu_dereference_sym"));
 }
 #else
 static inline void
index fb5d065456d47dea5615f9fe3cbacba2819105bc..3761915a6e7bd2d1ce159337af486829bf4f095e 100644 (file)
@@ -22,9 +22,9 @@
 
 #undef tp_list_for_each_entry_rcu
 #define tp_list_for_each_entry_rcu(pos, head, member)  \
-       for (pos = cds_list_entry(tp_rcu_dereference((head)->next), __typeof__(*pos), member);  \
+       for (pos = cds_list_entry(lttng_ust_tp_rcu_dereference((head)->next), __typeof__(*pos), member);        \
             &pos->member != (head);                                    \
-            pos = cds_list_entry(tp_rcu_dereference(pos->member.next), __typeof__(*pos), member))
+            pos = cds_list_entry(lttng_ust_tp_rcu_dereference(pos->member.next), __typeof__(*pos), member))
 
 /*
  * LTTNG_UST_TRACEPOINT_EVENT_CLASS declares a class of tracepoints receiving the
@@ -877,7 +877,7 @@ void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PRO
        }                                                                     \
        if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled)))                 \
                return;                                                       \
-       if (caa_unlikely(!TP_RCU_LINK_TEST()))                                \
+       if (caa_unlikely(!LTTNG_UST_TP_RCU_LINK_TEST()))                                      \
                return;                                                       \
        if (caa_unlikely(CMM_ACCESS_ONCE(__event->eval_filter))) { \
                lttng_ust__event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
index e166372b4612df63cd7554959dd0416e8ea75b76..35ad019f1c4720437f29e42fad3045a58d97e8f5 100644 (file)
@@ -998,24 +998,24 @@ void lttng_ust_tp_exit(void)
 /*
  * Create the wrapper symbols.
  */
-#undef tp_rcu_read_lock
-#undef tp_rcu_read_unlock
-#undef tp_rcu_dereference
+#undef lttng_ust_tp_rcu_read_lock
+#undef lttng_ust_tp_rcu_read_unlock
+#undef lttng_ust_tp_rcu_dereference
 
-void tp_rcu_read_lock(void);
-void tp_rcu_read_lock(void)
+void lttng_ust_tp_rcu_read_lock(void);
+void lttng_ust_tp_rcu_read_lock(void)
 {
        lttng_ust_urcu_read_lock();
 }
 
-void tp_rcu_read_unlock(void);
-void tp_rcu_read_unlock(void)
+void lttng_ust_tp_rcu_read_unlock(void);
+void lttng_ust_tp_rcu_read_unlock(void)
 {
        lttng_ust_urcu_read_unlock();
 }
 
-void *tp_rcu_dereference_sym(void *p);
-void *tp_rcu_dereference_sym(void *p)
+void *lttng_ust_tp_rcu_dereference_sym(void *p);
+void *lttng_ust_tp_rcu_dereference_sym(void *p)
 {
        return lttng_ust_rcu_dereference(p);
 }
This page took 0.02926 seconds and 4 git commands to generate.