Metadata generation (partial)
[lttng-modules.git] / probes / lttng-types.h
CommitLineData
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
d0dd2ecb 8#include <linux/seq_file.h>
c0edae1d
MD
9#include "lttng.h"
10#include "../ltt-events.h"
40652b65 11
1d12cebd
MD
12#ifdef __KERNEL__
13# include <asm/byteorder.h>
14# ifdef __BIG_ENDIAN
15# define __BYTE_ORDER __BIG_ENDIAN
16# elif defined(__LITTLE_ENDIAN)
17# define __BYTE_ORDER __LITTLE_ENDIAN
18# else
19# error "unknown endianness"
20# endif
21#ifndef __BIG_ENDIAN
22# define __BIG_ENDIAN 4321
23#endif
24#ifndef __LITTLE_ENDIAN
25# define __LITTLE_ENDIAN 1234
26#endif
27#else
28# include <endian.h>
29#endif
30
40652b65
MD
31#endif /* _LTTNG_PROBES_LTTNG_TYPES_H */
32
33
34/* Export enumerations */
35
36#ifdef STAGE_EXPORT_ENUMS
37
38#undef TRACE_EVENT_TYPE
39#define TRACE_EVENT_TYPE(_name, _abstract_type, args...)
40
41#undef TRACE_EVENT_ENUM
42#define TRACE_EVENT_ENUM(_name, _entries...) \
43 const struct lttng_enum_entry __trace_event_enum_##_name[] = { \
44 PARAMS(_entries) \
45 };
46
47/* Enumeration entry (single value) */
48#undef V
49#define V(_string) { _string, _string, #_string}
50
51/* Enumeration entry (range) */
52#undef R
53#define R(_string, _range_start, _range_end) \
54 { _range_start, _range_end, #_string }
55
56#endif /* STAGE_EXPORT_ENUMS */
57
58
59/* Export named types */
60
61#ifdef STAGE_EXPORT_TYPES
62
40652b65 63#undef TRACE_EVENT_TYPE___enum
c099397a
MD
64#define TRACE_EVENT_TYPE___enum(_name, _container_type) \
65 { \
66 .name = #_name, \
67 .container_type = __type_integer(_container_type, __BYTE_ORDER), \
68 .entries = __trace_event_enum_##_name, \
69 .len = ARRAY_SIZE(__trace_event_enum_##_name), \
40652b65
MD
70 },
71
72/* Local declaration */
73#undef TRACE_EVENT_TYPE
74#define TRACE_EVENT_TYPE(_name, _abstract_type, args...) \
75 TRACE_EVENT_TYPE___##_abstract_type(_name, args)
76
77#undef TRACE_EVENT_ENUM
78#define TRACE_EVENT_ENUM(_name, _entries...)
79
80#endif /* STAGE_EXPORT_TYPES */
This page took 0.025608 seconds and 4 git commands to generate.