Tracepoint API namespacing 'TP_ENUM_VALUES'
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 21 Apr 2021 19:11:16 +0000 (15:11 -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: I4f8755f8eddfb2c76dce18fe6193489dbe36aa7f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint.h
include/lttng/ust-tracepoint-event.h
tests/compile/ctf-types/ust_tests_ctf_types.h
tests/compile/hello.cxx/ust_tests_hello.h

index b637b8534eb83b67ef8ded57c16b0adf99e3938a..268271c48c933fe8be2f1df6f5c4a8d5b8d81c91 100644 (file)
@@ -609,7 +609,7 @@ lttng_ust__tracepoints__ptrs_destroy(void)
  * An example:
  *
  * LTTNG_UST_TRACEPOINT_ENUM(someproject_component, enumname,
- *     TP_ENUM_VALUES(
+ *     LTTNG_UST_TP_ENUM_VALUES(
  *             ctf_enum_value("even", 0)
  *             ctf_enum_value("uneven", 1)
  *             ctf_enum_range("twoto4", 2, 4)
@@ -619,7 +619,7 @@ lttng_ust__tracepoints__ptrs_destroy(void)
  *
  * Where "someproject_component" is the name of the component this enumeration
  * belongs to and "enumname" identifies this enumeration. Inside the
- * TP_ENUM_VALUES macro is the actual mapping. Each string value can map
+ * LTTNG_UST_TP_ENUM_VALUES macro is the actual mapping. Each string value can map
  * to either a single value with ctf_enum_value or a range of values
  * with ctf_enum_range.
  *
index 6aa905baf2cb5935ac2137f1ca1349774ea3eaf1..8ba095bd223afb267a9b2d65044369a383dc91bb 100644 (file)
@@ -15,6 +15,7 @@
 #include <lttng/ust-compiler.h>
 #include <lttng/tracepoint.h>
 #include <lttng/ust-endian.h>
+#include <lttng/ust-api-compat.h>
 #include <string.h>
 
 #define __LTTNG_UST_NULL_STRING        "(null)"
@@ -197,10 +198,15 @@ void __event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PR
                .options = LTTNG_UST_ENUM_ENTRY_OPTION_IS_AUTO,         \
        }),
 
-#undef TP_ENUM_VALUES
-#define TP_ENUM_VALUES(...)                                            \
+#undef LTTNG_UST_TP_ENUM_VALUES
+#define LTTNG_UST_TP_ENUM_VALUES(...)                                          \
        __VA_ARGS__
 
+#if LTTNG_UST_COMPAT_API(0)
+# undef TP_ENUM_VALUES
+# define TP_ENUM_VALUES LTTNG_UST_TP_ENUM_VALUES
+#endif /* #if LTTNG_UST_COMPAT_API(0) */
+
 #undef LTTNG_UST_TRACEPOINT_ENUM
 #define LTTNG_UST_TRACEPOINT_ENUM(_provider, _name, _values)                   \
        const struct lttng_ust_enum_entry * const __enum_values__##_provider##_##_name[] = { \
index 630d0d4ecc302346e289e637d7e1c701125f62f8..3721045c2a542ade3aa9565e9825ea5d96d73fb7 100644 (file)
@@ -13,7 +13,7 @@
 #include <lttng/tracepoint.h>
 
 LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
-       TP_ENUM_VALUES(
+       LTTNG_UST_TP_ENUM_VALUES(
                ctf_enum_value("even", 0)
                ctf_enum_value("uneven", 1)
                ctf_enum_range("twoto4", 2, 4)
@@ -22,7 +22,7 @@ LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
 )
 
 LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum2,
-       TP_ENUM_VALUES(
+       LTTNG_UST_TP_ENUM_VALUES(
                ctf_enum_value("zero", 0)
                ctf_enum_value("five", 5)
                ctf_enum_range("ten_to_twenty", 10, 20)
index dfe20f5d007ad1881253fd55b044ed593e1e9347..241fb044b3ad2721e65aea06ee48de7808d189fb 100644 (file)
@@ -14,7 +14,7 @@
 #include <stddef.h>
 
 LTTNG_UST_TRACEPOINT_ENUM(ust_tests_hello, my_enum,
-       TP_ENUM_VALUES(
+       LTTNG_UST_TP_ENUM_VALUES(
                ctf_enum_value("zero", 0)
                ctf_enum_value("one", 1)
                ctf_enum_auto("two")
This page took 0.028809 seconds and 4 git commands to generate.