2 * Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation;
8 * version 2.1 of the License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Trace files that want to automate creationg of all tracepoints defined
21 * in their file should include this file. The following are macros that the
22 * trace file may define:
24 * TRACE_SYSTEM defines the system the tracepoint is for
26 * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
27 * This macro may be defined to tell define_trace.h what file to include.
28 * Note, leave off the ".h".
30 * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
31 * then this macro can define the path to use. Note, the path is relative to
32 * define_trace.h, not the file including it. Full path names for out of tree
33 * modules must be used.
36 #ifdef TRACEPOINT_CREATE_PROBES
38 /* Prevent recursion */
39 #undef TRACEPOINT_CREATE_PROBES
41 #include <ust/stringify.h>
43 #undef TRACEPOINT_EVENT
44 #define TRACEPOINT_EVENT(name, proto, args, fields) \
45 _DEFINE_TRACEPOINT(name)
47 #undef TRACEPOINT_EVENT_INSTANCE
48 #define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
49 _DEFINE_TRACEPOINT(name)
51 #undef TRACEPOINT_EVENT_NOARGS
52 #define TRACEPOINT_EVENT_NOARGS(name, fields) \
53 _DEFINE_TRACEPOINT(name)
55 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
56 #define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
57 _DEFINE_TRACEPOINT(name)
60 #undef __TRACE_INCLUDE
62 #ifndef TRACE_INCLUDE_FILE
63 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
64 # define UNDEF_TRACE_INCLUDE_FILE
67 #ifndef TRACE_INCLUDE_PATH
68 # define __TRACE_INCLUDE(system) <trace/events/system.h>
69 # define UNDEF_TRACE_INCLUDE_PATH
71 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
74 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
76 /* Let the trace headers be reread */
77 #define TRACE_HEADER_MULTI_READ
79 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
81 #ifndef CONFIG_NO_EVENT_TRACING
82 #include <ust/ust_trace.h>
85 #undef TRACEPOINT_EVENT
86 #undef TRACEPOINT_EVENT_CLASS
87 #undef TRACEPOINT_EVENT_INSTANCE
88 #undef TRACEPOINT_EVENT_NOARGS
89 #undef TRACEPOINT_EVENT_CLASS_NOARGS
90 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
91 #undef TRACE_HEADER_MULTI_READ
93 /* Only undef what we defined in this file */
94 #ifdef UNDEF_TRACE_INCLUDE_FILE
95 # undef TRACE_INCLUDE_FILE
96 # undef UNDEF_TRACE_INCLUDE_FILE
99 #ifdef UNDEF_TRACE_INCLUDE_PATH
100 # undef TRACE_INCLUDE_PATH
101 # undef UNDEF_TRACE_INCLUDE_PATH
104 /* We may be processing more files */
105 #define TRACEPOINT_CREATE_PROBES
107 #endif /* TRACEPOINT_CREATE_PROBES */
This page took 0.034136 seconds and 4 git commands to generate.