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 | * | |
8d8a24c8 MD |
24 | * TRACEPOINT_SYSTEM defines the system the tracepoint is for: |
25 | * < [com_company_]project_[component_] > | |
22d72948 | 26 | * |
8d8a24c8 MD |
27 | * TRACEPOINT_INCLUDE_FILE if the file name is something other than |
28 | * TRACEPOINT_SYSTEM.h. This macro may be defined to tell | |
29 | * define_trace.h what file to include. Note, leave off the ".h". | |
22d72948 | 30 | * |
8d8a24c8 MD |
31 | * TRACEPOINT_INCLUDE_PATH if the path is something other than core |
32 | * kernel include/trace then this macro can define the path to use. | |
33 | * Note, the path is relative to tracepoint_event.h, not the file | |
34 | * including it. Full path names for out of tree modules must be | |
35 | * used. | |
22d72948 NC |
36 | */ |
37 | ||
8d71973c | 38 | #ifdef TRACEPOINT_CREATE_PROBES |
22d72948 NC |
39 | |
40 | /* Prevent recursion */ | |
8d71973c | 41 | #undef TRACEPOINT_CREATE_PROBES |
22d72948 | 42 | |
3c82ede9 MD |
43 | #ifndef __tp_stringify |
44 | #define __tp_stringify_1(x...) #x | |
45 | #define __tp_stringify(x...) __tp_stringify_1(x) | |
46 | #endif | |
22d72948 | 47 | |
8d71973c | 48 | #undef TRACEPOINT_EVENT |
81614639 MD |
49 | #define TRACEPOINT_EVENT(name, proto, args, fields) \ |
50 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 51 | |
81614639 MD |
52 | #undef TRACEPOINT_EVENT_INSTANCE |
53 | #define TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \ | |
54 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 55 | |
81614639 MD |
56 | #undef TRACEPOINT_EVENT_NOARGS |
57 | #define TRACEPOINT_EVENT_NOARGS(name, fields) \ | |
58 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 59 | |
81614639 MD |
60 | #undef TRACEPOINT_EVENT_INSTANCE_NOARGS |
61 | #define TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \ | |
62 | _DEFINE_TRACEPOINT(name) | |
22d72948 | 63 | |
8d8a24c8 MD |
64 | #undef TRACEPOINT_INCLUDE |
65 | #undef __TRACEPOINT_INCLUDE | |
22d72948 | 66 | |
8d8a24c8 MD |
67 | #ifndef TRACEPOINT_INCLUDE_FILE |
68 | # define TRACEPOINT_INCLUDE_FILE TRACEPOINT_SYSTEM | |
69 | # define UNDEF_TRACEPOINT_INCLUDE_FILE | |
22d72948 NC |
70 | #endif |
71 | ||
8d8a24c8 MD |
72 | #ifndef TRACEPOINT_INCLUDE_PATH |
73 | # define __TRACEPOINT_INCLUDE(system) <tracepoint/system.h> | |
74 | # define UNDEF_TRACEPOINT_INCLUDE_PATH | |
22d72948 | 75 | #else |
8d8a24c8 MD |
76 | # define __TRACEPOINT_INCLUDE(system) \ |
77 | __tp_stringify(TRACEPOINT_INCLUDE_PATH/system.h) | |
22d72948 NC |
78 | #endif |
79 | ||
8d8a24c8 | 80 | # define TRACEPOINT_INCLUDE(system) __TRACEPOINT_INCLUDE(system) |
22d72948 NC |
81 | |
82 | /* Let the trace headers be reread */ | |
8d8a24c8 | 83 | #define TRACEPOINT_HEADER_MULTI_READ |
22d72948 | 84 | |
8d8a24c8 | 85 | #include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE) |
22d72948 | 86 | |
22d72948 | 87 | #ifndef CONFIG_NO_EVENT_TRACING |
0a42beb6 | 88 | #include <ust/lttng-tracepoint-event.h> |
22d72948 NC |
89 | #endif |
90 | ||
8d71973c | 91 | #undef TRACEPOINT_EVENT |
81614639 MD |
92 | #undef TRACEPOINT_EVENT_CLASS |
93 | #undef TRACEPOINT_EVENT_INSTANCE | |
94 | #undef TRACEPOINT_EVENT_NOARGS | |
95 | #undef TRACEPOINT_EVENT_CLASS_NOARGS | |
96 | #undef TRACEPOINT_EVENT_INSTANCE_NOARGS | |
8d8a24c8 | 97 | #undef TRACEPOINT_HEADER_MULTI_READ |
22d72948 NC |
98 | |
99 | /* Only undef what we defined in this file */ | |
8d8a24c8 MD |
100 | #ifdef UNDEF_TRACEPOINT_INCLUDE_FILE |
101 | # undef TRACEPOINT_INCLUDE_FILE | |
102 | # undef UNDEF_TRACEPOINT_INCLUDE_FILE | |
22d72948 NC |
103 | #endif |
104 | ||
8d8a24c8 MD |
105 | #ifdef UNDEF_TRACEPOINT_INCLUDE_PATH |
106 | # undef TRACEPOINT_INCLUDE_PATH | |
107 | # undef UNDEF_TRACEPOINT_INCLUDE_PATH | |
22d72948 NC |
108 | #endif |
109 | ||
110 | /* We may be processing more files */ | |
8d71973c | 111 | #define TRACEPOINT_CREATE_PROBES |
22d72948 | 112 | |
8d71973c | 113 | #endif /* TRACEPOINT_CREATE_PROBES */ |