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 | ||
17baffe2 MD |
8 | /* |
9 | * probes/lttng-types.h | |
10 | * | |
17baffe2 MD |
11 | * LTTng types. |
12 | * | |
886d51a3 MD |
13 | * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
14 | * | |
15 | * This library is free software; you can redistribute it and/or | |
16 | * modify it under the terms of the GNU Lesser General Public | |
17 | * License as published by the Free Software Foundation; only | |
18 | * version 2.1 of the License. | |
19 | * | |
20 | * This library is distributed in the hope that it will be useful, | |
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
23 | * Lesser General Public License for more details. | |
24 | * | |
25 | * You should have received a copy of the GNU Lesser General Public | |
26 | * License along with this library; if not, write to the Free Software | |
27 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
17baffe2 MD |
28 | */ |
29 | ||
d0dd2ecb | 30 | #include <linux/seq_file.h> |
c0edae1d | 31 | #include "lttng.h" |
a90917c3 MD |
32 | #include "../lttng-events.h" |
33 | #include "../lttng-tracer.h" | |
34 | #include "../lttng-endian.h" | |
1d12cebd | 35 | |
40652b65 MD |
36 | #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */ |
37 | ||
40652b65 MD |
38 | /* Export enumerations */ |
39 | ||
40 | #ifdef STAGE_EXPORT_ENUMS | |
41 | ||
42 | #undef TRACE_EVENT_TYPE | |
43 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) | |
44 | ||
45 | #undef TRACE_EVENT_ENUM | |
46 | #define TRACE_EVENT_ENUM(_name, _entries...) \ | |
47 | const struct lttng_enum_entry __trace_event_enum_##_name[] = { \ | |
48 | PARAMS(_entries) \ | |
49 | }; | |
50 | ||
51 | /* Enumeration entry (single value) */ | |
52 | #undef V | |
53 | #define V(_string) { _string, _string, #_string} | |
54 | ||
55 | /* Enumeration entry (range) */ | |
56 | #undef R | |
57 | #define R(_string, _range_start, _range_end) \ | |
58 | { _range_start, _range_end, #_string } | |
59 | ||
60 | #endif /* STAGE_EXPORT_ENUMS */ | |
61 | ||
62 | ||
63 | /* Export named types */ | |
64 | ||
65 | #ifdef STAGE_EXPORT_TYPES | |
66 | ||
40652b65 | 67 | #undef TRACE_EVENT_TYPE___enum |
c099397a MD |
68 | #define TRACE_EVENT_TYPE___enum(_name, _container_type) \ |
69 | { \ | |
70 | .name = #_name, \ | |
43803cf2 | 71 | .container_type = __type_integer(_container_type, 0, 0, -1, __BYTE_ORDER, 10, none), \ |
c099397a MD |
72 | .entries = __trace_event_enum_##_name, \ |
73 | .len = ARRAY_SIZE(__trace_event_enum_##_name), \ | |
40652b65 MD |
74 | }, |
75 | ||
76 | /* Local declaration */ | |
77 | #undef TRACE_EVENT_TYPE | |
78 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \ | |
79 | TRACE_EVENT_TYPE___##_abstract_type(_name, args) | |
80 | ||
81 | #undef TRACE_EVENT_ENUM | |
82 | #define TRACE_EVENT_ENUM(_name, _entries...) | |
83 | ||
84 | #endif /* STAGE_EXPORT_TYPES */ |