4 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
5 * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 * Dual LGPL v2.1/GPL v2 license.
11 * Trace files that want to automate creationg of all tracepoints defined
12 * in their file should include this file. The following are macros that the
13 * trace file may define:
15 * TRACE_SYSTEM defines the system the tracepoint is for
17 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
18 * This macro may be defined to tell define_trace.h what file to include.
19 * Note, leave off the ".h".
21 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
22 * then this macro can define the path to use. Note, the path is relative to
23 * define_trace.h, not the file including it. Full path names for out of tree
24 * modules must be used.
27 #ifdef CREATE_TRACE_POINTS
29 /* Prevent recursion */
30 #undef CREATE_TRACE_POINTS
32 #include <linux/stringify.h>
34 * module.h includes tracepoints, and because ftrace.h
36 * trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
37 * linux/ftrace.h -> linux/module.h
38 * we must include module.h here before we play with any of
39 * the TRACE_EVENT() macros, otherwise the tracepoints included
40 * by module.h may break the build.
42 #include <linux/module.h>
45 #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
48 #undef TRACE_EVENT_CONDITION
49 #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
58 #define TRACE_EVENT_FN(name, proto, args, tstruct, \
59 assign, print, reg, unreg) \
60 DEFINE_TRACE_FN(name, reg, unreg)
63 #define DEFINE_EVENT(template, name, proto, args) \
66 #undef DEFINE_EVENT_PRINT
67 #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
70 #undef DEFINE_EVENT_CONDITION
71 #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \
72 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
75 #define DECLARE_TRACE(name, proto, args) \
79 #undef __TRACE_INCLUDE
81 #ifndef TRACE_INCLUDE_FILE
82 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
83 # define UNDEF_TRACE_INCLUDE_FILE
86 #ifndef TRACE_INCLUDE_PATH
87 # define __TRACE_INCLUDE(system) <trace/events/system.h>
88 # define UNDEF_TRACE_INCLUDE_PATH
90 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
93 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
95 /* Let the trace headers be reread */
96 #define TRACE_HEADER_MULTI_READ
98 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
100 /* Make all open coded DECLARE_TRACE nops */
102 #define DECLARE_TRACE(name, proto, args)
104 #ifdef LTTNG_PACKAGE_BUILD
105 #include "lttng-events.h"
109 #undef TRACE_EVENT_FN
110 #undef TRACE_EVENT_CONDITION
111 #undef DECLARE_EVENT_CLASS
113 #undef DEFINE_EVENT_PRINT
114 #undef DEFINE_EVENT_CONDITION
115 #undef TRACE_HEADER_MULTI_READ
118 /* Only undef what we defined in this file */
119 #ifdef UNDEF_TRACE_INCLUDE_FILE
120 # undef TRACE_INCLUDE_FILE
121 # undef UNDEF_TRACE_INCLUDE_FILE
124 #ifdef UNDEF_TRACE_INCLUDE_PATH
125 # undef TRACE_INCLUDE_PATH
126 # undef UNDEF_TRACE_INCLUDE_PATH
129 /* We may be processing more files */
130 #define CREATE_TRACE_POINTS
132 #endif /* CREATE_TRACE_POINTS */
This page took 0.031608 seconds and 4 git commands to generate.