Introduce API compatibility macros
[lttng-ust.git] / include / lttng / tracepoint.h
index 98c3c8dd89bfd2b6419bca7f6e15b255967209aa..96e0160552658b3a7c26e4eb6634a77c17c588a3 100644 (file)
@@ -19,6 +19,7 @@
 #include <lttng/ust-config.h>  /* for sdt */
 #include <lttng/ust-compiler.h>
 #include <lttng/ust-tracer.h>
+#include <lttng/ust-api-compat.h>
 
 #define LTTNG_UST_TRACEPOINT_NAME_LEN_MAX      256
 
 extern "C" {
 #endif
 
-#define tracepoint_enabled(provider, name) \
+#define lttng_ust_tracepoint_enabled(provider, name)                           \
        caa_unlikely(CMM_LOAD_SHARED(__tracepoint_##provider##___##name.state))
 
-#define do_tracepoint(provider, name, ...) \
+#define lttng_ust_do_tracepoint(provider, name, ...)                           \
        __tracepoint_cb_##provider##___##name(__VA_ARGS__)
 
-#define tracepoint(provider, name, ...)                                            \
-       do {                                                                \
-               LTTNG_UST_STAP_PROBEV(provider, name, ## __VA_ARGS__);      \
-               if (tracepoint_enabled(provider, name))                     \
-                       do_tracepoint(provider, name, __VA_ARGS__);         \
+#define lttng_ust_tracepoint(provider, name, ...)                              \
+       do {                                                                    \
+               LTTNG_UST_STAP_PROBEV(provider, name, ## __VA_ARGS__);          \
+               if (lttng_ust_tracepoint_enabled(provider, name))               \
+                       lttng_ust_do_tracepoint(provider, name, __VA_ARGS__);   \
        } while (0)
 
 #define TP_ARGS(...)       __VA_ARGS__
@@ -567,6 +568,12 @@ __tracepoints__ptrs_destroy(void)
 
 #endif /* #else TRACEPOINT_DEFINE */
 
+#if LTTNG_UST_COMPAT_API(0)
+#define tracepoint                     lttng_ust_tracepoint
+#define do_tracepoint                  lttng_ust_do_tracepoint
+#define tracepoint_enabled             lttng_ust_tracepoint_enabled
+#endif /* #if LTTNG_UST_COMPAT_API(0) */
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023505 seconds and 4 git commands to generate.