Prefix lttng_enum_value and lttng_enum_entry with lttng_kernel_
[lttng-modules.git] / include / lttng / types.h
1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
2 *
3 * lttng/types.h
4 *
5 * LTTng types.
6 *
7 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 */
9
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
17 #include <linux/seq_file.h>
18 #include <lttng/events.h>
19 #include <lttng/tracer.h>
20 #include <lttng/endian.h>
21
22 #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */
23
24 #undef PARAMS
25 #define PARAMS(args...) args
26
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_kernel_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
56 #undef TRACE_EVENT_TYPE___enum
57 #define TRACE_EVENT_TYPE___enum(_name, _container_type) \
58 { \
59 .name = #_name, \
60 .container_type = __type_integer(_container_type, 0, 0, -1, __BYTE_ORDER, 10, none), \
61 .entries = __trace_event_enum_##_name, \
62 .len = ARRAY_SIZE(__trace_event_enum_##_name), \
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 */
This page took 0.030247 seconds and 4 git commands to generate.