tracing: add TRACE_EVENT_MAP
[deliverable/linux.git] / include / trace / define_trace.h
CommitLineData
a8d154b0 1/*
4907cb7b 2 * Trace files that want to automate creation of all tracepoints defined
a8d154b0
SR
3 * in their file should include this file. The following are macros that the
4 * trace file may define:
5 *
6 * TRACE_SYSTEM defines the system the tracepoint is for
7 *
8 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
9 * This macro may be defined to tell define_trace.h what file to include.
10 * Note, leave off the ".h".
11 *
12 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
13 * then this macro can define the path to use. Note, the path is relative to
14 * define_trace.h, not the file including it. Full path names for out of tree
15 * modules must be used.
16 */
17
18#ifdef CREATE_TRACE_POINTS
19
20/* Prevent recursion */
21#undef CREATE_TRACE_POINTS
22
23#include <linux/stringify.h>
24
25#undef TRACE_EVENT
26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
27 DEFINE_TRACE(name)
28
b1dace68
JD
29#undef TRACE_EVENT_MAP
30#define TRACE_EVENT_MAP(name, map, proto, args, tstruct, assign, print)
31
287050d3
SR
32#undef TRACE_EVENT_CONDITION
33#define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
34 TRACE_EVENT(name, \
35 PARAMS(proto), \
36 PARAMS(args), \
37 PARAMS(tstruct), \
38 PARAMS(assign), \
39 PARAMS(print))
40
97419875
JS
41#undef TRACE_EVENT_FN
42#define TRACE_EVENT_FN(name, proto, args, tstruct, \
43 assign, print, reg, unreg) \
44 DEFINE_TRACE_FN(name, reg, unreg)
45
2701121b
DK
46#undef TRACE_EVENT_FN_COND
47#define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct, \
48 assign, print, reg, unreg) \
49 DEFINE_TRACE_FN(name, reg, unreg)
50
ff038f5c
SR
51#undef DEFINE_EVENT
52#define DEFINE_EVENT(template, name, proto, args) \
53 DEFINE_TRACE(name)
54
f5abaa1b
SR
55#undef DEFINE_EVENT_FN
56#define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \
57 DEFINE_TRACE_FN(name, reg, unreg)
58
e5bc9721
SR
59#undef DEFINE_EVENT_PRINT
60#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
61 DEFINE_TRACE(name)
62
287050d3
SR
63#undef DEFINE_EVENT_CONDITION
64#define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \
65 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
66
a8d154b0
SR
67#undef DECLARE_TRACE
68#define DECLARE_TRACE(name, proto, args) \
69 DEFINE_TRACE(name)
70
71#undef TRACE_INCLUDE
72#undef __TRACE_INCLUDE
73
74#ifndef TRACE_INCLUDE_FILE
75# define TRACE_INCLUDE_FILE TRACE_SYSTEM
76# define UNDEF_TRACE_INCLUDE_FILE
77#endif
78
79#ifndef TRACE_INCLUDE_PATH
ad8d75ff 80# define __TRACE_INCLUDE(system) <trace/events/system.h>
c2518c43 81# define UNDEF_TRACE_INCLUDE_PATH
a8d154b0
SR
82#else
83# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
84#endif
85
86# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
87
88/* Let the trace headers be reread */
89#define TRACE_HEADER_MULTI_READ
90
91#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
92
2e26ca71
SR
93/* Make all open coded DECLARE_TRACE nops */
94#undef DECLARE_TRACE
95#define DECLARE_TRACE(name, proto, args)
96
c63b7682 97#ifdef TRACEPOINTS_ENABLED
2167ae72 98#include <trace/trace_events.h>
ee53bbd1 99#include <trace/perf.h>
f42c85e7
SR
100#endif
101
5ac35daa 102#undef TRACE_EVENT
6c347d43 103#undef TRACE_EVENT_FN
2701121b 104#undef TRACE_EVENT_FN_COND
287050d3 105#undef TRACE_EVENT_CONDITION
b1dace68 106#undef TRACE_EVENT_MAP
091ad365 107#undef DECLARE_EVENT_CLASS
ff038f5c 108#undef DEFINE_EVENT
f5abaa1b 109#undef DEFINE_EVENT_FN
e5bc9721 110#undef DEFINE_EVENT_PRINT
287050d3 111#undef DEFINE_EVENT_CONDITION
a8d154b0 112#undef TRACE_HEADER_MULTI_READ
2e26ca71 113#undef DECLARE_TRACE
a8d154b0
SR
114
115/* Only undef what we defined in this file */
116#ifdef UNDEF_TRACE_INCLUDE_FILE
c2518c43 117# undef TRACE_INCLUDE_FILE
a8d154b0
SR
118# undef UNDEF_TRACE_INCLUDE_FILE
119#endif
120
c2518c43 121#ifdef UNDEF_TRACE_INCLUDE_PATH
a8d154b0 122# undef TRACE_INCLUDE_PATH
c2518c43 123# undef UNDEF_TRACE_INCLUDE_PATH
a8d154b0
SR
124#endif
125
126/* We may be processing more files */
127#define CREATE_TRACE_POINTS
128
129#endif /* CREATE_TRACE_POINTS */
This page took 0.378796 seconds and 5 git commands to generate.