/* The following declarations must be outside re-inclusion protection. */
-#ifndef TRACEPOINT_ENUM
+#ifndef LTTNG_UST_TRACEPOINT_ENUM
/*
* Tracepoint Enumerations
*
* 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)
* 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
#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(...)
#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. */ \
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, \
#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)
)
)
-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)
#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)