blob: e16610c208c954541587684c8af64584b01dbfda [file] [log] [blame]
Steven Rostedtf42c85e2009-04-13 12:25:37 -04001/*
2 * Stage 1 of the trace events.
3 *
4 * Override the macros in <trace/trace_events.h> to include the following:
5 *
6 * struct ftrace_raw_<call> {
7 * struct trace_entry ent;
8 * <type> <item>;
9 * <type2> <item2>[<len>];
10 * [...]
11 * };
12 *
13 * The <type> <item> is created by the __field(type, item) macro or
14 * the __array(type2, item2, len) macro.
15 * We simply do "type item;", and that will create the fields
16 * in the structure.
17 */
18
19#include <linux/ftrace_event.h>
20
Steven Rostedtff038f52009-11-18 20:27:27 -050021/*
Ingo Molnar091ad362009-11-26 09:04:55 +010022 * DECLARE_EVENT_CLASS can be used to add a generic function
Steven Rostedtff038f52009-11-18 20:27:27 -050023 * handlers for events. That is, if all events have the same
24 * parameters and just have distinct trace points.
25 * Each tracepoint can be defined with DEFINE_EVENT and that
Ingo Molnar091ad362009-11-26 09:04:55 +010026 * will map the DECLARE_EVENT_CLASS to the tracepoint.
Steven Rostedtff038f52009-11-18 20:27:27 -050027 *
28 * TRACE_EVENT is a one to one mapping between tracepoint and template.
29 */
30#undef TRACE_EVENT
31#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
Ingo Molnar091ad362009-11-26 09:04:55 +010032 DECLARE_EVENT_CLASS(name, \
Steven Rostedtff038f52009-11-18 20:27:27 -050033 PARAMS(proto), \
34 PARAMS(args), \
35 PARAMS(tstruct), \
36 PARAMS(assign), \
37 PARAMS(print)); \
38 DEFINE_EVENT(name, name, PARAMS(proto), PARAMS(args));
39
40
Steven Rostedtf42c85e2009-04-13 12:25:37 -040041#undef __field
42#define __field(type, item) type item;
43
Li Zefan43b51ea2009-08-07 10:33:22 +080044#undef __field_ext
45#define __field_ext(type, item, filter_type) type item;
46
Li Zefan7fcb7c42009-06-01 15:35:46 +080047#undef __array
48#define __array(type, item, len) type item[len];
49
50#undef __dynamic_array
Li Zefan7d536cb2009-07-16 10:54:02 +080051#define __dynamic_array(type, item, len) u32 __data_loc_##item;
Li Zefan7fcb7c42009-06-01 15:35:46 +080052
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020053#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +080054#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020055
Steven Rostedtf42c85e2009-04-13 12:25:37 -040056#undef TP_STRUCT__entry
57#define TP_STRUCT__entry(args...) args
58
Ingo Molnar091ad362009-11-26 09:04:55 +010059#undef DECLARE_EVENT_CLASS
60#define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \
Steven Rostedtff038f52009-11-18 20:27:27 -050061 struct ftrace_raw_##name { \
62 struct trace_entry ent; \
63 tstruct \
64 char __data[0]; \
Steven Rostedt8f082012010-04-20 10:47:33 -040065 }; \
66 \
67 static struct ftrace_event_class event_class_##name;
68
Steven Rostedtff038f52009-11-18 20:27:27 -050069#undef DEFINE_EVENT
70#define DEFINE_EVENT(template, name, proto, args) \
Steven Rostedt49c17742010-05-25 06:19:35 -070071 static struct ftrace_event_call __used \
Jeff Mahoney86c38a32010-02-24 13:59:23 -050072 __attribute__((__aligned__(4))) event_##name
Steven Rostedtf42c85e2009-04-13 12:25:37 -040073
Steven Rostedte5bc9722009-11-18 20:36:26 -050074#undef DEFINE_EVENT_PRINT
75#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
76 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
77
Josh Stone97419872009-08-24 14:43:13 -070078/* Callbacks are meaningless to ftrace. */
79#undef TRACE_EVENT_FN
Frederic Weisbecker0dd7b742009-08-28 00:50:06 +020080#define TRACE_EVENT_FN(name, proto, args, tstruct, \
81 assign, print, reg, unreg) \
Frederic Weisbecker819ce452010-07-20 18:41:24 +020082 TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \
83 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \
Josh Stone97419872009-08-24 14:43:13 -070084
Frederic Weisbecker1ed0c592010-11-18 01:46:57 +010085#undef TRACE_EVENT_FLAGS
86#define TRACE_EVENT_FLAGS(name, value) \
Frederic Weisbecker53cf810b2010-11-18 02:11:42 +010087 __TRACE_EVENT_FLAGS(name, value)
Frederic Weisbecker1ed0c592010-11-18 01:46:57 +010088
Steven Rostedtf42c85e2009-04-13 12:25:37 -040089#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
90
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020091
Steven Rostedtf42c85e2009-04-13 12:25:37 -040092/*
93 * Stage 2 of the trace events.
94 *
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020095 * Include the following:
96 *
Li Zefan7fcb7c42009-06-01 15:35:46 +080097 * struct ftrace_data_offsets_<call> {
Li Zefan7d536cb2009-07-16 10:54:02 +080098 * u32 <item1>;
99 * u32 <item2>;
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200100 * [...]
101 * };
102 *
Li Zefan7d536cb2009-07-16 10:54:02 +0800103 * The __dynamic_array() macro will create each u32 <item>, this is
Li Zefan7fcb7c42009-06-01 15:35:46 +0800104 * to keep the offset of each array from the beginning of the event.
Li Zefan7d536cb2009-07-16 10:54:02 +0800105 * The size of an array is also encoded, in the higher 16 bits of <item>.
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200106 */
107
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200108#undef __field
Li Zefan43b51ea2009-08-07 10:33:22 +0800109#define __field(type, item)
110
111#undef __field_ext
112#define __field_ext(type, item, filter_type)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200113
Li Zefan7fcb7c42009-06-01 15:35:46 +0800114#undef __array
115#define __array(type, item, len)
116
117#undef __dynamic_array
Li Zefan7d536cb2009-07-16 10:54:02 +0800118#define __dynamic_array(type, item, len) u32 item;
Li Zefan7fcb7c42009-06-01 15:35:46 +0800119
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200120#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800121#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200122
Ingo Molnar091ad362009-11-26 09:04:55 +0100123#undef DECLARE_EVENT_CLASS
124#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800125 struct ftrace_data_offsets_##call { \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200126 tstruct; \
127 };
128
Steven Rostedtff038f52009-11-18 20:27:27 -0500129#undef DEFINE_EVENT
130#define DEFINE_EVENT(template, name, proto, args)
131
Steven Rostedte5bc9722009-11-18 20:36:26 -0500132#undef DEFINE_EVENT_PRINT
133#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
134 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
135
Frederic Weisbecker1ed0c592010-11-18 01:46:57 +0100136#undef TRACE_EVENT_FLAGS
137#define TRACE_EVENT_FLAGS(event, flag)
138
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200139#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
140
141/*
142 * Stage 3 of the trace events.
143 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400144 * Override the macros in <trace/trace_events.h> to include the following:
145 *
146 * enum print_line_t
147 * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
148 * {
149 * struct trace_seq *s = &iter->seq;
150 * struct ftrace_raw_<call> *field; <-- defined in stage 1
151 * struct trace_entry *entry;
Lai Jiangshanbc289ae2010-06-03 18:26:24 +0800152 * struct trace_seq *p = &iter->tmp_seq;
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400153 * int ret;
154 *
155 * entry = iter->ent;
156 *
Steven Rostedt32c0eda2010-04-23 10:38:03 -0400157 * if (entry->type != event_<call>->event.type) {
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400158 * WARN_ON_ONCE(1);
159 * return TRACE_TYPE_UNHANDLED;
160 * }
161 *
162 * field = (typeof(field))entry;
163 *
Steven Whitehouse56d8bd32009-06-03 14:52:03 +0100164 * trace_seq_init(p);
Li Zefan50354a82010-03-24 10:58:24 +0800165 * ret = trace_seq_printf(s, "%s: ", <call>);
166 * if (ret)
167 * ret = trace_seq_printf(s, <TP_printk> "\n");
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400168 * if (!ret)
169 * return TRACE_TYPE_PARTIAL_LINE;
170 *
171 * return TRACE_TYPE_HANDLED;
172 * }
173 *
174 * This is the method used to print the raw event to the trace
175 * output format. Note, this is not needed if the data is read
176 * in binary.
177 */
178
179#undef __entry
180#define __entry field
181
182#undef TP_printk
183#define TP_printk(fmt, args...) fmt "\n", args
184
Li Zefan7fcb7c42009-06-01 15:35:46 +0800185#undef __get_dynamic_array
186#define __get_dynamic_array(field) \
Li Zefan7d536cb2009-07-16 10:54:02 +0800187 ((void *)__entry + (__entry->__data_loc_##field & 0xffff))
Li Zefan7fcb7c42009-06-01 15:35:46 +0800188
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200189#undef __get_str
Li Zefan7fcb7c42009-06-01 15:35:46 +0800190#define __get_str(field) (char *)__get_dynamic_array(field)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200191
Steven Rostedtbe74b732009-05-26 20:25:22 +0200192#undef __print_flags
193#define __print_flags(flag, delim, flag_array...) \
194 ({ \
Steven Rostedta48f4942009-09-14 11:18:02 -0400195 static const struct trace_print_flags __flags[] = \
Steven Rostedtbe74b732009-05-26 20:25:22 +0200196 { flag_array, { -1, NULL }}; \
Steven Rostedta48f4942009-09-14 11:18:02 -0400197 ftrace_print_flags_seq(p, delim, flag, __flags); \
Steven Rostedtbe74b732009-05-26 20:25:22 +0200198 })
199
Steven Rostedt0f4fc292009-05-20 19:21:47 -0400200#undef __print_symbolic
201#define __print_symbolic(value, symbol_array...) \
202 ({ \
203 static const struct trace_print_flags symbols[] = \
204 { symbol_array, { -1, NULL }}; \
205 ftrace_print_symbols_seq(p, value, symbols); \
206 })
207
Kei Tokunaga5a2e3992010-04-01 20:40:58 +0900208#undef __print_hex
209#define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len)
210
Ingo Molnar091ad362009-11-26 09:04:55 +0100211#undef DECLARE_EVENT_CLASS
212#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
Steven Rostedt83f0d532010-02-16 10:38:47 -0500213static notrace enum print_line_t \
Steven Rostedt80decc72010-04-23 10:00:22 -0400214ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
215 struct trace_event *trace_event) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400216{ \
Steven Rostedt80decc72010-04-23 10:00:22 -0400217 struct ftrace_event_call *event; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400218 struct trace_seq *s = &iter->seq; \
219 struct ftrace_raw_##call *field; \
220 struct trace_entry *entry; \
Lai Jiangshanbc289ae2010-06-03 18:26:24 +0800221 struct trace_seq *p = &iter->tmp_seq; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400222 int ret; \
223 \
Steven Rostedt80decc72010-04-23 10:00:22 -0400224 event = container_of(trace_event, struct ftrace_event_call, \
225 event); \
226 \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400227 entry = iter->ent; \
228 \
Steven Rostedt32c0eda2010-04-23 10:38:03 -0400229 if (entry->type != event->event.type) { \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400230 WARN_ON_ONCE(1); \
231 return TRACE_TYPE_UNHANDLED; \
232 } \
233 \
234 field = (typeof(field))entry; \
235 \
Steven Whitehouse56d8bd32009-06-03 14:52:03 +0100236 trace_seq_init(p); \
Steven Rostedt80decc72010-04-23 10:00:22 -0400237 ret = trace_seq_printf(s, "%s: ", event->name); \
Steven Rostedtff038f52009-11-18 20:27:27 -0500238 if (ret) \
239 ret = trace_seq_printf(s, print); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400240 if (!ret) \
241 return TRACE_TYPE_PARTIAL_LINE; \
242 \
243 return TRACE_TYPE_HANDLED; \
Steven Rostedt80decc72010-04-23 10:00:22 -0400244} \
245static struct trace_event_functions ftrace_event_type_funcs_##call = { \
246 .trace = ftrace_raw_output_##call, \
247};
Steven Rostedtff038f52009-11-18 20:27:27 -0500248
Steven Rostedte5bc9722009-11-18 20:36:26 -0500249#undef DEFINE_EVENT_PRINT
250#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
Steven Rostedt83f0d532010-02-16 10:38:47 -0500251static notrace enum print_line_t \
Steven Rostedta9a57762010-04-22 18:46:14 -0400252ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
253 struct trace_event *event) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400254{ \
255 struct trace_seq *s = &iter->seq; \
Steven Rostedte5bc9722009-11-18 20:36:26 -0500256 struct ftrace_raw_##template *field; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400257 struct trace_entry *entry; \
Lai Jiangshanbc289ae2010-06-03 18:26:24 +0800258 struct trace_seq *p = &iter->tmp_seq; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400259 int ret; \
260 \
261 entry = iter->ent; \
262 \
Steven Rostedt32c0eda2010-04-23 10:38:03 -0400263 if (entry->type != event_##call.event.type) { \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400264 WARN_ON_ONCE(1); \
265 return TRACE_TYPE_UNHANDLED; \
266 } \
267 \
268 field = (typeof(field))entry; \
269 \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400270 trace_seq_init(p); \
Steven Rostedte5bc9722009-11-18 20:36:26 -0500271 ret = trace_seq_printf(s, "%s: ", #call); \
272 if (ret) \
273 ret = trace_seq_printf(s, print); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400274 if (!ret) \
275 return TRACE_TYPE_PARTIAL_LINE; \
276 \
277 return TRACE_TYPE_HANDLED; \
Steven Rostedt80decc72010-04-23 10:00:22 -0400278} \
279static struct trace_event_functions ftrace_event_type_funcs_##call = { \
280 .trace = ftrace_raw_output_##call, \
281};
Steven Rostedte5bc9722009-11-18 20:36:26 -0500282
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400283#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
284
Li Zefan43b51ea2009-08-07 10:33:22 +0800285#undef __field_ext
286#define __field_ext(type, item, filter_type) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400287 ret = trace_define_field(event_call, #type, #item, \
288 offsetof(typeof(field), item), \
Li Zefan43b51ea2009-08-07 10:33:22 +0800289 sizeof(field.item), \
290 is_signed_type(type), filter_type); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400291 if (ret) \
292 return ret;
293
Li Zefan43b51ea2009-08-07 10:33:22 +0800294#undef __field
295#define __field(type, item) __field_ext(type, item, FILTER_OTHER)
296
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400297#undef __array
298#define __array(type, item, len) \
Steven Rostedt04295782010-11-12 22:32:11 -0500299 do { \
300 mutex_lock(&event_storage_mutex); \
301 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
302 snprintf(event_storage, sizeof(event_storage), \
303 "%s[%d]", #type, len); \
304 ret = trace_define_field(event_call, event_storage, #item, \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400305 offsetof(typeof(field), item), \
Lai Jiangshanfb7ae982009-12-15 15:39:38 +0800306 sizeof(field.item), \
307 is_signed_type(type), FILTER_OTHER); \
Steven Rostedt04295782010-11-12 22:32:11 -0500308 mutex_unlock(&event_storage_mutex); \
309 if (ret) \
310 return ret; \
311 } while (0);
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400312
Li Zefan7fcb7c42009-06-01 15:35:46 +0800313#undef __dynamic_array
314#define __dynamic_array(type, item, len) \
Lai Jiangshan68fd60a2009-07-16 10:53:34 +0800315 ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \
Li Zefan43b51ea2009-08-07 10:33:22 +0800316 offsetof(typeof(field), __data_loc_##item), \
Lai Jiangshanfb7ae982009-12-15 15:39:38 +0800317 sizeof(field.__data_loc_##item), \
318 is_signed_type(type), FILTER_OTHER);
Li Zefan7fcb7c42009-06-01 15:35:46 +0800319
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200320#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800321#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200322
Ingo Molnar091ad362009-11-26 09:04:55 +0100323#undef DECLARE_EVENT_CLASS
324#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
Steven Rostedt83f0d532010-02-16 10:38:47 -0500325static int notrace \
Li Zefan14be96c2009-08-19 15:53:52 +0800326ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400327{ \
328 struct ftrace_raw_##call field; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400329 int ret; \
330 \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400331 tstruct; \
332 \
333 return ret; \
334}
335
Steven Rostedtff038f52009-11-18 20:27:27 -0500336#undef DEFINE_EVENT
337#define DEFINE_EVENT(template, name, proto, args)
338
Steven Rostedte5bc9722009-11-18 20:36:26 -0500339#undef DEFINE_EVENT_PRINT
340#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
341 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
342
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400343#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
344
345/*
Li Zefan7fcb7c42009-06-01 15:35:46 +0800346 * remember the offset of each array from the beginning of the event.
347 */
348
349#undef __entry
350#define __entry entry
351
352#undef __field
353#define __field(type, item)
354
Li Zefan43b51ea2009-08-07 10:33:22 +0800355#undef __field_ext
356#define __field_ext(type, item, filter_type)
357
Li Zefan7fcb7c42009-06-01 15:35:46 +0800358#undef __array
359#define __array(type, item, len)
360
361#undef __dynamic_array
362#define __dynamic_array(type, item, len) \
363 __data_offsets->item = __data_size + \
364 offsetof(typeof(*entry), __data); \
Li Zefan7d536cb2009-07-16 10:54:02 +0800365 __data_offsets->item |= (len * sizeof(type)) << 16; \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800366 __data_size += (len) * sizeof(type);
367
368#undef __string
Steven Rostedtff038f52009-11-18 20:27:27 -0500369#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1)
Li Zefan7fcb7c42009-06-01 15:35:46 +0800370
Ingo Molnar091ad362009-11-26 09:04:55 +0100371#undef DECLARE_EVENT_CLASS
372#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
Steven Rostedt83f0d532010-02-16 10:38:47 -0500373static inline notrace int ftrace_get_offsets_##call( \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800374 struct ftrace_data_offsets_##call *__data_offsets, proto) \
375{ \
376 int __data_size = 0; \
377 struct ftrace_raw_##call __maybe_unused *entry; \
378 \
379 tstruct; \
380 \
381 return __data_size; \
382}
383
Steven Rostedtff038f52009-11-18 20:27:27 -0500384#undef DEFINE_EVENT
385#define DEFINE_EVENT(template, name, proto, args)
386
Steven Rostedte5bc9722009-11-18 20:36:26 -0500387#undef DEFINE_EVENT_PRINT
388#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
389 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
390
Li Zefan7fcb7c42009-06-01 15:35:46 +0800391#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
392
393/*
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200394 * Stage 4 of the trace events.
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400395 *
396 * Override the macros in <trace/trace_events.h> to include the following:
397 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400398 * For those macros defined with TRACE_EVENT:
399 *
400 * static struct ftrace_event_call event_<call>;
401 *
Steven Rostedt22392912010-04-21 12:27:06 -0400402 * static void ftrace_raw_event_<call>(void *__data, proto)
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400403 * {
Steven Rostedt22392912010-04-21 12:27:06 -0400404 * struct ftrace_event_call *event_call = __data;
Li Zefan50354a82010-03-24 10:58:24 +0800405 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400406 * struct ring_buffer_event *event;
407 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
Steven Rostedte77405a2009-09-02 14:17:06 -0400408 * struct ring_buffer *buffer;
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400409 * unsigned long irq_flags;
Li Zefan50354a82010-03-24 10:58:24 +0800410 * int __data_size;
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400411 * int pc;
412 *
413 * local_save_flags(irq_flags);
414 * pc = preempt_count();
415 *
Li Zefan50354a82010-03-24 10:58:24 +0800416 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
417 *
Steven Rostedte77405a2009-09-02 14:17:06 -0400418 * event = trace_current_buffer_lock_reserve(&buffer,
Steven Rostedt32c0eda2010-04-23 10:38:03 -0400419 * event_<call>->event.type,
Li Zefan50354a82010-03-24 10:58:24 +0800420 * sizeof(*entry) + __data_size,
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400421 * irq_flags, pc);
422 * if (!event)
423 * return;
424 * entry = ring_buffer_event_data(event);
425 *
Li Zefan50354a82010-03-24 10:58:24 +0800426 * { <assign>; } <-- Here we assign the entries by the __field and
427 * __array macros.
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400428 *
Li Zefan50354a82010-03-24 10:58:24 +0800429 * if (!filter_current_check_discard(buffer, event_call, entry, event))
430 * trace_current_buffer_unlock_commit(buffer,
431 * event, irq_flags, pc);
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400432 * }
433 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400434 * static struct trace_event ftrace_event_type_<call> = {
435 * .trace = ftrace_raw_output_<call>, <-- stage 2
436 * };
437 *
Li Zefan50354a82010-03-24 10:58:24 +0800438 * static const char print_fmt_<call>[] = <TP_printk>;
439 *
Steven Rostedt8f082012010-04-20 10:47:33 -0400440 * static struct ftrace_event_class __used event_class_<template> = {
441 * .system = "<system>",
Steven Rostedt2e33af02010-04-22 10:35:55 -0400442 * .define_fields = ftrace_define_fields_<call>,
Steven Rostedt0405ab82010-04-22 11:46:44 -0400443 * .fields = LIST_HEAD_INIT(event_class_##call.fields),
444 * .raw_init = trace_event_raw_init,
445 * .probe = ftrace_raw_event_##call,
Steven Rostedta1d0ce82010-06-08 11:22:06 -0400446 * .reg = ftrace_event_reg,
Steven Rostedt8f082012010-04-20 10:47:33 -0400447 * };
448 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400449 * static struct ftrace_event_call __used
450 * __attribute__((__aligned__(4)))
451 * __attribute__((section("_ftrace_events"))) event_<call> = {
452 * .name = "<call>",
Steven Rostedt8f082012010-04-20 10:47:33 -0400453 * .class = event_class_<template>,
Steven Rostedt2e33af02010-04-22 10:35:55 -0400454 * .event = &ftrace_event_type_<call>,
Li Zefan50354a82010-03-24 10:58:24 +0800455 * .print_fmt = print_fmt_<call>,
Steven Rostedt8f082012010-04-20 10:47:33 -0400456 * };
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400457 *
458 */
459
Li Zefan07b139c2009-12-21 14:27:35 +0800460#ifdef CONFIG_PERF_EVENTS
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400461
Steven Rostedt22392912010-04-21 12:27:06 -0400462#define _TRACE_PERF_PROTO(call, proto) \
463 static notrace void \
464 perf_trace_##call(void *__data, proto);
465
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100466#define _TRACE_PERF_INIT(call) \
Steven Rostedt22392912010-04-21 12:27:06 -0400467 .perf_probe = perf_trace_##call,
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400468
469#else
Steven Rostedt22392912010-04-21 12:27:06 -0400470#define _TRACE_PERF_PROTO(call, proto)
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100471#define _TRACE_PERF_INIT(call)
Li Zefan07b139c2009-12-21 14:27:35 +0800472#endif /* CONFIG_PERF_EVENTS */
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400473
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400474#undef __entry
475#define __entry entry
476
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200477#undef __field
478#define __field(type, item)
479
480#undef __array
481#define __array(type, item, len)
482
Li Zefan7fcb7c42009-06-01 15:35:46 +0800483#undef __dynamic_array
484#define __dynamic_array(type, item, len) \
485 __entry->__data_loc_##item = __data_offsets.item;
486
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200487#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800488#define __string(item, src) __dynamic_array(char, item, -1) \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200489
490#undef __assign_str
491#define __assign_str(dst, src) \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200492 strcpy(__get_str(dst), src);
493
Lai Jiangshan0fa0eda2009-12-15 15:39:57 +0800494#undef TP_fast_assign
495#define TP_fast_assign(args...) args
496
497#undef TP_perf_assign
498#define TP_perf_assign(args...)
499
Ingo Molnar091ad362009-11-26 09:04:55 +0100500#undef DECLARE_EVENT_CLASS
501#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400502 \
Steven Rostedt83f0d532010-02-16 10:38:47 -0500503static notrace void \
Steven Rostedt22392912010-04-21 12:27:06 -0400504ftrace_raw_event_##call(void *__data, proto) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400505{ \
Steven Rostedt22392912010-04-21 12:27:06 -0400506 struct ftrace_event_call *event_call = __data; \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800507 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400508 struct ring_buffer_event *event; \
509 struct ftrace_raw_##call *entry; \
Steven Rostedte77405a2009-09-02 14:17:06 -0400510 struct ring_buffer *buffer; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400511 unsigned long irq_flags; \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800512 int __data_size; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400513 int pc; \
514 \
515 local_save_flags(irq_flags); \
516 pc = preempt_count(); \
517 \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800518 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200519 \
Steven Rostedte77405a2009-09-02 14:17:06 -0400520 event = trace_current_buffer_lock_reserve(&buffer, \
Steven Rostedt32c0eda2010-04-23 10:38:03 -0400521 event_call->event.type, \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800522 sizeof(*entry) + __data_size, \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200523 irq_flags, pc); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400524 if (!event) \
525 return; \
526 entry = ring_buffer_event_data(event); \
527 \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800528 tstruct \
529 \
Li Zefana9c1c3a2009-06-01 15:35:13 +0800530 { assign; } \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400531 \
Steven Rostedte77405a2009-09-02 14:17:06 -0400532 if (!filter_current_check_discard(buffer, event_call, entry, event)) \
533 trace_nowake_buffer_unlock_commit(buffer, \
534 event, irq_flags, pc); \
Steven Rostedtff038f52009-11-18 20:27:27 -0500535}
Steven Rostedt22392912010-04-21 12:27:06 -0400536/*
537 * The ftrace_test_probe is compiled out, it is only here as a build time check
538 * to make sure that if the tracepoint handling changes, the ftrace probe will
539 * fail to compile unless it too is updated.
540 */
Steven Rostedtff038f52009-11-18 20:27:27 -0500541
542#undef DEFINE_EVENT
543#define DEFINE_EVENT(template, call, proto, args) \
Steven Rostedt22392912010-04-21 12:27:06 -0400544static inline void ftrace_test_probe_##call(void) \
Steven Rostedtff038f52009-11-18 20:27:27 -0500545{ \
Steven Rostedt22392912010-04-21 12:27:06 -0400546 check_trace_callback_type_##call(ftrace_raw_event_##template); \
547}
Steven Rostedte5bc9722009-11-18 20:36:26 -0500548
549#undef DEFINE_EVENT_PRINT
Steven Rostedt80decc72010-04-23 10:00:22 -0400550#define DEFINE_EVENT_PRINT(template, name, proto, args, print)
Steven Rostedte5bc9722009-11-18 20:36:26 -0500551
552#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
553
Lai Jiangshan509e7602009-12-15 15:39:42 +0800554#undef __entry
555#define __entry REC
556
557#undef __print_flags
558#undef __print_symbolic
559#undef __get_dynamic_array
560#undef __get_str
561
562#undef TP_printk
563#define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args)
564
Ingo Molnar091ad362009-11-26 09:04:55 +0100565#undef DECLARE_EVENT_CLASS
Lai Jiangshan509e7602009-12-15 15:39:42 +0800566#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
Steven Rostedt22392912010-04-21 12:27:06 -0400567_TRACE_PERF_PROTO(call, PARAMS(proto)); \
Steven Rostedt8f082012010-04-20 10:47:33 -0400568static const char print_fmt_##call[] = print; \
569static struct ftrace_event_class __used event_class_##call = { \
Steven Rostedt22392912010-04-21 12:27:06 -0400570 .system = __stringify(TRACE_SYSTEM), \
Steven Rostedt2e33af02010-04-22 10:35:55 -0400571 .define_fields = ftrace_define_fields_##call, \
572 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
Steven Rostedt0405ab82010-04-22 11:46:44 -0400573 .raw_init = trace_event_raw_init, \
Steven Rostedt22392912010-04-21 12:27:06 -0400574 .probe = ftrace_raw_event_##call, \
Steven Rostedta1d0ce82010-06-08 11:22:06 -0400575 .reg = ftrace_event_reg, \
Steven Rostedt22392912010-04-21 12:27:06 -0400576 _TRACE_PERF_INIT(call) \
Steven Rostedt8f082012010-04-20 10:47:33 -0400577};
Steven Rostedte5bc9722009-11-18 20:36:26 -0500578
579#undef DEFINE_EVENT
580#define DEFINE_EVENT(template, call, proto, args) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400581 \
582static struct ftrace_event_call __used \
583__attribute__((__aligned__(4))) \
584__attribute__((section("_ftrace_events"))) event_##call = { \
585 .name = #call, \
Steven Rostedt8f082012010-04-20 10:47:33 -0400586 .class = &event_class_##template, \
Steven Rostedt80decc72010-04-23 10:00:22 -0400587 .event.funcs = &ftrace_event_type_funcs_##template, \
Lai Jiangshan509e7602009-12-15 15:39:42 +0800588 .print_fmt = print_fmt_##template, \
Steven Rostedt8f082012010-04-20 10:47:33 -0400589};
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400590
Steven Rostedte5bc9722009-11-18 20:36:26 -0500591#undef DEFINE_EVENT_PRINT
592#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400593 \
Lai Jiangshan509e7602009-12-15 15:39:42 +0800594static const char print_fmt_##call[] = print; \
595 \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400596static struct ftrace_event_call __used \
597__attribute__((__aligned__(4))) \
598__attribute__((section("_ftrace_events"))) event_##call = { \
599 .name = #call, \
Steven Rostedt8f082012010-04-20 10:47:33 -0400600 .class = &event_class_##template, \
Steven Rostedt80decc72010-04-23 10:00:22 -0400601 .event.funcs = &ftrace_event_type_funcs_##call, \
Lai Jiangshan509e7602009-12-15 15:39:42 +0800602 .print_fmt = print_fmt_##call, \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400603}
604
605#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
606
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200607/*
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100608 * Define the insertion callback to perf events
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200609 *
610 * The job is very similar to ftrace_raw_event_<call> except that we don't
611 * insert in the ring buffer but in a perf counter.
612 *
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100613 * static void ftrace_perf_<call>(proto)
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200614 * {
615 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
616 * struct ftrace_event_call *event_call = &event_<call>;
Ingo Molnarcdd6c482009-09-21 12:02:48 +0200617 * extern void perf_tp_event(int, u64, u64, void *, int);
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200618 * struct ftrace_raw_##call *entry;
Frederic Weisbecker444a2a32009-11-06 04:13:05 +0100619 * struct perf_trace_buf *trace_buf;
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200620 * u64 __addr = 0, __count = 1;
621 * unsigned long irq_flags;
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200622 * struct trace_entry *ent;
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200623 * int __entry_size;
624 * int __data_size;
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200625 * int __cpu
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200626 * int pc;
627 *
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200628 * pc = preempt_count();
629 *
630 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
Frederic Weisbecker304703a2009-08-10 16:11:32 +0200631 *
632 * // Below we want to get the aligned size by taking into account
633 * // the u32 field that will later store the buffer size
634 * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),
635 * sizeof(u64));
636 * __entry_size -= sizeof(u32);
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200637 *
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200638 * // Protect the non nmi buffer
639 * // This also protects the rcu read side
640 * local_irq_save(irq_flags);
641 * __cpu = smp_processor_id();
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200642 *
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200643 * if (in_nmi())
Paul E. McKenney8d53dd52010-03-03 17:50:18 -0800644 * trace_buf = rcu_dereference_sched(perf_trace_buf_nmi);
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200645 * else
Paul E. McKenney8d53dd52010-03-03 17:50:18 -0800646 * trace_buf = rcu_dereference_sched(perf_trace_buf);
Frederic Weisbecker1853db02009-08-10 16:38:36 +0200647 *
Frederic Weisbecker444a2a32009-11-06 04:13:05 +0100648 * if (!trace_buf)
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200649 * goto end;
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200650 *
Frederic Weisbecker444a2a32009-11-06 04:13:05 +0100651 * trace_buf = per_cpu_ptr(trace_buf, __cpu);
652 *
653 * // Avoid recursion from perf that could mess up the buffer
654 * if (trace_buf->recursion++)
655 * goto end_recursion;
656 *
657 * raw_data = trace_buf->buf;
658 *
659 * // Make recursion update visible before entering perf_tp_event
660 * // so that we protect from perf recursions.
661 *
662 * barrier();
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200663 *
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200664 * //zero dead bytes from alignment to avoid stack leak to userspace:
665 * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL;
666 * entry = (struct ftrace_raw_<call> *)raw_data;
667 * ent = &entry->ent;
668 * tracing_generic_entry_update(ent, irq_flags, pc);
669 * ent->type = event_call->id;
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200670 *
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200671 * <tstruct> <- do some jobs with dynamic arrays
672 *
673 * <assign> <- affect our values
674 *
Linus Torvalds43c12662009-09-21 09:15:07 -0700675 * perf_tp_event(event_call->id, __addr, __count, entry,
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200676 * __entry_size); <- submit them to perf counter
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200677 *
678 * }
679 */
680
Li Zefan07b139c2009-12-21 14:27:35 +0800681#ifdef CONFIG_PERF_EVENTS
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200682
Lai Jiangshan509e7602009-12-15 15:39:42 +0800683#undef __entry
684#define __entry entry
685
686#undef __get_dynamic_array
687#define __get_dynamic_array(field) \
688 ((void *)__entry + (__entry->__data_loc_##field & 0xffff))
689
690#undef __get_str
691#define __get_str(field) (char *)__get_dynamic_array(field)
692
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200693#undef __perf_addr
694#define __perf_addr(a) __addr = (a)
695
696#undef __perf_count
697#define __perf_count(c) __count = (c)
698
Ingo Molnar091ad362009-11-26 09:04:55 +0100699#undef DECLARE_EVENT_CLASS
700#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
Steven Rostedt83f0d532010-02-16 10:38:47 -0500701static notrace void \
Steven Rostedt22392912010-04-21 12:27:06 -0400702perf_trace_##call(void *__data, proto) \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200703{ \
Steven Rostedt22392912010-04-21 12:27:06 -0400704 struct ftrace_event_call *event_call = __data; \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200705 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200706 struct ftrace_raw_##call *entry; \
Steven Rostedtff5f1492010-05-21 11:49:57 -0400707 struct pt_regs __regs; \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200708 u64 __addr = 0, __count = 1; \
Peter Zijlstra1c024eca2010-05-19 14:02:22 +0200709 struct hlist_head *head; \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200710 int __entry_size; \
711 int __data_size; \
Peter Zijlstra4ed7c922009-11-23 11:37:29 +0100712 int rctx; \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200713 \
Frederic Weisbeckerb0f82b82010-05-20 07:47:21 +0200714 perf_fetch_caller_regs(&__regs); \
Steven Rostedtf0218b32010-05-17 22:26:53 -0400715 \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200716 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
Peter Zijlstraa0445602009-08-10 11:16:52 +0200717 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
718 sizeof(u64)); \
Frederic Weisbecker304703a2009-08-10 16:11:32 +0200719 __entry_size -= sizeof(u32); \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200720 \
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100721 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200722 "profile buffer not large enough")) \
723 return; \
Peter Zijlstrab7e2ece2010-05-19 10:52:27 +0200724 \
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100725 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
Steven Rostedtff5f1492010-05-21 11:49:57 -0400726 __entry_size, event_call->event.type, &__regs, &rctx); \
Xiao Guangrong430ad5a2010-01-28 09:32:29 +0800727 if (!entry) \
728 return; \
Peter Zijlstrab7e2ece2010-05-19 10:52:27 +0200729 \
Frederic Weisbecker20ab44252009-09-18 06:10:28 +0200730 tstruct \
731 \
732 { assign; } \
733 \
Peter Zijlstra3771f072010-05-21 12:31:09 +0200734 head = this_cpu_ptr(event_call->perf_events); \
Frederic Weisbecker97d5a222010-03-05 05:35:37 +0100735 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
Steven Rostedtff5f1492010-05-21 11:49:57 -0400736 __count, &__regs, head); \
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200737}
738
Steven Rostedt22392912010-04-21 12:27:06 -0400739/*
740 * This part is compiled out, it is only here as a build time check
741 * to make sure that if the tracepoint handling changes, the
742 * perf probe will fail to compile unless it too is updated.
743 */
Steven Rostedtff038f52009-11-18 20:27:27 -0500744#undef DEFINE_EVENT
Frederic Weisbecker6cc8a7c2010-03-19 01:23:53 +0100745#define DEFINE_EVENT(template, call, proto, args) \
Steven Rostedt22392912010-04-21 12:27:06 -0400746static inline void perf_test_probe_##call(void) \
Frederic Weisbecker6cc8a7c2010-03-19 01:23:53 +0100747{ \
Steven Rostedt22392912010-04-21 12:27:06 -0400748 check_trace_callback_type_##call(perf_trace_##template); \
Steven Rostedtff038f52009-11-18 20:27:27 -0500749}
750
Steven Rostedt22392912010-04-21 12:27:06 -0400751
Steven Rostedte5bc9722009-11-18 20:36:26 -0500752#undef DEFINE_EVENT_PRINT
753#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
754 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
755
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200756#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
Li Zefan07b139c2009-12-21 14:27:35 +0800757#endif /* CONFIG_PERF_EVENTS */
Frederic Weisbeckerf413cdb2009-08-07 01:25:54 +0200758
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400759#undef _TRACE_PROFILE_INIT
760