#define ctf_unused lttng_ust_field_unused
#define ctf_unused_nowrite lttng_ust_field_unused_nowrite
+
+#define ctf_enum lttng_ust_field_enum
+#define ctf_enum_nowrite lttng_ust_field_enum_nowrite
+#define ctf_enum_value lttng_ust_field_enum_value
+#define ctf_enum_range lttng_ust_field_enum_range
+#define ctf_enum_auto lttng_ust_field_enum_auto
#endif /* #if LTTNG_UST_COMPAT_API(0) */
#ifdef __cplusplus
*
* 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("five", 5)
+ * lttng_ust_field_enum_value("even", 0)
+ * lttng_ust_field_enum_value("uneven", 1)
+ * lttng_ust_field_enum_range("twoto4", 2, 4)
+ * lttng_ust_field_enum_value("five", 5)
* )
* )
*
* Where "someproject_component" is the name of the component this enumeration
* belongs to and "enumname" identifies this enumeration. Inside the
* 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 lttng_ust_field_enum_value or a range of values
+ * with lttng_ust_field_enum_range.
*
* Enumeration ranges may overlap, but the behavior is implementation-defined,
* each trace reader will handle overlapping as it wishes.
* That enumeration can then be used in a field inside the TP_FIELD macro using
* the following line:
*
- * ctf_enum(someproject_component, enumname, enumtype, enumfield, enumval)
+ * lttng_ust_field_enum(someproject_component, enumname, enumtype, enumfield, enumval)
*
* Where "someproject_component" and "enumname" match those in the
* LTTNG_UST_TRACEPOINT_ENUM, "enumtype" is a signed or unsigned integer type
* lttng_ust_field_integer_hex(unsigned long, field_d, arg1)
*
* * Enumeration *
- * ctf_enum(someproject_component, enum_name, int, field_e, arg0)
+ * lttng_ust_field_enum(someproject_component, enum_name, int, field_e, arg0)
*
* * Array Sequence, printed as UTF8-encoded array of bytes *
* lttng_ust_field_array_text(char, field_b, string, FIXED_LEN)
#define lttng_ust_field_unused_nowrite(_src) \
lttng_ust__field_unused(_src)
-#undef ctf_enum_nowrite
-#define ctf_enum_nowrite(_provider, _name, _type, _item, _src) \
- _ctf_enum(_provider, _name, _type, _item, _src, 1)
+#undef lttng_ust_field_enum_nowrite
+#define lttng_ust_field_enum_nowrite(_provider, _name, _type, _item, _src) \
+ lttng_ust__field_enum(_provider, _name, _type, _item, _src, 1)
#undef lttng_ust__field_unused
#define lttng_ust__field_unused(_src)
-#undef _ctf_enum
-#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite)
+#undef lttng_ust__field_enum
+#define lttng_ust__field_enum(_provider, _name, _type, _item, _src, _nowrite)
/* "write" */
#undef lttng_ust_field_integer
#undef lttng_ust_field_unused
#define lttng_ust_field_unused(_src)
-#undef ctf_enum
-#define ctf_enum(_provider, _name, _type, _item, _src)
+#undef lttng_ust_field_enum
+#define lttng_ust_field_enum(_provider, _name, _type, _item, _src)
/* "nowrite" */
#undef lttng_ust_field_integer_nowrite
#undef lttng_ust_field_unused_nowrite
#define lttng_ust_field_unused_nowrite(_src)
-#undef ctf_enum_nowrite
-#define ctf_enum_nowrite(_provider, _name, _type, _item, _src)
+#undef lttng_ust_field_enum_nowrite
+#define lttng_ust_field_enum_nowrite(_provider, _name, _type, _item, _src)
#define lttng_ust_field_unused(_src) \
lttng_ust__field_unused(_src)
-#undef ctf_enum
-#define ctf_enum(_provider, _name, _type, _item, _src) \
- _ctf_enum(_provider, _name, _type, _item, _src, 0)
+#undef lttng_ust_field_enum
+#define lttng_ust_field_enum(_provider, _name, _type, _item, _src) \
+ lttng_ust__field_enum(_provider, _name, _type, _item, _src, 0)
#include <lttng/ust-tracepoint-event-reset.h>
/* Enumeration entry (single value) */
-#undef ctf_enum_value
-#define ctf_enum_value(_string, _value) \
+#undef lttng_ust_field_enum_value
+#define lttng_ust_field_enum_value(_string, _value) \
LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
}),
/* Enumeration entry (range) */
-#undef ctf_enum_range
-#define ctf_enum_range(_string, _range_start, _range_end) \
+#undef lttng_ust_field_enum_range
+#define lttng_ust_field_enum_range(_string, _range_start, _range_end) \
LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
}),
/* Enumeration entry (automatic value; follows the rules of CTF) */
-#undef ctf_enum_auto
-#define ctf_enum_auto(_string) \
+#undef lttng_ust_field_enum_auto
+#define lttng_ust_field_enum_auto(_string) \
LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
#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. */ \
+ lttng_ust_field_enum_value("", 0) /* Dummy, 0-len array forbidden by C99. */ \
};
#include LTTNG_UST_TRACEPOINT_INCLUDE
#undef lttng_ust__field_unused
#define lttng_ust__field_unused(_src)
-#undef _ctf_enum
-#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \
+#undef lttng_ust__field_enum
+#define lttng_ust__field_enum(_provider, _name, _type, _item, _src, _nowrite) \
LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
if (0) \
(void) (_src); /* Unused */
-#undef _ctf_enum
-#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \
+#undef lttng_ust__field_enum
+#define lttng_ust__field_enum(_provider, _name, _type, _item, _src, _nowrite) \
lttng_ust__field_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite)
#undef LTTNG_UST_TP_ARGS
if (0) \
(void) (_src);
-#undef _ctf_enum
-#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \
+#undef lttng_ust__field_enum
+#define lttng_ust__field_enum(_provider, _name, _type, _item, _src, _nowrite) \
lttng_ust__field_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite)
#undef LTTNG_UST_TP_ARGS
if (0) \
(void) (_src); /* Unused */
-#undef _ctf_enum
-#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \
+#undef lttng_ust__field_enum
+#define lttng_ust__field_enum(_provider, _name, _type, _item, _src, _nowrite) \
lttng_ust__field_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite)
#undef LTTNG_UST_TP_ARGS
#undef lttng_ust__field_unused
#define lttng_ust__field_unused(_src)
-#undef _ctf_enum
-#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \
+#undef lttng_ust__field_enum
+#define lttng_ust__field_enum(_provider, _name, _type, _item, _src, _nowrite) \
lttng_ust__field_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, _nowrite)
/* Beware: this get len actually consumes the len value */
#include "common/macros.h"
#include "common/dynamic-type.h"
-#define ctf_enum_value(_string, _value) \
+#define lttng_ust_field_enum_value(_string, _value) \
LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
}),
static const struct lttng_ust_enum_entry *dt_enum[_NR_LTTNG_UST_DYNAMIC_TYPES] = {
- [LTTNG_UST_DYNAMIC_TYPE_NONE] = ctf_enum_value("_none", 0)
- [LTTNG_UST_DYNAMIC_TYPE_S8] = ctf_enum_value("_int8", 1)
- [LTTNG_UST_DYNAMIC_TYPE_S16] = ctf_enum_value("_int16", 2)
- [LTTNG_UST_DYNAMIC_TYPE_S32] = ctf_enum_value("_int32", 3)
- [LTTNG_UST_DYNAMIC_TYPE_S64] = ctf_enum_value("_int64", 4)
- [LTTNG_UST_DYNAMIC_TYPE_U8] = ctf_enum_value("_uint8", 5)
- [LTTNG_UST_DYNAMIC_TYPE_U16] = ctf_enum_value("_uint16", 6)
- [LTTNG_UST_DYNAMIC_TYPE_U32] = ctf_enum_value("_uint32", 7)
- [LTTNG_UST_DYNAMIC_TYPE_U64] = ctf_enum_value("_uint64", 8)
- [LTTNG_UST_DYNAMIC_TYPE_FLOAT] = ctf_enum_value("_float", 9)
- [LTTNG_UST_DYNAMIC_TYPE_DOUBLE] = ctf_enum_value("_double", 10)
- [LTTNG_UST_DYNAMIC_TYPE_STRING] = ctf_enum_value("_string", 11)
+ [LTTNG_UST_DYNAMIC_TYPE_NONE] = lttng_ust_field_enum_value("_none", 0)
+ [LTTNG_UST_DYNAMIC_TYPE_S8] = lttng_ust_field_enum_value("_int8", 1)
+ [LTTNG_UST_DYNAMIC_TYPE_S16] = lttng_ust_field_enum_value("_int16", 2)
+ [LTTNG_UST_DYNAMIC_TYPE_S32] = lttng_ust_field_enum_value("_int32", 3)
+ [LTTNG_UST_DYNAMIC_TYPE_S64] = lttng_ust_field_enum_value("_int64", 4)
+ [LTTNG_UST_DYNAMIC_TYPE_U8] = lttng_ust_field_enum_value("_uint8", 5)
+ [LTTNG_UST_DYNAMIC_TYPE_U16] = lttng_ust_field_enum_value("_uint16", 6)
+ [LTTNG_UST_DYNAMIC_TYPE_U32] = lttng_ust_field_enum_value("_uint32", 7)
+ [LTTNG_UST_DYNAMIC_TYPE_U64] = lttng_ust_field_enum_value("_uint64", 8)
+ [LTTNG_UST_DYNAMIC_TYPE_FLOAT] = lttng_ust_field_enum_value("_float", 9)
+ [LTTNG_UST_DYNAMIC_TYPE_DOUBLE] = lttng_ust_field_enum_value("_double", 10)
+ [LTTNG_UST_DYNAMIC_TYPE_STRING] = lttng_ust_field_enum_value("_string", 11)
};
static struct lttng_ust_enum_desc dt_enum_desc = {
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("five\"extra\\test", 5)
+ lttng_ust_field_enum_value("even", 0)
+ lttng_ust_field_enum_value("uneven", 1)
+ lttng_ust_field_enum_range("twoto4", 2, 4)
+ lttng_ust_field_enum_value("five\"extra\\test", 5)
)
)
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)
+ lttng_ust_field_enum_value("zero", 0)
+ lttng_ust_field_enum_value("five", 5)
+ lttng_ust_field_enum_range("ten_to_twenty", 10, 20)
)
)
LTTNG_UST_TP_ARGS(int, anint, int, enumval, int, enumval2),
LTTNG_UST_TP_FIELDS(
lttng_ust_field_integer(int, intfield, anint)
- ctf_enum(ust_tests_ctf_types, testenum, int, enumfield, enumval)
- ctf_enum(ust_tests_ctf_types, testenum, long long,
+ lttng_ust_field_enum(ust_tests_ctf_types, testenum, int, enumfield, enumval)
+ lttng_ust_field_enum(ust_tests_ctf_types, testenum, long long,
enumfield_bis, enumval)
- ctf_enum(ust_tests_ctf_types, testenum2, unsigned int,
+ lttng_ust_field_enum(ust_tests_ctf_types, testenum2, unsigned int,
enumfield_third, enumval2)
)
)
LTTNG_UST_TP_ARGS(int, anint, int, enumval),
LTTNG_UST_TP_FIELDS(
lttng_ust_field_integer(int, intfield, anint)
- ctf_enum(ust_tests_ctf_types, testenum, unsigned char,
+ lttng_ust_field_enum(ust_tests_ctf_types, testenum, unsigned char,
enumfield, enumval)
)
)
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("three", 3)
- ctf_enum_range("ten to twenty", 10, 20)
- ctf_enum_auto("21!")
+ lttng_ust_field_enum_value("zero", 0)
+ lttng_ust_field_enum_value("one", 1)
+ lttng_ust_field_enum_auto("two")
+ lttng_ust_field_enum_value("three", 3)
+ lttng_ust_field_enum_range("ten to twenty", 10, 20)
+ lttng_ust_field_enum_auto("21!")
)
)
lttng_ust_field_string(stringfield, text)
lttng_ust_field_float(float, floatfield, floatarg)
lttng_ust_field_float(double, doublefield, doublearg)
- ctf_enum(ust_tests_hello, my_enum, int, enumfield, enumarg)
+ lttng_ust_field_enum(ust_tests_hello, my_enum, int, enumfield, enumarg)
)
)