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 * tracepoint_event.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 #ifndef __tp_stringify
42 #define __tp_stringify_1(x...) #x
43 #define __tp_stringify(x...) __tp_stringify_1(x)
46 #undef TRACEPOINT_EVENT
47 #define TRACEPOINT_EVENT(name, proto, args, fields) \
48 _DEFINE_TRACEPOINT(name)
50 #undef TRACEPOINT_EVENT_INSTANCE
51 #define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
52 _DEFINE_TRACEPOINT(name)
54 #undef TRACEPOINT_EVENT_NOARGS
55 #define TRACEPOINT_EVENT_NOARGS(name, fields) \
56 _DEFINE_TRACEPOINT(name)
58 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
59 #define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
60 _DEFINE_TRACEPOINT(name)
63 #undef __TRACE_INCLUDE
65 #ifndef TRACE_INCLUDE_FILE
66 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
67 # define UNDEF_TRACE_INCLUDE_FILE
70 #ifndef TRACE_INCLUDE_PATH
71 # define __TRACE_INCLUDE(system) <trace/events/system.h>
72 # define UNDEF_TRACE_INCLUDE_PATH
74 # define __TRACE_INCLUDE(system) __tp_stringify(TRACE_INCLUDE_PATH/system.h)
77 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
79 /* Let the trace headers be reread */
80 #define TRACE_HEADER_MULTI_READ
82 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
84 #ifndef CONFIG_NO_EVENT_TRACING
85 #include <ust/probe.h>
88 #undef TRACEPOINT_EVENT
89 #undef TRACEPOINT_EVENT_CLASS
90 #undef TRACEPOINT_EVENT_INSTANCE
91 #undef TRACEPOINT_EVENT_NOARGS
92 #undef TRACEPOINT_EVENT_CLASS_NOARGS
93 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
94 #undef TRACE_HEADER_MULTI_READ
96 /* Only undef what we defined in this file */
97 #ifdef UNDEF_TRACE_INCLUDE_FILE
98 # undef TRACE_INCLUDE_FILE
99 # undef UNDEF_TRACE_INCLUDE_FILE
102 #ifdef UNDEF_TRACE_INCLUDE_PATH
103 # undef TRACE_INCLUDE_PATH
104 # undef UNDEF_TRACE_INCLUDE_PATH
107 /* We may be processing more files */
108 #define TRACEPOINT_CREATE_PROBES
110 #endif /* TRACEPOINT_CREATE_PROBES */
This page took 0.067681 seconds and 5 git commands to generate.