* allocates those on the heap in C++.
*
* Example use:
- * static struct mystruct *var = __LTTNG_COMPOUND_LITERAL(struct mystruct, { 1, 2, 3 });
+ * static struct mystruct *var = LTTNG_UST_COMPOUND_LITERAL(struct mystruct, { 1, 2, 3 });
*/
#if defined (__cplusplus) && defined (LTTNG_ALLOCATE_COMPOUND_LITERAL_ON_HEAP)
-#define __LTTNG_COMPOUND_LITERAL(type, ...) new (type) __VA_ARGS__
+#define LTTNG_UST_COMPOUND_LITERAL(type, ...) new (type) __VA_ARGS__
#else
-#define __LTTNG_COMPOUND_LITERAL(type, ...) (type[]) { __VA_ARGS__ }
+#define LTTNG_UST_COMPOUND_LITERAL(type, ...) (type[]) { __VA_ARGS__ }
#endif
/*
};
#define lttng_ust_type_integer_define(_type, _byte_order, _base) \
- ((struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_integer, { \
+ ((struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_type_integer, { \
.parent = { \
.type = lttng_ust_type_integer, \
}, \
: 0))
#define lttng_ust_type_float_define(_type) \
- ((struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_float, { \
+ ((struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_type_float, { \
.parent = { \
.type = lttng_ust_type_float, \
}, \
/* Enumeration entry (single value) */
#undef ctf_enum_value
#define ctf_enum_value(_string, _value) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
.value = lttng_ust_is_signed_type(__typeof__(_value)) ? \
/* Enumeration entry (range) */
#undef ctf_enum_range
#define ctf_enum_range(_string, _range_start, _range_end) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
.value = lttng_ust_is_signed_type(__typeof__(_range_start)) ? \
/* Enumeration entry (automatic value; follows the rules of CTF) */
#undef ctf_enum_auto
#define ctf_enum_auto(_string) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
.value = -1ULL, \
#undef _ctf_integer_ext
#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
.type = lttng_ust_type_integer_define(_type, _byte_order, _base), \
#undef _ctf_float
#define _ctf_float(_type, _item, _src, _nowrite) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
.type = lttng_ust_type_float_define(_type), \
#define _ctf_array_encoded(_type, _item, _src, _byte_order, \
_length, _encoding, _nowrite, \
_elem_type_base) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
- .type = (const struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_type_array, { \
+ .type = (const struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_type_array, { \
.parent = { \
.type = lttng_ust_type_array, \
}, \
#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, \
_length_type, _src_length, _encoding, _nowrite, \
_elem_type_base) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = "_" #_item "_length", \
.type = lttng_ust_type_integer_define(_length_type, BYTE_ORDER, 10), \
.nowrite = _nowrite, \
.nofilter = 1, \
}), \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
- .type = (const struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_type_sequence, { \
+ .type = (const struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_type_sequence, { \
.parent = { \
.type = lttng_ust_type_sequence, \
}, \
#undef _ctf_string
#define _ctf_string(_item, _src, _nowrite) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
- .type = (const struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_type_string, { \
+ .type = (const struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_type_string, { \
.parent = { \
.type = lttng_ust_type_string, \
}, \
#undef _ctf_enum
#define _ctf_enum(_provider, _name, _type, _item, _src, _nowrite) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = #_item, \
- .type = (const struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_type_enum, { \
+ .type = (const struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_type_enum, { \
.parent = { \
.type = lttng_ust_type_enum, \
}, \
}
#define lttng_ust_static_type_integer(_size, _alignment, _signedness, _byte_order, _base) \
- ((const struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_type_integer, { \
+ ((const struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_type_integer, { \
.parent = { \
.type = lttng_ust_type_integer, \
}, \
}))
#define lttng_ust_static_type_array_text(_length) \
- ((const struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_type_array, { \
+ ((const struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_type_array, { \
.parent = { \
.type = lttng_ust_type_array, \
}, \
}))
#define lttng_ust_static_event_field(_name, _type, _nowrite, _nofilter) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
.struct_size = sizeof(struct lttng_ust_event_field), \
.name = (_name), \
.type = (_type), \
})
#define lttng_ust_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv) \
- __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_ctx_field, { \
+ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_ctx_field, { \
.event_field = (_event_field), \
.get_size = (_get_size), \
.record = (_record), \
.name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING "-mmap",
.ops = {
.struct_size = sizeof(struct lttng_ust_channel_buffer_ops),
- .priv = __LTTNG_COMPOUND_LITERAL(struct lttng_ust_channel_buffer_ops_private, {
+ .priv = LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_channel_buffer_ops_private, {
.pub = <tng_relay_transport.ops,
.channel_create = _channel_create,
.channel_destroy = lttng_channel_destroy,
.ops = {
.struct_size = sizeof(struct lttng_ust_channel_buffer_ops),
- .priv = __LTTNG_COMPOUND_LITERAL(struct lttng_ust_channel_buffer_ops_private, {
+ .priv = LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_channel_buffer_ops_private, {
.pub = <tng_relay_transport.ops,
.channel_create = _channel_create,
.channel_destroy = lttng_channel_destroy,
#include "common/dynamic-type.h"
#define ctf_enum_value(_string, _value) \
- __LTTNG_COMPOUND_LITERAL(struct lttng_ust_enum_entry, { \
+ LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_enum_entry, { \
.struct_size = sizeof(struct lttng_ust_enum_entry), \
.start = { \
.signedness = lttng_ust_is_signed_type(__typeof__(_value)), \
};
const struct lttng_ust_event_field *dt_var_fields[_NR_LTTNG_UST_DYNAMIC_TYPES] = {
- [LTTNG_UST_DYNAMIC_TYPE_NONE] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_NONE] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "none",
- .type = (struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_struct, {
+ .type = (struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_type_struct, {
.parent = {
.type = lttng_ust_type_struct,
},
}),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_S8] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_S8] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "int8",
.type = lttng_ust_type_integer_define(int8_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_S16] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_S16] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "int16",
.type = lttng_ust_type_integer_define(int16_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_S32] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_S32] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "int32",
.type = lttng_ust_type_integer_define(int32_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_S64] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_S64] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "int64",
.type = lttng_ust_type_integer_define(int64_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_U8] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_U8] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "uint8",
.type = lttng_ust_type_integer_define(uint8_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_U16] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_U16] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "uint16",
.type = lttng_ust_type_integer_define(uint16_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_U32] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_U32] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "uint32",
.type = lttng_ust_type_integer_define(uint32_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_U64] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_U64] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "uint64",
.type = lttng_ust_type_integer_define(uint64_t, BYTE_ORDER, 10),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_FLOAT] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_FLOAT] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "float",
.type = lttng_ust_type_float_define(float),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_DOUBLE] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_DOUBLE] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "double",
.type = lttng_ust_type_float_define(double),
.nowrite = 0,
}),
- [LTTNG_UST_DYNAMIC_TYPE_STRING] = __LTTNG_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
+ [LTTNG_UST_DYNAMIC_TYPE_STRING] = LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = "string",
- .type = (struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_string, {
+ .type = (struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_type_string, {
.parent = {
.type = lttng_ust_type_string,
},
static const struct lttng_ust_event_field dt_enum_field = {
.struct_size = sizeof(struct lttng_ust_event_field),
.name = NULL,
- .type = (struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_enum, {
+ .type = (struct lttng_ust_type_common *) LTTNG_UST_COMPOUND_LITERAL(struct lttng_ust_type_enum, {
.parent = {
.type = lttng_ust_type_enum,
},