2 * Protect against multiple inclusion of structure declarations, but run the
3 * stages below each time.
5 #ifndef _LTTNG_PROBES_LTTNG_TYPES_H
6 #define _LTTNG_PROBES_LTTNG_TYPES_H
17 struct lttng_enum_entry
{
18 unsigned long long start
, end
; /* start and end are inclusive */
23 const struct lttng_enum_entry
*entries
;
28 enum abstract_types atype
;
32 unsigned int size
; /* in bits */
33 unsigned short alignment
; /* in bits */
34 unsigned int signedness
:1;
37 const char *parent_type
;
38 const struct lttng_enum def
;
41 const char *elem_type
;
42 unsigned int length
; /* num. elems. */
45 } __attribute__((packed
));
47 #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */
50 /* Export enumerations */
52 #ifdef STAGE_EXPORT_ENUMS
54 #undef TRACE_EVENT_TYPE
55 #define TRACE_EVENT_TYPE(_name, _abstract_type, args...)
57 #undef TRACE_EVENT_ENUM
58 #define TRACE_EVENT_ENUM(_name, _entries...) \
59 const struct lttng_enum_entry __trace_event_enum_##_name[] = { \
63 /* Enumeration entry (single value) */
65 #define V(_string) { _string, _string, #_string}
67 /* Enumeration entry (range) */
69 #define R(_string, _range_start, _range_end) \
70 { _range_start, _range_end, #_string }
72 #endif /* STAGE_EXPORT_ENUMS */
75 /* Export named types */
77 #ifdef STAGE_EXPORT_TYPES
79 #undef TRACE_EVENT_TYPE___integer
80 #define TRACE_EVENT_TYPE___integer(_name, _unused) \
82 .atype = atype_integer, \
84 .u.integer.size = sizeof(_name) * 8, \
85 .u.integer.alignment = __alignof__(_name) * 8,\
86 .u.integer.signedness = is_signed_type(_name),\
89 #undef TRACE_EVENT_TYPE___enum
90 #define TRACE_EVENT_TYPE___enum(_name, _parent_type) \
92 .atype = atype_enum, \
94 .u.enumeration.parent_type = #_parent_type, \
95 .u.enumeration.def.entries = __trace_event_enum_##_name, \
96 .u.enumeration.def.len = ARRAY_SIZE(__trace_event_enum_##_name), \
99 #undef TRACE_EVENT_TYPE___array
100 #define TRACE_EVENT_TYPE___array(_name, _elem_type, _length) \
102 .atype = atype_array, \
104 .u.array.elem_type = #_elem_type, \
105 .u.array.length = _length, \
108 /* Local declaration */
109 #undef TRACE_EVENT_TYPE
110 #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \
111 TRACE_EVENT_TYPE___##_abstract_type(_name, args)
113 #undef TRACE_EVENT_ENUM
114 #define TRACE_EVENT_ENUM(_name, _entries...)
116 #endif /* STAGE_EXPORT_TYPES */
This page took 0.036299 seconds and 4 git commands to generate.