| 1 | /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) |
| 2 | * |
| 3 | * probes/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 <probes/lttng.h> |
| 19 | #include <lttng-events.h> |
| 20 | #include <lttng-tracer.h> |
| 21 | #include <lttng-endian.h> |
| 22 | |
| 23 | #endif /* _LTTNG_PROBES_LTTNG_TYPES_H */ |
| 24 | |
| 25 | /* Export enumerations */ |
| 26 | |
| 27 | #ifdef STAGE_EXPORT_ENUMS |
| 28 | |
| 29 | #undef TRACE_EVENT_TYPE |
| 30 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) |
| 31 | |
| 32 | #undef TRACE_EVENT_ENUM |
| 33 | #define TRACE_EVENT_ENUM(_name, _entries...) \ |
| 34 | const struct lttng_enum_entry __trace_event_enum_##_name[] = { \ |
| 35 | PARAMS(_entries) \ |
| 36 | }; |
| 37 | |
| 38 | /* Enumeration entry (single value) */ |
| 39 | #undef V |
| 40 | #define V(_string) { _string, _string, #_string} |
| 41 | |
| 42 | /* Enumeration entry (range) */ |
| 43 | #undef R |
| 44 | #define R(_string, _range_start, _range_end) \ |
| 45 | { _range_start, _range_end, #_string } |
| 46 | |
| 47 | #endif /* STAGE_EXPORT_ENUMS */ |
| 48 | |
| 49 | |
| 50 | /* Export named types */ |
| 51 | |
| 52 | #ifdef STAGE_EXPORT_TYPES |
| 53 | |
| 54 | #undef TRACE_EVENT_TYPE___enum |
| 55 | #define TRACE_EVENT_TYPE___enum(_name, _container_type) \ |
| 56 | { \ |
| 57 | .name = #_name, \ |
| 58 | .container_type = __type_integer(_container_type, 0, 0, -1, __BYTE_ORDER, 10, none), \ |
| 59 | .entries = __trace_event_enum_##_name, \ |
| 60 | .len = ARRAY_SIZE(__trace_event_enum_##_name), \ |
| 61 | }, |
| 62 | |
| 63 | /* Local declaration */ |
| 64 | #undef TRACE_EVENT_TYPE |
| 65 | #define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \ |
| 66 | TRACE_EVENT_TYPE___##_abstract_type(_name, args) |
| 67 | |
| 68 | #undef TRACE_EVENT_ENUM |
| 69 | #define TRACE_EVENT_ENUM(_name, _entries...) |
| 70 | |
| 71 | #endif /* STAGE_EXPORT_TYPES */ |