6e7dae32c0c7c4c2f455fa27585797228fa172a2
4 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
5 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; only
10 * version 2.1 of the License.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * Trace files that want to automate creationg of all tracepoints defined
24 * in their file should include this file. The following are macros that the
25 * trace file may define:
27 * TRACE_SYSTEM defines the system the tracepoint is for
29 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
30 * This macro may be defined to tell define_trace.h what file to include.
31 * Note, leave off the ".h".
33 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
34 * then this macro can define the path to use. Note, the path is relative to
35 * define_trace.h, not the file including it. Full path names for out of tree
36 * modules must be used.
39 #ifdef CREATE_TRACE_POINTS
41 /* Prevent recursion */
42 #undef CREATE_TRACE_POINTS
44 #include <linux/stringify.h>
46 * module.h includes tracepoints, and because ftrace.h
48 * trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
49 * linux/ftrace.h -> linux/module.h
50 * we must include module.h here before we play with any of
51 * the TRACE_EVENT() macros, otherwise the tracepoints included
52 * by module.h may break the build.
54 #include <linux/module.h>
56 #undef TRACE_EVENT_MAP
57 #define TRACE_EVENT_MAP(name, map, proto, args, tstruct, assign, print)
59 #undef TRACE_EVENT_CONDITION_MAP
60 #define TRACE_EVENT_CONDITION_MAP(name, map, proto, args, cond, tstruct, assign, print) \
68 #undef TRACE_EVENT_FN_MAP
69 #define TRACE_EVENT_FN_MAP(name, map, proto, args, tstruct, \
70 assign, print, reg, unreg)
72 #undef DEFINE_EVENT_MAP
73 #define DEFINE_EVENT_MAP(template, name, map, proto, args)
75 #undef DEFINE_EVENT_PRINT_MAP
76 #define DEFINE_EVENT_PRINT_MAP(template, name, map, proto, args, print)
78 #undef DEFINE_EVENT_CONDITION_MAP
79 #define DEFINE_EVENT_CONDITION_MAP(template, name, map, proto, args, cond) \
80 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
84 #define TRACE_EVENT(name, proto, args, tstruct, assign, print)
86 #undef TRACE_EVENT_CONDITION
87 #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
95 #undef LTTNG_TRACE_EVENT
96 #define LTTNG_TRACE_EVENT(name, proto, args, _locvar, _code, tstruct, assign, print)
99 #define TRACE_EVENT_FN(name, proto, args, tstruct, \
100 assign, print, reg, unreg)
103 #define DEFINE_EVENT(template, name, proto, args)
105 #undef DEFINE_EVENT_PRINT
106 #define DEFINE_EVENT_PRINT(template, name, proto, args, print)
108 #undef DEFINE_EVENT_CONDITION
109 #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \
110 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
113 #define DECLARE_TRACE(name, proto, args)
116 #undef __TRACE_INCLUDE
118 #ifndef TRACE_INCLUDE_FILE
119 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
120 # define UNDEF_TRACE_INCLUDE_FILE
123 #ifndef TRACE_INCLUDE_PATH
124 # define __TRACE_INCLUDE(system) <trace/events/system.h>
125 # define UNDEF_TRACE_INCLUDE_PATH
127 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
130 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
132 /* Let the trace headers be reread */
133 #define TRACE_HEADER_MULTI_READ
135 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
137 /* Make all open coded DECLARE_TRACE nops */
139 #define DECLARE_TRACE(name, proto, args)
141 #ifdef LTTNG_PACKAGE_BUILD
142 #include "lttng-events.h"
146 #undef TRACE_EVENT_FN
147 #undef TRACE_EVENT_CONDITION
149 #undef DEFINE_EVENT_PRINT
150 #undef DEFINE_EVENT_CONDITION
151 #undef TRACE_EVENT_MAP
152 #undef TRACE_EVENT_FN_MAP
153 #undef TRACE_EVENT_CONDITION_MAP
154 #undef DECLARE_EVENT_CLASS
155 #undef DEFINE_EVENT_MAP
156 #undef DEFINE_EVENT_PRINT_MAP
157 #undef DEFINE_EVENT_CONDITION_MAP
158 #undef TRACE_HEADER_MULTI_READ
160 #undef LTTNG_TRACE_EVENT
161 #define LTTNG_TRACE_EVENT(name, proto, args, _locvar, _code, tstruct, assign, print)
163 /* Only undef what we defined in this file */
164 #ifdef UNDEF_TRACE_INCLUDE_FILE
165 # undef TRACE_INCLUDE_FILE
166 # undef UNDEF_TRACE_INCLUDE_FILE
169 #ifdef UNDEF_TRACE_INCLUDE_PATH
170 # undef TRACE_INCLUDE_PATH
171 # undef UNDEF_TRACE_INCLUDE_PATH
174 /* We may be processing more files */
175 #define CREATE_TRACE_POINTS
177 #endif /* CREATE_TRACE_POINTS */
This page took 0.036424 seconds and 4 git commands to generate.