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>
* An example:
*
* LTTNG_UST_TRACEPOINT_ENUM(someproject_component, enumname,
* An example:
*
* LTTNG_UST_TRACEPOINT_ENUM(someproject_component, enumname,
+ * LTTNG_UST_TP_ENUM_VALUES(
* ctf_enum_value("even", 0)
* ctf_enum_value("uneven", 1)
* ctf_enum_range("twoto4", 2, 4)
* ctf_enum_value("even", 0)
* ctf_enum_value("uneven", 1)
* ctf_enum_range("twoto4", 2, 4)
*
* Where "someproject_component" is the name of the component this enumeration
* belongs to and "enumname" identifies this enumeration. Inside the
*
* 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.
*
* to either a single value with ctf_enum_value or a range of values
* with ctf_enum_range.
*
#include <lttng/ust-compiler.h>
#include <lttng/tracepoint.h>
#include <lttng/ust-endian.h>
#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)"
#include <string.h>
#define __LTTNG_UST_NULL_STRING "(null)"
.options = LTTNG_UST_ENUM_ENTRY_OPTION_IS_AUTO, \
}),
.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(...) \
+#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[] = { \
#undef LTTNG_UST_TRACEPOINT_ENUM
#define LTTNG_UST_TRACEPOINT_ENUM(_provider, _name, _values) \
const struct lttng_ust_enum_entry * const __enum_values__##_provider##_##_name[] = { \
#include <lttng/tracepoint.h>
LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
#include <lttng/tracepoint.h>
LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum,
+ LTTNG_UST_TP_ENUM_VALUES(
ctf_enum_value("even", 0)
ctf_enum_value("uneven", 1)
ctf_enum_range("twoto4", 2, 4)
ctf_enum_value("even", 0)
ctf_enum_value("uneven", 1)
ctf_enum_range("twoto4", 2, 4)
)
LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum2,
)
LTTNG_UST_TRACEPOINT_ENUM(ust_tests_ctf_types, testenum2,
+ LTTNG_UST_TP_ENUM_VALUES(
ctf_enum_value("zero", 0)
ctf_enum_value("five", 5)
ctf_enum_range("ten_to_twenty", 10, 20)
ctf_enum_value("zero", 0)
ctf_enum_value("five", 5)
ctf_enum_range("ten_to_twenty", 10, 20)
#include <stddef.h>
LTTNG_UST_TRACEPOINT_ENUM(ust_tests_hello, my_enum,
#include <stddef.h>
LTTNG_UST_TRACEPOINT_ENUM(ust_tests_hello, my_enum,
+ LTTNG_UST_TP_ENUM_VALUES(
ctf_enum_value("zero", 0)
ctf_enum_value("one", 1)
ctf_enum_auto("two")
ctf_enum_value("zero", 0)
ctf_enum_value("one", 1)
ctf_enum_auto("two")