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 #undef LTTNG_TRACEPOINT_EVENT_MAP
47 #define LTTNG_TRACEPOINT_EVENT_MAP(name, map, proto, args, tstruct, assign, print)
49 #undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
50 #define LTTNG_TRACEPOINT_EVENT_MAP_NOARGS(name, map, tstruct, assign, print)
52 #undef LTTNG_TRACEPOINT_EVENT_CONDITION_MAP
53 #define LTTNG_TRACEPOINT_EVENT_CONDITION_MAP(name, map, proto, args, cond, tstruct, assign, print) \
54 LTTNG_TRACEPOINT_EVENT(name, \
61 #undef LTTNG_TRACEPOINT_EVENT_FN_MAP
62 #define LTTNG_TRACEPOINT_EVENT_FN_MAP(name, map, proto, args, tstruct, \
63 assign, print, reg, unreg)
65 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
66 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, map, proto, args)
68 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT_MAP
69 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT_MAP(template, name, map, proto, args, print)
71 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION_MAP
72 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION_MAP(template, name, map, proto, args, cond)
74 #undef LTTNG_TRACEPOINT_EVENT
75 #define LTTNG_TRACEPOINT_EVENT(name, proto, args, tstruct, assign, print)
77 #undef LTTNG_TRACEPOINT_EVENT_CONDITION
78 #define LTTNG_TRACEPOINT_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
79 LTTNG_TRACEPOINT_EVENT(name, \
86 #undef LTTNG_TRACEPOINT_EVENT_CODE
87 #define LTTNG_TRACEPOINT_EVENT_CODE(name, proto, args, _locvar, _code, tstruct, assign, print)
89 #undef LTTNG_TRACEPOINT_EVENT_FN
90 #define LTTNG_TRACEPOINT_EVENT_FN(name, proto, args, tstruct, \
91 assign, print, reg, unreg)
93 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE
94 #define LTTNG_TRACEPOINT_EVENT_INSTANCE(template, name, proto, args)
96 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
97 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name)
99 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
100 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(template, name, map)
102 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT
103 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT(template, name, proto, args, print)
105 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION
106 #define LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION(template, name, proto, args, cond) \
107 LTTNG_TRACEPOINT_EVENT_INSTANCE(template, name, PARAMS(proto), PARAMS(args))
110 #undef __TRACE_INCLUDE
112 #ifndef TRACE_INCLUDE_FILE
113 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
114 # define UNDEF_TRACE_INCLUDE_FILE
117 #ifndef TRACE_INCLUDE_PATH
118 # define __TRACE_INCLUDE(system) <trace/events/system.h>
119 # define UNDEF_TRACE_INCLUDE_PATH
121 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
124 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
126 /* Let the trace headers be reread */
127 #define TRACE_HEADER_MULTI_READ
129 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
131 /* Make all open coded DECLARE_TRACE nops */
133 #define DECLARE_TRACE(name, proto, args)
135 #ifdef LTTNG_PACKAGE_BUILD
136 #include "lttng-events.h"
139 #undef LTTNG_TRACEPOINT_EVENT
140 #undef LTTNG_TRACEPOINT_EVENT_FN
141 #undef LTTNG_TRACEPOINT_EVENT_CONDITION
142 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE
143 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT
144 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION
145 #undef LTTNG_TRACEPOINT_EVENT_MAP
146 #undef LTTNG_TRACEPOINT_EVENT_FN_MAP
147 #undef LTTNG_TRACEPOINT_EVENT_CONDITION_MAP
148 #undef LTTNG_TRACEPOINT_EVENT_CLASS
149 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP
150 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT_MAP
151 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION_MAP
152 #undef LTTNG_TRACEPOINT_EVENT_CODE
153 #undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
154 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
155 #undef LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS
156 #undef TRACE_HEADER_MULTI_READ
158 /* Only undef what we defined in this file */
159 #ifdef UNDEF_TRACE_INCLUDE_FILE
160 # undef TRACE_INCLUDE_FILE
161 # undef UNDEF_TRACE_INCLUDE_FILE
164 #ifdef UNDEF_TRACE_INCLUDE_PATH
165 # undef TRACE_INCLUDE_PATH
166 # undef UNDEF_TRACE_INCLUDE_PATH
170 * We want to re-include lttng-tracepoint-event.h for a following probe.
172 #undef LTTNG_TRACEPOINT_EVENT_H
174 /* We may be processing more files */
175 #define CREATE_TRACE_POINTS
177 #endif /* CREATE_TRACE_POINTS */
This page took 0.033243 seconds and 4 git commands to generate.