Commit | Line | Data |
---|---|---|
40652b65 MD |
1 | /* |
2 | * Protect against multiple inclusion of structure declarations, but run the | |
3 | * stages below each time. | |
4 | */ | |
5 | #ifndef _LTTNG_PROBES_LTTNG_TYPES_H | |
6 | #define _LTTNG_PROBES_LTTNG_TYPES_H | |
7 | ||
d0dd2ecb | 8 | #include <linux/seq_file.h> |
c0edae1d MD |
9 | #include "lttng.h" |
10 | #include "../ltt-events.h" | |
d793d5e1 | 11 | #include "../ltt-tracer.h" |
9115fbdc | 12 | #include "../ltt-endian.h" |
1d12cebd | 13 | |
40652b65 MD |
14 | #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */ |
15 | ||
40652b65 MD |
16 | /* Export enumerations */ |
17 | ||
18 | #ifdef STAGE_EXPORT_ENUMS | |
19 | ||
20 | #undef TRACE_EVENT_TYPE | |
21 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) | |
22 | ||
23 | #undef TRACE_EVENT_ENUM | |
24 | #define TRACE_EVENT_ENUM(_name, _entries...) \ | |
25 | const struct lttng_enum_entry __trace_event_enum_##_name[] = { \ | |
26 | PARAMS(_entries) \ | |
27 | }; | |
28 | ||
29 | /* Enumeration entry (single value) */ | |
30 | #undef V | |
31 | #define V(_string) { _string, _string, #_string} | |
32 | ||
33 | /* Enumeration entry (range) */ | |
34 | #undef R | |
35 | #define R(_string, _range_start, _range_end) \ | |
36 | { _range_start, _range_end, #_string } | |
37 | ||
38 | #endif /* STAGE_EXPORT_ENUMS */ | |
39 | ||
40 | ||
41 | /* Export named types */ | |
42 | ||
43 | #ifdef STAGE_EXPORT_TYPES | |
44 | ||
40652b65 | 45 | #undef TRACE_EVENT_TYPE___enum |
c099397a MD |
46 | #define TRACE_EVENT_TYPE___enum(_name, _container_type) \ |
47 | { \ | |
48 | .name = #_name, \ | |
e0a7a7c4 | 49 | .container_type = __type_integer(_container_type, __BYTE_ORDER, 10), \ |
c099397a MD |
50 | .entries = __trace_event_enum_##_name, \ |
51 | .len = ARRAY_SIZE(__trace_event_enum_##_name), \ | |
40652b65 MD |
52 | }, |
53 | ||
54 | /* Local declaration */ | |
55 | #undef TRACE_EVENT_TYPE | |
56 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \ | |
57 | TRACE_EVENT_TYPE___##_abstract_type(_name, args) | |
58 | ||
59 | #undef TRACE_EVENT_ENUM | |
60 | #define TRACE_EVENT_ENUM(_name, _entries...) | |
61 | ||
62 | #endif /* STAGE_EXPORT_TYPES */ |