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>
57 #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
60 #undef TRACE_EVENT_CONDITION
61 #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
70 #define TRACE_EVENT_FN(name, proto, args, tstruct, \
71 assign, print, reg, unreg) \
72 DEFINE_TRACE_FN(name, reg, unreg)
75 #define DEFINE_EVENT(template, name, proto, args) \
78 #undef DEFINE_EVENT_PRINT
79 #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
82 #undef DEFINE_EVENT_CONDITION
83 #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \
84 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
87 #define DECLARE_TRACE(name, proto, args) \
91 #undef __TRACE_INCLUDE
93 #ifndef TRACE_INCLUDE_FILE
94 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
95 # define UNDEF_TRACE_INCLUDE_FILE
98 #ifndef TRACE_INCLUDE_PATH
99 # define __TRACE_INCLUDE(system) <trace/events/system.h>
100 # define UNDEF_TRACE_INCLUDE_PATH
102 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
105 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
107 /* Let the trace headers be reread */
108 #define TRACE_HEADER_MULTI_READ
110 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
112 /* Make all open coded DECLARE_TRACE nops */
114 #define DECLARE_TRACE(name, proto, args)
116 #ifdef LTTNG_PACKAGE_BUILD
117 #include "lttng-events.h"
121 #undef TRACE_EVENT_FN
122 #undef TRACE_EVENT_CONDITION
123 #undef DECLARE_EVENT_CLASS
125 #undef DEFINE_EVENT_PRINT
126 #undef DEFINE_EVENT_CONDITION
127 #undef TRACE_HEADER_MULTI_READ
130 /* Only undef what we defined in this file */
131 #ifdef UNDEF_TRACE_INCLUDE_FILE
132 # undef TRACE_INCLUDE_FILE
133 # undef UNDEF_TRACE_INCLUDE_FILE
136 #ifdef UNDEF_TRACE_INCLUDE_PATH
137 # undef TRACE_INCLUDE_PATH
138 # undef UNDEF_TRACE_INCLUDE_PATH
141 /* We may be processing more files */
142 #define CREATE_TRACE_POINTS
144 #endif /* CREATE_TRACE_POINTS */
This page took 0.031784 seconds and 4 git commands to generate.