+/*
+ * Stage 0.2 of tracepoint event generation.
+ *
+ * Create dummy trace prototypes for each event class, and for each used
+ * template. This will allow checking whether the prototypes from the
+ * class and the instance using the class actually match.
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+#undef TP_ARGS
+#define TP_ARGS(...) __VA_ARGS__
+
+#undef TRACEPOINT_EVENT_INSTANCE
+#define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
+void __event_template_proto___##_provider##___##_template(_TP_ARGS_DATA_PROTO(_args));
+
+#undef TRACEPOINT_EVENT_CLASS
+#define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
+void __event_template_proto___##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
+
+#include TRACEPOINT_INCLUDE
+
+/*
+ * Stage 0.9 of tracepoint event generation
+ *
+ * Unfolding the enums
+ */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+/* Enumeration entry (single value) */
+#undef ctf_enum_value
+#define ctf_enum_value(_string, _value) \
+ { \
+ .start = { \
+ .value = lttng_is_signed_type(__typeof__(_value)) ? \
+ (long long) (_value) : (_value), \
+ .signedness = lttng_is_signed_type(__typeof__(_value)), \
+ }, \
+ .end = { \
+ .value = lttng_is_signed_type(__typeof__(_value)) ? \
+ (long long) (_value) : (_value), \
+ .signedness = lttng_is_signed_type(__typeof__(_value)), \
+ }, \
+ .string = (_string), \
+ },
+
+/* Enumeration entry (range) */
+#undef ctf_enum_range
+#define ctf_enum_range(_string, _range_start, _range_end) \
+ { \
+ .start = { \
+ .value = lttng_is_signed_type(__typeof__(_range_start)) ? \
+ (long long) (_range_start) : (_range_start), \
+ .signedness = lttng_is_signed_type(__typeof__(_range_start)), \
+ }, \
+ .end = { \
+ .value = lttng_is_signed_type(__typeof__(_range_end)) ? \
+ (long long) (_range_end) : (_range_end), \
+ .signedness = lttng_is_signed_type(__typeof__(_range_end)), \
+ }, \
+ .string = (_string), \
+ },
+
+/* Enumeration entry (automatic value; follows the rules of CTF) */
+#undef ctf_enum_auto
+#define ctf_enum_auto(_string) \
+ { \
+ .start = { \
+ .value = -1ULL, \
+ .signedness = 0, \
+ }, \
+ .end = { \
+ .value = -1ULL, \
+ .signedness = 0, \
+ }, \
+ .string = (_string), \
+ .u = { \
+ .extra = { \
+ .options = LTTNG_ENUM_ENTRY_OPTION_IS_AUTO, \
+ }, \
+ }, \
+ },
+
+#undef TP_ENUM_VALUES
+#define TP_ENUM_VALUES(...) \
+ __VA_ARGS__
+
+#undef TRACEPOINT_ENUM
+#define TRACEPOINT_ENUM(_provider, _name, _values) \
+ const struct lttng_enum_entry __enum_values__##_provider##_##_name[] = { \
+ _values \
+ ctf_enum_value("", 0) /* Dummy, 0-len array forbidden by C99. */ \
+ };
+
+#include TRACEPOINT_INCLUDE
+