Privatize headers
[ust.git] / include / ust / define_trace.h
1 /*
2 * Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
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.
9 *
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.
14 *
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
18 *
19 *
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:
23 *
24 * TRACE_SYSTEM defines the system the tracepoint is for
25 *
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".
29 *
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.
34 */
35
36 #ifdef TRACEPOINT_CREATE_PROBES
37
38 /* Prevent recursion */
39 #undef TRACEPOINT_CREATE_PROBES
40
41 #include <ust/stringify.h>
42
43 #undef TRACEPOINT_EVENT
44 #define TRACEPOINT_EVENT(name, proto, args, fields) \
45 _DEFINE_TRACEPOINT(name)
46
47 #undef TRACEPOINT_EVENT_INSTANCE
48 #define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
49 _DEFINE_TRACEPOINT(name)
50
51 #undef TRACEPOINT_EVENT_NOARGS
52 #define TRACEPOINT_EVENT_NOARGS(name, fields) \
53 _DEFINE_TRACEPOINT(name)
54
55 #undef TRACEPOINT_EVENT_INSTANCE_NOARGS
56 #define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
57 _DEFINE_TRACEPOINT(name)
58
59 #undef TRACE_INCLUDE
60 #undef __TRACE_INCLUDE
61
62 #ifndef TRACE_INCLUDE_FILE
63 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
64 # define UNDEF_TRACE_INCLUDE_FILE
65 #endif
66
67 #ifndef TRACE_INCLUDE_PATH
68 # define __TRACE_INCLUDE(system) <trace/events/system.h>
69 # define UNDEF_TRACE_INCLUDE_PATH
70 #else
71 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
72 #endif
73
74 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
75
76 /* Let the trace headers be reread */
77 #define TRACE_HEADER_MULTI_READ
78
79 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
80
81 #ifndef CONFIG_NO_EVENT_TRACING
82 #include <ust/ust_trace.h>
83 #endif
84
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
92
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
97 #endif
98
99 #ifdef UNDEF_TRACE_INCLUDE_PATH
100 # undef TRACE_INCLUDE_PATH
101 # undef UNDEF_TRACE_INCLUDE_PATH
102 #endif
103
104 /* We may be processing more files */
105 #define TRACEPOINT_CREATE_PROBES
106
107 #endif /* TRACEPOINT_CREATE_PROBES */
This page took 0.032315 seconds and 4 git commands to generate.