cbe1dea1c4f4524624cc58ab358df3848d509589
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
8 #include <linux/seq_file.h>
10 #include "../ltt-events.h"
13 # include <asm/byteorder.h>
15 # define __BYTE_ORDER __BIG_ENDIAN
16 # elif defined(__LITTLE_ENDIAN)
17 # define __BYTE_ORDER __LITTLE_ENDIAN
19 # error "unknown endianness"
22 # define __BIG_ENDIAN 4321
24 #ifndef __LITTLE_ENDIAN
25 # define __LITTLE_ENDIAN 1234
31 void lttng_print_event_type(struct seq_file
*m
, unsigned int indent
,
32 const struct lttng_type
*type
);
34 #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */
37 /* Export enumerations */
39 #ifdef STAGE_EXPORT_ENUMS
41 #undef TRACE_EVENT_TYPE
42 #define TRACE_EVENT_TYPE(_name, _abstract_type, args...)
44 #undef TRACE_EVENT_ENUM
45 #define TRACE_EVENT_ENUM(_name, _entries...) \
46 const struct lttng_enum_entry __trace_event_enum_##_name[] = { \
50 /* Enumeration entry (single value) */
52 #define V(_string) { _string, _string, #_string}
54 /* Enumeration entry (range) */
56 #define R(_string, _range_start, _range_end) \
57 { _range_start, _range_end, #_string }
59 #endif /* STAGE_EXPORT_ENUMS */
62 /* Export named types */
64 #ifdef STAGE_EXPORT_TYPES
66 #undef TRACE_EVENT_TYPE___integer_ext
67 #define TRACE_EVENT_TYPE___integer_ext(_name, _byte_order) \
69 .atype = atype_integer, \
71 .u.integer.size = sizeof(_name) * 8, \
72 .u.integer.alignment = __alignof__(_name) * 8,\
73 .u.integer.signedness = is_signed_type(_name),\
74 .u.integer.reverse_byte_order = ((_byte_order) != __BYTE_ORDER),\
77 #undef TRACE_EVENT_TYPE___integer
78 #define TRACE_EVENT_TYPE___integer(_name, _unused) \
79 TRACE_EVENT_TYPE___integer_ext(_name, __BYTE_ORDER)
81 #undef TRACE_EVENT_TYPE___enum
82 #define TRACE_EVENT_TYPE___enum(_name, _parent_type) \
84 .atype = atype_enum, \
86 .u.enumeration.parent_type = #_parent_type, \
87 .u.enumeration.def.entries = __trace_event_enum_##_name, \
88 .u.enumeration.def.len = ARRAY_SIZE(__trace_event_enum_##_name), \
91 #undef TRACE_EVENT_TYPE___array
92 #define TRACE_EVENT_TYPE___array(_name, _elem_type, _length) \
94 .atype = atype_array, \
96 .u.array.elem_type = #_elem_type, \
97 .u.array.length = _length, \
100 #undef TRACE_EVENT_TYPE___sequence
101 #define TRACE_EVENT_TYPE___sequence(_name, _elem_type, _length_type) \
103 .atype = atype_sequence, \
105 .u.sequence.elem_type = #_elem_type, \
106 .u.sequence.length_type = #_length_type, \
109 #undef TRACE_EVENT_TYPE___string
110 #define TRACE_EVENT_TYPE___string(_name, _encoding) \
112 .atype = atype_string, \
114 .u.string.encoding = lttng_encode_##_encoding,\
118 /* Local declaration */
119 #undef TRACE_EVENT_TYPE
120 #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \
121 TRACE_EVENT_TYPE___##_abstract_type(_name, args)
123 #undef TRACE_EVENT_ENUM
124 #define TRACE_EVENT_ENUM(_name, _entries...)
126 #endif /* STAGE_EXPORT_TYPES */
This page took 0.035397 seconds and 4 git commands to generate.