From: Mathieu Desnoyers Date: Thu, 8 Oct 2015 20:02:06 +0000 (-0400) Subject: Implement array and sequence bitfields X-Git-Tag: v2.8.0-rc1~67 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=43803cf2bdfe205fe0e426f7e93507d722ba1feb;p=lttng-modules.git Implement array and sequence bitfields Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/lttng-test.h b/instrumentation/events/lttng-module/lttng-test.h index 5b6f3371..78e4c57d 100644 --- a/instrumentation/events/lttng-module/lttng-test.h +++ b/instrumentation/events/lttng-module/lttng-test.h @@ -25,6 +25,8 @@ LTTNG_TRACEPOINT_EVENT(lttng_test_filter_event, ctf_sequence_text(char, seqfield2, text, size_t, textlen) ctf_string(stringfield, text) ctf_string(stringfield2, etext) + ctf_sequence_bitfield(long, bitfield_seq, values, uint8_t, 3) + ctf_array_bitfield(long, bitfield_array, values, 3) ) ) diff --git a/lttng-events.c b/lttng-events.c index c1dc1acb..1f34fbbc 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -1695,6 +1695,14 @@ int _lttng_field_statedump(struct lttng_session *session, const struct lttng_basic_type *elem_type; elem_type = &field->type.u.array.elem_type; + if (field->type.u.array.elem_alignment) { + ret = lttng_metadata_printf(session, + " struct { } align(%u) _%s_padding;\n", + field->type.u.array.elem_alignment * CHAR_BIT, + field->name); + if (ret) + return ret; + } ret = lttng_metadata_printf(session, " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[%u];\n", elem_type->u.basic.integer.size, @@ -1741,6 +1749,14 @@ int _lttng_field_statedump(struct lttng_session *session, if (ret) return ret; + if (field->type.u.sequence.elem_alignment) { + ret = lttng_metadata_printf(session, + " struct { } align(%u) _%s_padding;\n", + field->type.u.sequence.elem_alignment * CHAR_BIT, + field->name); + if (ret) + return ret; + } ret = lttng_metadata_printf(session, " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[ __%s_length ];\n", elem_type->u.basic.integer.size, diff --git a/lttng-events.h b/lttng-events.h index 921bc1fc..234d4bcb 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -71,15 +71,16 @@ struct lttng_enum_entry { const char *string; }; -#define __type_integer(_type, _byte_order, _base, _encoding) \ +#define __type_integer(_type, _size, _alignment, _signedness, \ + _byte_order, _base, _encoding) \ { \ .atype = atype_integer, \ .u.basic.integer = \ { \ - .size = sizeof(_type) * CHAR_BIT, \ - .alignment = lttng_alignof(_type) * CHAR_BIT, \ - .signedness = lttng_is_signed_type(_type), \ - .reverse_byte_order = _byte_order != __BYTE_ORDER, \ + .size = (_size) ? : sizeof(_type) * CHAR_BIT, \ + .alignment = (_alignment) ? : lttng_alignof(_type) * CHAR_BIT, \ + .signedness = (_signedness) >= 0 ? (_signedness) : lttng_is_signed_type(_type), \ + .reverse_byte_order = _byte_order != __BYTE_ORDER, \ .base = _base, \ .encoding = lttng_encode_##_encoding, \ }, \ @@ -118,10 +119,12 @@ struct lttng_type { struct { struct lttng_basic_type elem_type; unsigned int length; /* num. elems. */ + unsigned int elem_alignment; /* alignment override */ } array; struct { struct lttng_basic_type length_type; struct lttng_basic_type elem_type; + unsigned int elem_alignment; /* alignment override */ } sequence; } u; }; diff --git a/probes/lttng-events-nowrite.h b/probes/lttng-events-nowrite.h index 69453ae6..20034f38 100644 --- a/probes/lttng-events-nowrite.h +++ b/probes/lttng-events-nowrite.h @@ -46,6 +46,10 @@ #define ctf_array_text_nowrite(_type, _item, _user_src, _length) \ _ctf_array_encoded(_type, _item, _user_src, _length, UTF8, 0, 1) +#undef ctf_array_bitfield_nowrite +#define ctf_array_bitfield_nowrite(_type, _item, _src, _length) \ + _ctf_array_bitfield(_type, _item, _src, _length, 0, 1) + #undef ctf_sequence_nowrite #define ctf_sequence_nowrite(_type, _item, _user_src, _length_type, _user_src_length) \ _ctf_sequence_encoded(_type, _item, _user_src, \ @@ -56,6 +60,11 @@ _ctf_sequence_encoded(_type, _item, _user_src, \ _length_type, _user_src_length, UTF8, __BYTE_ORDER, 10, 0, 1) +#undef ctf_sequence_bitfield_nowrite +#define ctf_sequence_bitfield_nowrite(_type, _item, _src, _length_type, _src_length) \ + _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, 0, 1) + #undef ctf_string_nowrite #define ctf_string_nowrite(_item, _user_src) \ _ctf_string(_item, _user_src, 0, 1) @@ -85,6 +94,10 @@ #define ctf_user_array_text_nowrite(_type, _item, _user_src, _length) \ _ctf_array_encoded(_type, _item, _user_src, _length, UTF8, 1, 1) +#undef ctf_user_array_bitfield_nowrite +#define ctf_user_array_bitfield_nowrite(_type, _item, _src, _length) \ + _ctf_array_bitfield(_type, _item, _src, _length, 1, 1) + #undef ctf_user_sequence_nowrite #define ctf_user_sequence_nowrite(_type, _item, _user_src, _length_type, _user_src_length) \ _ctf_sequence_encoded(_type, _item, _user_src, \ @@ -95,6 +108,11 @@ _ctf_sequence_encoded(_type, _item, _user_src, \ _length_type, _user_src_length, UTF8, __BYTE_ORDER, 10, 1, 1) +#undef ctf_user_sequence_bitfield_nowrite +#define ctf_user_sequence_bitfield_nowrite(_type, _item, _src, _length_type, _src_length) \ + _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, 1, 1) + #undef ctf_user_string_nowrite #define ctf_user_string_nowrite(_item, _user_src) \ _ctf_string(_item, _user_src, 1, 1) diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index bdd00cb6..1bc77820 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -67,10 +67,17 @@ #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, \ _user, _nowrite) +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) + #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \ _src_length, _encoding, _byte_order, _base, _user, _nowrite) +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, _length_type, \ + _src_length, _byte_order, _user, _nowrite) + #undef _ctf_string #define _ctf_string(_item, _src, _user, _nowrite) @@ -99,6 +106,9 @@ #undef ctf_array_text #define ctf_array_text(_type, _item, _src, _length) +#undef ctf_array_bitfield +#define ctf_array_bitfield(_type, _item, _src, _length) + #undef ctf_sequence #define ctf_sequence(_type, _item, _src, _length_type, _src_length) @@ -111,6 +121,9 @@ #undef ctf_sequence_text #define ctf_sequence_text(_type, _item, _src, _length_type, _src_length) +#undef ctf_sequence_bitfield +#define ctf_sequence_bitfield(_type, _item, _src, _length_type, _src_length) + #undef ctf_string #define ctf_string(_item, _src) @@ -127,12 +140,18 @@ #undef ctf_array_text_nowrite #define ctf_array_text_nowrite(_type, _item, _src, _length) +#undef ctf_array_bitfield_nowrite +#define ctf_array_bitfield_nowrite(_type, _item, _src, _length) + #undef ctf_sequence_nowrite #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) #undef ctf_sequence_text_nowrite #define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length) +#undef ctf_sequence_bitfield_nowrite +#define ctf_sequence_bitfield_nowrite(_type, _item, _src, _length_type, _src_length) + #undef ctf_string_nowrite #define ctf_string_nowrite(_item, _src) @@ -158,12 +177,18 @@ #undef ctf_user_array_text #define ctf_user_array_text(_type, _item, _user_src, _length) +#undef ctf_user_array_bitfield +#define ctf_user_array_bitfield(_type, _item, _src, _length) + #undef ctf_user_sequence #define ctf_user_sequence(_type, _item, _user_src, _length_type, _user_src_length) #undef ctf_user_sequence_text #define ctf_user_sequence_text(_type, _item, _user_src, _length_type, _user_src_length) +#undef ctf_user_sequence_bitfield +#define ctf_user_sequence_bitfield(_type, _item, _src, _length_type, _src_length) + #undef ctf_user_string #define ctf_user_string(_item, _user_src) @@ -180,11 +205,17 @@ #undef ctf_user_array_text_nowrite #define ctf_user_array_text_nowrite(_type, _item, _user_src, _length) +#undef ctf_user_array_bitfield_nowrite +#define ctf_user_array_bitfield_nowrite(_type, _item, _src, _length) + #undef ctf_user_sequence_nowrite #define ctf_user_sequence_nowrite(_type, _item, _user_src, _length_type, _user_src_length) #undef ctf_user_sequence_text_nowrite #define ctf_user_sequence_text_nowrite(_type, _item, _user_src, _length_type, _user_src_length) +#undef ctf_user_sequence_bitfield_nowrite +#define ctf_user_sequence_bitfield_nowrite(_type, _item, _src, _length_type, _src_length) + #undef ctf_user_string_nowrite #define ctf_user_string_nowrite(_item, _user_src) diff --git a/probes/lttng-events-write.h b/probes/lttng-events-write.h index dde883ea..19041e5d 100644 --- a/probes/lttng-events-write.h +++ b/probes/lttng-events-write.h @@ -46,6 +46,10 @@ #define ctf_array_text(_type, _item, _src, _length) \ _ctf_array_encoded(_type, _item, _src, _length, UTF8, 0, 0) +#undef ctf_array_bitfield +#define ctf_array_bitfield(_type, _item, _src, _length) \ + _ctf_array_bitfield(_type, _item, _src, _length, 0, 0) + #undef ctf_sequence #define ctf_sequence(_type, _item, _src, _length_type, _src_length) \ _ctf_sequence_encoded(_type, _item, _src, \ @@ -66,6 +70,11 @@ _ctf_sequence_encoded(_type, _item, _src, \ _length_type, _src_length, UTF8, __BYTE_ORDER, 10, 0, 0) +#undef ctf_sequence_bitfield +#define ctf_sequence_bitfield(_type, _item, _src, _length_type, _src_length) \ + _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, 0, 0) + #undef ctf_string #define ctf_string(_item, _src) \ _ctf_string(_item, _src, 0, 0) @@ -95,6 +104,10 @@ #define ctf_user_array_text(_type, _item, _src, _length) \ _ctf_array_encoded(_type, _item, _src, _length, UTF8, 1, 0) +#undef ctf_user_array_bitfield +#define ctf_user_array_bitfield(_type, _item, _src, _length) \ + _ctf_array_bitfield(_type, _item, _src, _length, 1, 0) + #undef ctf_user_sequence #define ctf_user_sequence(_type, _item, _src, _length_type, _src_length) \ _ctf_sequence_encoded(_type, _item, _src, \ @@ -110,6 +123,11 @@ _ctf_sequence_encoded(_type, _item, _src, \ _length_type, _src_length, UTF8, __BYTE_ORDER, 10, 1, 0) +#undef ctf_user_sequence_bitfield +#define ctf_user_sequence_bitfield(_type, _item, _src, _length_type, _src_length) \ + _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, 1, 0) + #undef ctf_user_string #define ctf_user_string(_item, _src) \ _ctf_string(_item, _src, 1, 0) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index a6c36b08..35d6f790 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -22,6 +22,7 @@ #include #include #include +#include #include "lttng.h" #include "lttng-types.h" #include "lttng-probe-user.h" @@ -189,7 +190,7 @@ void __event_template_proto___##_name(void); #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _user, _nowrite) \ { \ .name = #_item, \ - .type = __type_integer(_type, _byte_order, _base, none),\ + .type = __type_integer(_type, 0, 0, -1, _byte_order, _base, none),\ .nowrite = _nowrite, \ .user = _user, \ }, @@ -205,7 +206,7 @@ void __event_template_proto___##_name(void); { \ .array = \ { \ - .elem_type = __type_integer(_type, __BYTE_ORDER, 10, _encoding), \ + .elem_type = __type_integer(_type, 0, 0, 0, __BYTE_ORDER, 10, _encoding), \ .length = _length, \ } \ } \ @@ -214,6 +215,28 @@ void __event_template_proto___##_name(void); .user = _user, \ }, +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_array, \ + .u = \ + { \ + .array = \ + { \ + .elem_type = __type_integer(_type, 1, 1, 0, __LITTLE_ENDIAN, 10, none), \ + .length = (_length) * sizeof(_type) * CHAR_BIT, \ + .elem_alignment = lttng_alignof(_type), \ + } \ + } \ + }, \ + .nowrite = _nowrite, \ + .user = _user, \ + }, + + #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, \ _length_type, _src_length, _encoding, \ @@ -227,8 +250,31 @@ void __event_template_proto___##_name(void); { \ .sequence = \ { \ - .length_type = __type_integer(_length_type, __BYTE_ORDER, 10, none), \ - .elem_type = __type_integer(_type, _byte_order, _base, _encoding), \ + .length_type = __type_integer(_length_type, 0, 0, 0, __BYTE_ORDER, 10, none), \ + .elem_type = __type_integer(_type, 0, 0, -1, _byte_order, _base, _encoding), \ + }, \ + }, \ + }, \ + .nowrite = _nowrite, \ + .user = _user, \ + }, + +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, \ + _user, _nowrite) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_sequence, \ + .u = \ + { \ + .sequence = \ + { \ + .length_type = __type_integer(_length_type, 0, 0, 0, __BYTE_ORDER, 10, none), \ + .elem_type = __type_integer(_type, 1, 1, 0, __LITTLE_ENDIAN, 10, none), \ + .elem_alignment = lttng_alignof(_type), \ }, \ }, \ }, \ @@ -309,6 +355,10 @@ static void __event_probe__##_name(void *__data); __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ __event_len += sizeof(_type) * (_length); +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \ + _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite) + #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \ _src_length, _encoding, _byte_order, _base, _user, _nowrite) \ @@ -319,6 +369,13 @@ static void __event_probe__##_name(void *__data); __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \ __dynamic_len_idx++; +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, \ + _user, _nowrite) \ + _ctf_sequence_encoded(_type, _item, _src, _length_type, _src_length, \ + none, __LITTLE_ENDIAN, 10, _user, _nowrite) + /* * ctf_user_string includes \0. If returns 0, it faulted, so we set size to * 1 (\0 only). @@ -477,6 +534,10 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, \ __stack_data += sizeof(void *); \ } +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \ + _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite) + #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \ _src_length, _encoding, _byte_order, _base, _user, _nowrite) \ @@ -489,6 +550,13 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, \ __stack_data += sizeof(void *); \ } +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, \ + _user, _nowrite) \ + _ctf_sequence_encoded(_type, _item, _src, _length_type, _src_length, \ + none, __LITTLE_ENDIAN, 10, _user, _nowrite) + #undef _ctf_string #define _ctf_string(_item, _src, _user, _nowrite) \ { \ @@ -548,12 +616,23 @@ void __event_prepare_filter_stack__##_name(char *__stack_data, \ #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \ __event_align = max_t(size_t, __event_align, lttng_alignof(_type)); +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \ + _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite) + #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \ _src_length, _encoding, _byte_order, _base, _user, _nowrite) \ __event_align = max_t(size_t, __event_align, lttng_alignof(_length_type)); \ __event_align = max_t(size_t, __event_align, lttng_alignof(_type)); +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, \ + _user, _nowrite) \ + _ctf_sequence_encoded(_type, _item, _src, _length_type, _src_length, \ + none, __LITTLE_ENDIAN, 10, _user, _nowrite) + #undef _ctf_string #define _ctf_string(_item, _src, _user, _nowrite) @@ -635,6 +714,54 @@ static inline size_t __event_get_align__##_name(void *__tp_locvar) \ __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \ } +#if (__BYTE_ORDER == __LITTLE_ENDIAN) +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + if (_user) { \ + __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length)); \ + } else { \ + __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \ + } +#else /* #if (__BYTE_ORDER == __LITTLE_ENDIAN) */ +/* + * For big endian, we need to byteswap into little endian. + */ +#undef _ctf_array_bitfield +#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + { \ + size_t _i; \ + \ + for (_i = 0; _i < (_length); _i++) { \ + _type _tmp; \ + \ + if (_user) { \ + if (get_user(_tmp, (_type *) _src + _i)) \ + _tmp = 0; \ + } else { \ + _tmp = ((_type *) _src)[_i]; \ + } \ + switch (sizeof(_type)) { \ + case 1: \ + break; \ + case 2: \ + _tmp = cpu_to_le16(_tmp); \ + break; \ + case 4: \ + _tmp = cpu_to_le32(_tmp); \ + break; \ + case 8: \ + _tmp = cpu_to_le64(_tmp); \ + break; \ + default: \ + BUG_ON(1); \ + } \ + __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type)); \ + } \ + } +#endif /* #else #if (__BYTE_ORDER == __LITTLE_ENDIAN) */ + #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _length_type, \ _src_length, _encoding, _byte_order, _base, _user, _nowrite) \ @@ -652,6 +779,71 @@ static inline size_t __event_get_align__##_name(void *__tp_locvar) \ sizeof(_type) * __get_dynamic_len(dest)); \ } +#if (__BYTE_ORDER == __LITTLE_ENDIAN) +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, \ + _user, _nowrite) \ + { \ + _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx] * sizeof(_type) * CHAR_BIT; \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\ + __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\ + } \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + if (_user) { \ + __chan->ops->event_write_from_user(&__ctx, _src, \ + sizeof(_type) * __get_dynamic_len(dest)); \ + } else { \ + __chan->ops->event_write(&__ctx, _src, \ + sizeof(_type) * __get_dynamic_len(dest)); \ + } +#else /* #if (__BYTE_ORDER == __LITTLE_ENDIAN) */ +/* + * For big endian, we need to byteswap into little endian. + */ +#undef _ctf_sequence_bitfield +#define _ctf_sequence_bitfield(_type, _item, _src, \ + _length_type, _src_length, \ + _user, _nowrite) \ + { \ + _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx] * sizeof(_type) * CHAR_BIT; \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\ + __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\ + } \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + { \ + size_t _i, _length; \ + \ + _length = __get_dynamic_len(dest); \ + for (_i = 0; _i < _length; _i++) { \ + _type _tmp; \ + \ + if (_user) { \ + if (get_user(_tmp, (_type *) _src + _i)) \ + _tmp = 0; \ + } else { \ + _tmp = ((_type *) _src)[_i]; \ + } \ + switch (sizeof(_type)) { \ + case 1: \ + break; \ + case 2: \ + _tmp = cpu_to_le16(_tmp); \ + break; \ + case 4: \ + _tmp = cpu_to_le32(_tmp); \ + break; \ + case 8: \ + _tmp = cpu_to_le64(_tmp); \ + break; \ + default: \ + BUG_ON(1); \ + } \ + __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type)); \ + } \ + } +#endif /* #else #if (__BYTE_ORDER == __LITTLE_ENDIAN) */ + #undef _ctf_string #define _ctf_string(_item, _src, _user, _nowrite) \ lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(*(_src))); \ diff --git a/probes/lttng-types.h b/probes/lttng-types.h index 93760667..3809414c 100644 --- a/probes/lttng-types.h +++ b/probes/lttng-types.h @@ -68,7 +68,7 @@ #define TRACE_EVENT_TYPE___enum(_name, _container_type) \ { \ .name = #_name, \ - .container_type = __type_integer(_container_type, __BYTE_ORDER, 10, none), \ + .container_type = __type_integer(_container_type, 0, 0, -1, __BYTE_ORDER, 10, none), \ .entries = __trace_event_enum_##_name, \ .len = ARRAY_SIZE(__trace_event_enum_##_name), \ },