2 * Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Trace files that want to automate creationg of all tracepoints defined
20 * in their file should include this file. The following are macros that the
21 * trace file may define:
23 * TRACE_SYSTEM defines the system the tracepoint is for
25 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
26 * This macro may be defined to tell define_trace.h what file to include.
27 * Note, leave off the ".h".
29 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
30 * then this macro can define the path to use. Note, the path is relative to
31 * define_trace.h, not the file including it. Full path names for out of tree
32 * modules must be used.
35 #ifdef CREATE_TRACE_POINTS
37 /* Prevent recursion */
38 #undef CREATE_TRACE_POINTS
40 #include <ust/kcompat/stringify.h>
43 #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
47 #define TRACE_EVENT_FN(name, proto, args, tstruct, \
48 assign, print, reg, unreg) \
49 DEFINE_TRACE_FN(name, reg, unreg)
51 #undef DEFINE_TRACE_EVENT
52 #define DEFINE_TRACE_EVENT(template, name, proto, args) \
55 #undef DEFINE_TRACE_EVENT_PRINT
56 #define DEFINE_TRACE_EVENT_PRINT(template, name, proto, args, print) \
60 #define DECLARE_TRACE(name, proto, args) \
64 #undef __TRACE_INCLUDE
66 #ifndef TRACE_INCLUDE_FILE
67 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
68 # define UNDEF_TRACE_INCLUDE_FILE
71 #ifndef TRACE_INCLUDE_PATH
72 # define __TRACE_INCLUDE(system) <trace/events/system.h>
73 # define UNDEF_TRACE_INCLUDE_PATH
75 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
78 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
80 /* Let the trace headers be reread */
81 #define TRACE_HEADER_MULTI_READ
83 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
85 /* Make all open coded DECLARE_TRACE nops */
87 #define DECLARE_TRACE(name, proto, args)
89 #ifndef CONFIG_NO_EVENT_TRACING
90 #include <ust/ust_trace.h>
95 #undef DECLARE_TRACE_EVENT_CLASS
96 #undef DEFINE_TRACE_EVENT
97 #undef DEFINE_TRACE_EVENT_PRINT
98 #undef TRACE_HEADER_MULTI_READ
101 /* Only undef what we defined in this file */
102 #ifdef UNDEF_TRACE_INCLUDE_FILE
103 # undef TRACE_INCLUDE_FILE
104 # undef UNDEF_TRACE_INCLUDE_FILE
107 #ifdef UNDEF_TRACE_INCLUDE_PATH
108 # undef TRACE_INCLUDE_PATH
109 # undef UNDEF_TRACE_INCLUDE_PATH
112 /* We may be processing more files */
113 #define CREATE_TRACE_POINTS
115 #endif /* CREATE_TRACE_POINTS */
This page took 0.038579 seconds and 4 git commands to generate.