Cleanup: Move headers from lib/ to include/lttng/
[lttng-modules.git] / probes / lttng-types.h
CommitLineData
b7cdc182 1/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
9f36eaed 2 *
17baffe2
MD
3 * probes/lttng-types.h
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>
62ea4137
MD
18#include <probes/lttng.h>
19#include <lttng-events.h>
20#include <lttng-tracer.h>
21#include <lttng-endian.h>
1d12cebd 22
40652b65
MD
23#endif /* _LTTNG_PROBES_LTTNG_TYPES_H */
24
40652b65
MD
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
40652b65 54#undef TRACE_EVENT_TYPE___enum
c099397a
MD
55#define TRACE_EVENT_TYPE___enum(_name, _container_type) \
56 { \
57 .name = #_name, \
43803cf2 58 .container_type = __type_integer(_container_type, 0, 0, -1, __BYTE_ORDER, 10, none), \
c099397a
MD
59 .entries = __trace_event_enum_##_name, \
60 .len = ARRAY_SIZE(__trace_event_enum_##_name), \
40652b65
MD
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 */
This page took 0.049727 seconds and 4 git commands to generate.