+#define lttng_kernel_static_type_integer(_size, _alignment, _signedness, _byte_order, _base) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_integer, { \
+ .parent = { \
+ .type = lttng_kernel_type_integer, \
+ }, \
+ .size = (_size), \
+ .alignment = (_alignment), \
+ .signedness = (_signedness), \
+ .reverse_byte_order = (_byte_order) != __BYTE_ORDER, \
+ .base = (_base), \
+ }))
+
+#define lttng_kernel_static_type_integer_from_type(_type, _byte_order, _base) \
+ lttng_kernel_static_type_integer(sizeof(_type) * CHAR_BIT, \
+ lttng_alignof(_type) * CHAR_BIT, \
+ lttng_is_signed_type(_type), \
+ _byte_order, \
+ _base)
+
+#define lttng_kernel_static_type_enum(_desc, _container_type) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_enum, { \
+ .parent = { \
+ .type = lttng_kernel_type_enum, \
+ }, \
+ .desc = (_desc), \
+ .container_type = (_container_type), \
+ }))
+
+#define lttng_kernel_static_type_array(_length, _elem_type, _alignment, _encoding) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_array, { \
+ .parent = { \
+ .type = lttng_kernel_type_array, \
+ }, \
+ .length = (_length), \
+ .alignment = (_alignment), \
+ .encoding = lttng_kernel_string_encoding_##_encoding, \
+ .elem_type = (_elem_type), \
+ }))
+
+#define lttng_kernel_static_type_array_text(_length) \
+ lttng_kernel_static_type_array(_length, \
+ lttng_kernel_static_type_integer(sizeof(char) * CHAR_BIT, \
+ lttng_alignof(char) * CHAR_BIT, lttng_is_signed_type(char), \
+ __BYTE_ORDER, 10), \
+ 0, UTF8)
+
+#define lttng_kernel_static_type_sequence(_length_name, _elem_type, _alignment, _encoding) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_sequence, { \
+ .parent = { \
+ .type = lttng_kernel_type_sequence, \
+ }, \
+ .length_name = (_length_name), \
+ .alignment = (_alignment), \
+ .encoding = lttng_kernel_string_encoding_##_encoding, \
+ .elem_type = (_elem_type), \
+ }))
+
+#define lttng_kernel_static_type_string(_encoding) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_string, { \
+ .parent = { \
+ .type = lttng_kernel_type_string, \
+ }, \
+ .encoding = lttng_kernel_string_encoding_##_encoding, \
+ }))
+
+#define lttng_kernel_static_type_struct(_nr_fields, _fields, _alignment) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_struct, { \
+ .parent = { \
+ .type = lttng_kernel_type_struct, \
+ }, \
+ .nr_fields = (_nr_fields), \
+ .fields = _fields, \
+ .alignment = (_alignment), \
+ }))
+
+#define lttng_kernel_static_type_variant(_nr_choices, _choices, _tag_name, _alignment) \
+ ((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_variant, { \
+ .parent = { \
+ .type = lttng_kernel_type_variant, \
+ }, \
+ .tag_name = (_tag_name), \
+ .choices = _choices, \
+ .nr_choices = (_nr_choices), \
+ .alignment = (_alignment), \
+ }))
+
+#define lttng_kernel_static_event_field(_name, _type, _nowrite, _user, _nofilter) \
+ __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_event_field, { \
+ .name = (_name), \
+ .type = (_type), \
+ .nowrite = (_nowrite), \
+ .user = (_user), \
+ .nofilter = (_nofilter), \
+ })
+
+#define lttng_kernel_static_event_field_array(_fields...) \
+ __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_event_field *, \
+ _fields \
+ )
+
+#define lttng_kernel_static_ctx_field(_event_field, _get_size, _get_size_arg, _record, _get_value, _destroy, _priv) \
+ __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, { \
+ .event_field = (_event_field), \
+ .get_size = (_get_size), \
+ .get_size_arg = (_get_size_arg), \
+ .record = (_record), \
+ .get_value = (_get_value), \
+ .destroy = (_destroy), \
+ .priv = (_priv), \
+ })
+
+#define lttng_kernel_static_enum_entry_value(_string, _value) \
+ __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_enum_entry, { \
+ .start = { \
+ .signedness = lttng_is_signed_type(__typeof__(_value)), \
+ .value = lttng_is_signed_type(__typeof__(_value)) ? \
+ (long long) (_value) : (_value), \
+ }, \
+ .end = { \
+ .signedness = lttng_is_signed_type(__typeof__(_value)), \
+ .value = lttng_is_signed_type(__typeof__(_value)) ? \
+ (long long) (_value) : (_value), \
+ }, \
+ .string = (_string), \
+ }),
+
+#define lttng_kernel_static_enum_entry_range(_string, _range_start, _range_end) \
+ __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_enum_entry, { \
+ .start = { \
+ .signedness = lttng_is_signed_type(__typeof__(_range_start)), \
+ .value = lttng_is_signed_type(__typeof__(_range_start)) ? \
+ (long long) (_range_start) : (_range_start), \
+ }, \
+ .end = { \
+ .signedness = lttng_is_signed_type(__typeof__(_range_end)), \
+ .value = lttng_is_signed_type(__typeof__(_range_end)) ? \
+ (long long) (_range_end) : (_range_end), \
+ }, \
+ .string = (_string), \
+ }),
+
+#define lttng_kernel_static_enum_entry_auto(_string) \
+ __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_enum_entry, { \
+ .start = { \
+ .signedness = -1, \
+ .value = -1, \
+ }, \
+ .end = { \
+ .signedness = -1, \
+ .value = -1, \
+ }, \
+ .string = (_string), \
+ .options = { \
+ .is_auto = 1, \
+ } \
+ }),
+