Tracepoint API namespacing 'TRACEPOINT_ENUM'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 20 Apr 2021 17:03:34 +0000 (13:03 -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: I40ce57d796361cc9393d07792e5c5225a38db00f
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-reset.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 043426fce78e580806e5446e12fa4945e7b652a0..71250ce04361be49ffd335655d2a2a278bef3e3d 100644 (file)
@@ -597,7 +597,7 @@ lttng_ust__tracepoints__ptrs_destroy(void)
 
 /* The following declarations must be outside re-inclusion protection. */
 
-#ifndef TRACEPOINT_ENUM
+#ifndef LTTNG_UST_TRACEPOINT_ENUM
 
 /*
  * Tracepoint Enumerations
@@ -608,7 +608,7 @@ lttng_ust__tracepoints__ptrs_destroy(void)
  *
  * An example:
  *
- * TRACEPOINT_ENUM(someproject_component, enumname,
+ * LTTNG_UST_TRACEPOINT_ENUM(someproject_component, enumname,
  *     TP_ENUM_VALUES(
  *             ctf_enum_value("even", 0)
  *             ctf_enum_value("uneven", 1)
@@ -632,14 +632,18 @@ lttng_ust__tracepoints__ptrs_destroy(void)
  * ctf_enum(someproject_component, enumname, enumtype, enumfield, enumval)
  *
  * Where "someproject_component" and "enumname" match those in the
- * TRACEPOINT_ENUM, "enumtype" is a signed or unsigned integer type
+ * LTTNG_UST_TRACEPOINT_ENUM, "enumtype" is a signed or unsigned integer type
  * backing the enumeration, "enumfield" is the name of the field and
  * "enumval" is the value.
  */
 
-#define TRACEPOINT_ENUM(provider, name, values)
+#define LTTNG_UST_TRACEPOINT_ENUM(provider, name, values)
 
-#endif /* #ifndef TRACEPOINT_ENUM */
+#if LTTNG_UST_COMPAT_API(0)
+#define TRACEPOINT_ENUM                LTTNG_UST_TRACEPOINT_ENUM
+#endif /* #if LTTNG_UST_COMPAT_API(0) */
+
+#endif /* #ifndef LTTNG_UST_TRACEPOINT_ENUM */
 
 #ifndef LTTNG_UST_TRACEPOINT_EVENT
 
index 6ba39820e9526f6d8f878bdaf39d0f1d3da4a99a..a4d13b1047959cdb1668da2b7a2a471812131774 100644 (file)
@@ -12,8 +12,8 @@
 #undef LTTNG_UST__TRACEPOINT_EVENT_INSTANCE
 #define LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args)
 
-#undef TRACEPOINT_ENUM
-#define TRACEPOINT_ENUM(_provider, _name, _values)
+#undef LTTNG_UST_TRACEPOINT_ENUM
+#define LTTNG_UST_TRACEPOINT_ENUM(_provider, _name, _values)
 
 #undef LTTNG_UST_TP_ARGS
 #define LTTNG_UST_TP_ARGS(...)
index 354545e00667d15791ac51416f63297ad47dc784..fa4739ce3ec5ae05fce112105973a13b12579123 100644 (file)
@@ -201,8 +201,8 @@ void __event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PR
 #define TP_ENUM_VALUES(...)                                            \
        __VA_ARGS__
 
-#undef TRACEPOINT_ENUM
-#define TRACEPOINT_ENUM(_provider, _name, _values)                     \
+#undef LTTNG_UST_TRACEPOINT_ENUM
+#define LTTNG_UST_TRACEPOINT_ENUM(_provider, _name, _values)                   \
        const struct lttng_ust_enum_entry * const __enum_values__##_provider##_##_name[] = { \
                _values                                                 \
                ctf_enum_value("", 0)   /* Dummy, 0-len array forbidden by C99. */ \
@@ -367,8 +367,8 @@ void __event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PR
                ctf_integer(int, dummy, 0)      /* Dummy, C99 forbids 0-len array. */        \
        };
 
-#undef TRACEPOINT_ENUM
-#define TRACEPOINT_ENUM(_provider, _name, _values)                                     \
+#undef LTTNG_UST_TRACEPOINT_ENUM
+#define LTTNG_UST_TRACEPOINT_ENUM(_provider, _name, _values)                                   \
        static const struct lttng_ust_enum_desc __enum_##_provider##_##_name = {        \
                .struct_size = sizeof(struct lttng_ust_enum_desc),                      \
                .name = #_provider "_" #_name,                                          \
index 674950eb3d7ab154f02c48c017f3ae5dfc464271..0277e68b0de1b13de5480f924501409f98eeb0a5 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <lttng/tracepoint.h>
 
-TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
+LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
        TP_ENUM_VALUES(
                ctf_enum_value("even", 0)
                ctf_enum_value("uneven", 1)
@@ -21,7 +21,7 @@ TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
        )
 )
 
-TRACEPOINT_ENUM(ust_tests_ctf_types, testenum2,
+LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum2,
        TP_ENUM_VALUES(
                ctf_enum_value("zero", 0)
                ctf_enum_value("five", 5)
index c6fde916a854bf3ed80ee0b2de3440f5c2dcb1af..25176dc68776ca66c9c0de614d40e51858c2f4c2 100644 (file)
@@ -13,7 +13,7 @@
 #include <lttng/tracepoint.h>
 #include <stddef.h>
 
-TRACEPOINT_ENUM(ust_tests_hello, my_enum,
+LTTNG_UST_TRACEPOINT_ENUM(ust_tests_hello, my_enum,
        TP_ENUM_VALUES(
                ctf_enum_value("zero", 0)
                ctf_enum_value("one", 1)
This page took 0.028585 seconds and 4 git commands to generate.