Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
9f36eaed | 2 | * |
3b4aafcb | 3 | * lttng/types.h |
17baffe2 | 4 | * |
17baffe2 MD |
5 | * LTTng types. |
6 | * | |
886d51a3 | 7 | * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
17baffe2 MD |
8 | */ |
9 | ||
9f36eaed MJ |
10 | /* |
11 | * Protect against multiple inclusion of structure declarations, but run the | |
12 | * stages below each time. | |
13 | */ | |
14 | #ifndef _LTTNG_PROBES_LTTNG_TYPES_H | |
15 | #define _LTTNG_PROBES_LTTNG_TYPES_H | |
16 | ||
d0dd2ecb | 17 | #include <linux/seq_file.h> |
2df37e95 MD |
18 | #include <lttng/events.h> |
19 | #include <lttng/tracer.h> | |
20 | #include <lttng/endian.h> | |
1d12cebd | 21 | |
40652b65 MD |
22 | #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */ |
23 | ||
3b4aafcb MD |
24 | #undef PARAMS |
25 | #define PARAMS(args...) args | |
26 | ||
40652b65 MD |
27 | /* Export enumerations */ |
28 | ||
29 | #ifdef STAGE_EXPORT_ENUMS | |
30 | ||
31 | #undef TRACE_EVENT_TYPE | |
32 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) | |
33 | ||
34 | #undef TRACE_EVENT_ENUM | |
35 | #define TRACE_EVENT_ENUM(_name, _entries...) \ | |
36 | const struct lttng_enum_entry __trace_event_enum_##_name[] = { \ | |
37 | PARAMS(_entries) \ | |
38 | }; | |
39 | ||
40 | /* Enumeration entry (single value) */ | |
41 | #undef V | |
42 | #define V(_string) { _string, _string, #_string} | |
43 | ||
44 | /* Enumeration entry (range) */ | |
45 | #undef R | |
46 | #define R(_string, _range_start, _range_end) \ | |
47 | { _range_start, _range_end, #_string } | |
48 | ||
49 | #endif /* STAGE_EXPORT_ENUMS */ | |
50 | ||
51 | ||
52 | /* Export named types */ | |
53 | ||
54 | #ifdef STAGE_EXPORT_TYPES | |
55 | ||
40652b65 | 56 | #undef TRACE_EVENT_TYPE___enum |
c099397a MD |
57 | #define TRACE_EVENT_TYPE___enum(_name, _container_type) \ |
58 | { \ | |
59 | .name = #_name, \ | |
43803cf2 | 60 | .container_type = __type_integer(_container_type, 0, 0, -1, __BYTE_ORDER, 10, none), \ |
c099397a MD |
61 | .entries = __trace_event_enum_##_name, \ |
62 | .len = ARRAY_SIZE(__trace_event_enum_##_name), \ | |
40652b65 MD |
63 | }, |
64 | ||
65 | /* Local declaration */ | |
66 | #undef TRACE_EVENT_TYPE | |
67 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \ | |
68 | TRACE_EVENT_TYPE___##_abstract_type(_name, args) | |
69 | ||
70 | #undef TRACE_EVENT_ENUM | |
71 | #define TRACE_EVENT_ENUM(_name, _entries...) | |
72 | ||
73 | #endif /* STAGE_EXPORT_TYPES */ |