Commit | Line | Data |
---|---|---|
22d72948 NC |
1 | /* |
2 | * Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com> | |
9edd34bd | 3 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
22d72948 NC |
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 | |
f37142a4 MD |
7 | * License as published by the Free Software Foundation; |
8 | * version 2.1 of the License. | |
22d72948 NC |
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 | ||
8d71973c | 36 | #ifdef TRACEPOINT_CREATE_PROBES |
22d72948 NC |
37 | |
38 | /* Prevent recursion */ | |
8d71973c | 39 | #undef TRACEPOINT_CREATE_PROBES |
22d72948 | 40 | |
9edd34bd | 41 | #include <ust/stringify.h> |
22d72948 | 42 | |
8d71973c | 43 | #undef TRACEPOINT_EVENT |
81614639 MD |
44 | #define TRACEPOINT_EVENT(name, proto, args, fields) \ |
45 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 46 | |
81614639 MD |
47 | #undef TRACEPOINT_EVENT_INSTANCE |
48 | #define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \ | |
49 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 50 | |
81614639 MD |
51 | #undef TRACEPOINT_EVENT_NOARGS |
52 | #define TRACEPOINT_EVENT_NOARGS(name, fields) \ | |
53 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 54 | |
81614639 MD |
55 | #undef TRACEPOINT_EVENT_INSTANCE_NOARGS |
56 | #define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \ | |
57 | _DEFINE_TRACEPOINT(name) | |
22d72948 NC |
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 | ||
22d72948 NC |
81 | #ifndef CONFIG_NO_EVENT_TRACING |
82 | #include <ust/ust_trace.h> | |
83 | #endif | |
84 | ||
8d71973c | 85 | #undef TRACEPOINT_EVENT |
81614639 MD |
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 | |
22d72948 | 91 | #undef TRACE_HEADER_MULTI_READ |
22d72948 NC |
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 */ | |
8d71973c | 105 | #define TRACEPOINT_CREATE_PROBES |
22d72948 | 106 | |
8d71973c | 107 | #endif /* TRACEPOINT_CREATE_PROBES */ |