blob: 40ede4db4d8853725c4ef307b5ad3fe70fd0fb15 [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 Rostedtf42c85e2009-04-13 12:25:37 -040021#undef __field
22#define __field(type, item) type item;
23
Li Zefan7fcb7c42009-06-01 15:35:46 +080024#undef __array
25#define __array(type, item, len) type item[len];
26
27#undef __dynamic_array
28#define __dynamic_array(type, item, len) unsigned short __data_loc_##item;
29
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020030#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +080031#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020032
Steven Rostedtf42c85e2009-04-13 12:25:37 -040033#undef TP_STRUCT__entry
34#define TP_STRUCT__entry(args...) args
35
36#undef TRACE_EVENT
37#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
38 struct ftrace_raw_##name { \
39 struct trace_entry ent; \
40 tstruct \
Li Zefan7fcb7c42009-06-01 15:35:46 +080041 char __data[0]; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -040042 }; \
43 static struct ftrace_event_call event_##name
44
45#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
46
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020047
Steven Rostedtf42c85e2009-04-13 12:25:37 -040048/*
49 * Stage 2 of the trace events.
50 *
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020051 * Include the following:
52 *
Li Zefan7fcb7c42009-06-01 15:35:46 +080053 * struct ftrace_data_offsets_<call> {
54 * int <item1>;
55 * int <item2>;
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020056 * [...]
57 * };
58 *
Li Zefan7fcb7c42009-06-01 15:35:46 +080059 * The __dynamic_array() macro will create each int <item>, this is
60 * to keep the offset of each array from the beginning of the event.
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020061 */
62
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020063#undef __field
64#define __field(type, item);
65
Li Zefan7fcb7c42009-06-01 15:35:46 +080066#undef __array
67#define __array(type, item, len)
68
69#undef __dynamic_array
70#define __dynamic_array(type, item, len) int item;
71
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020072#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +080073#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020074
75#undef TRACE_EVENT
76#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
Li Zefan7fcb7c42009-06-01 15:35:46 +080077 struct ftrace_data_offsets_##call { \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +020078 tstruct; \
79 };
80
81#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
82
83/*
84 * Stage 3 of the trace events.
85 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -040086 * Override the macros in <trace/trace_events.h> to include the following:
87 *
88 * enum print_line_t
89 * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags)
90 * {
91 * struct trace_seq *s = &iter->seq;
92 * struct ftrace_raw_<call> *field; <-- defined in stage 1
93 * struct trace_entry *entry;
Steven Rostedtbe74b732009-05-26 20:25:22 +020094 * struct trace_seq *p;
Steven Rostedtf42c85e2009-04-13 12:25:37 -040095 * int ret;
96 *
97 * entry = iter->ent;
98 *
99 * if (entry->type != event_<call>.id) {
100 * WARN_ON_ONCE(1);
101 * return TRACE_TYPE_UNHANDLED;
102 * }
103 *
104 * field = (typeof(field))entry;
105 *
Steven Rostedtbe74b732009-05-26 20:25:22 +0200106 * p = get_cpu_var(ftrace_event_seq);
Steven Whitehouse56d8bd32009-06-03 14:52:03 +0100107 * trace_seq_init(p);
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400108 * ret = trace_seq_printf(s, <TP_printk> "\n");
Steven Rostedtbe74b732009-05-26 20:25:22 +0200109 * put_cpu();
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400110 * if (!ret)
111 * return TRACE_TYPE_PARTIAL_LINE;
112 *
113 * return TRACE_TYPE_HANDLED;
114 * }
115 *
116 * This is the method used to print the raw event to the trace
117 * output format. Note, this is not needed if the data is read
118 * in binary.
119 */
120
121#undef __entry
122#define __entry field
123
124#undef TP_printk
125#define TP_printk(fmt, args...) fmt "\n", args
126
Li Zefan7fcb7c42009-06-01 15:35:46 +0800127#undef __get_dynamic_array
128#define __get_dynamic_array(field) \
129 ((void *)__entry + __entry->__data_loc_##field)
130
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200131#undef __get_str
Li Zefan7fcb7c42009-06-01 15:35:46 +0800132#define __get_str(field) (char *)__get_dynamic_array(field)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200133
Steven Rostedtbe74b732009-05-26 20:25:22 +0200134#undef __print_flags
135#define __print_flags(flag, delim, flag_array...) \
136 ({ \
137 static const struct trace_print_flags flags[] = \
138 { flag_array, { -1, NULL }}; \
139 ftrace_print_flags_seq(p, delim, flag, flags); \
140 })
141
Steven Rostedt0f4fc292009-05-20 19:21:47 -0400142#undef __print_symbolic
143#define __print_symbolic(value, symbol_array...) \
144 ({ \
145 static const struct trace_print_flags symbols[] = \
146 { symbol_array, { -1, NULL }}; \
147 ftrace_print_symbols_seq(p, value, symbols); \
148 })
149
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400150#undef TRACE_EVENT
151#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
152enum print_line_t \
153ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
154{ \
155 struct trace_seq *s = &iter->seq; \
156 struct ftrace_raw_##call *field; \
157 struct trace_entry *entry; \
Steven Rostedtbe74b732009-05-26 20:25:22 +0200158 struct trace_seq *p; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400159 int ret; \
160 \
161 entry = iter->ent; \
162 \
163 if (entry->type != event_##call.id) { \
164 WARN_ON_ONCE(1); \
165 return TRACE_TYPE_UNHANDLED; \
166 } \
167 \
168 field = (typeof(field))entry; \
169 \
Steven Rostedtbe74b732009-05-26 20:25:22 +0200170 p = &get_cpu_var(ftrace_event_seq); \
Steven Whitehouse56d8bd32009-06-03 14:52:03 +0100171 trace_seq_init(p); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400172 ret = trace_seq_printf(s, #call ": " print); \
Steven Rostedtbe74b732009-05-26 20:25:22 +0200173 put_cpu(); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400174 if (!ret) \
175 return TRACE_TYPE_PARTIAL_LINE; \
176 \
177 return TRACE_TYPE_HANDLED; \
178}
179
180#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
181
182/*
183 * Setup the showing format of trace point.
184 *
185 * int
186 * ftrace_format_##call(struct trace_seq *s)
187 * {
188 * struct ftrace_raw_##call field;
189 * int ret;
190 *
191 * ret = trace_seq_printf(s, #type " " #item ";"
192 * " offset:%u; size:%u;\n",
193 * offsetof(struct ftrace_raw_##call, item),
194 * sizeof(field.type));
195 *
196 * }
197 */
198
199#undef TP_STRUCT__entry
200#define TP_STRUCT__entry(args...) args
201
202#undef __field
203#define __field(type, item) \
204 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
205 "offset:%u;\tsize:%u;\n", \
206 (unsigned int)offsetof(typeof(field), item), \
207 (unsigned int)sizeof(field.item)); \
208 if (!ret) \
209 return 0;
210
211#undef __array
212#define __array(type, item, len) \
213 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
214 "offset:%u;\tsize:%u;\n", \
215 (unsigned int)offsetof(typeof(field), item), \
216 (unsigned int)sizeof(field.item)); \
217 if (!ret) \
218 return 0;
219
Li Zefan7fcb7c42009-06-01 15:35:46 +0800220#undef __dynamic_array
221#define __dynamic_array(type, item, len) \
222 ret = trace_seq_printf(s, "\tfield:__data_loc " #item ";\t" \
Li Zefan6e25db42009-05-29 11:24:59 +0800223 "offset:%u;\tsize:%u;\n", \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200224 (unsigned int)offsetof(typeof(field), \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800225 __data_loc_##item), \
226 (unsigned int)sizeof(field.__data_loc_##item)); \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200227 if (!ret) \
228 return 0;
229
Li Zefan7fcb7c42009-06-01 15:35:46 +0800230#undef __string
231#define __string(item, src) __dynamic_array(char, item, -1)
232
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400233#undef __entry
234#define __entry REC
235
236#undef TP_printk
237#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
238
239#undef TP_fast_assign
240#define TP_fast_assign(args...) args
241
242#undef TRACE_EVENT
243#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
244static int \
245ftrace_format_##call(struct trace_seq *s) \
246{ \
Jeremy Fitzhardinge76aa8112009-04-16 23:35:39 -0700247 struct ftrace_raw_##call field __attribute__((unused)); \
248 int ret = 0; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400249 \
250 tstruct; \
251 \
252 trace_seq_printf(s, "\nprint fmt: " print); \
253 \
254 return ret; \
255}
256
257#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
258
259#undef __field
260#define __field(type, item) \
261 ret = trace_define_field(event_call, #type, #item, \
262 offsetof(typeof(field), item), \
Tom Zanussia118e4d2009-04-28 03:04:53 -0500263 sizeof(field.item), is_signed_type(type)); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400264 if (ret) \
265 return ret;
266
267#undef __array
268#define __array(type, item, len) \
269 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
270 ret = trace_define_field(event_call, #type "[" #len "]", #item, \
271 offsetof(typeof(field), item), \
Tom Zanussia118e4d2009-04-28 03:04:53 -0500272 sizeof(field.item), 0); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400273 if (ret) \
274 return ret;
275
Li Zefan7fcb7c42009-06-01 15:35:46 +0800276#undef __dynamic_array
277#define __dynamic_array(type, item, len) \
278 ret = trace_define_field(event_call, "__data_loc" "[" #type "]", #item,\
279 offsetof(typeof(field), __data_loc_##item), \
280 sizeof(field.__data_loc_##item), 0);
281
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200282#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800283#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200284
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400285#undef TRACE_EVENT
286#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
287int \
288ftrace_define_fields_##call(void) \
289{ \
290 struct ftrace_raw_##call field; \
291 struct ftrace_event_call *event_call = &event_##call; \
292 int ret; \
293 \
Tom Zanussia118e4d2009-04-28 03:04:53 -0500294 __common_field(int, type, 1); \
295 __common_field(unsigned char, flags, 0); \
296 __common_field(unsigned char, preempt_count, 0); \
297 __common_field(int, pid, 1); \
298 __common_field(int, tgid, 1); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400299 \
300 tstruct; \
301 \
302 return ret; \
303}
304
305#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
306
307/*
Li Zefan7fcb7c42009-06-01 15:35:46 +0800308 * remember the offset of each array from the beginning of the event.
309 */
310
311#undef __entry
312#define __entry entry
313
314#undef __field
315#define __field(type, item)
316
317#undef __array
318#define __array(type, item, len)
319
320#undef __dynamic_array
321#define __dynamic_array(type, item, len) \
322 __data_offsets->item = __data_size + \
323 offsetof(typeof(*entry), __data); \
324 __data_size += (len) * sizeof(type);
325
326#undef __string
327#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \
328
329#undef TRACE_EVENT
330#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
331static inline int ftrace_get_offsets_##call( \
332 struct ftrace_data_offsets_##call *__data_offsets, proto) \
333{ \
334 int __data_size = 0; \
335 struct ftrace_raw_##call __maybe_unused *entry; \
336 \
337 tstruct; \
338 \
339 return __data_size; \
340}
341
342#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
343
344/*
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200345 * Stage 4 of the trace events.
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400346 *
347 * Override the macros in <trace/trace_events.h> to include the following:
348 *
349 * static void ftrace_event_<call>(proto)
350 * {
351 * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
352 * }
353 *
354 * static int ftrace_reg_event_<call>(void)
355 * {
356 * int ret;
357 *
358 * ret = register_trace_<call>(ftrace_event_<call>);
359 * if (!ret)
360 * pr_info("event trace: Could not activate trace point "
361 * "probe to <call>");
362 * return ret;
363 * }
364 *
365 * static void ftrace_unreg_event_<call>(void)
366 * {
367 * unregister_trace_<call>(ftrace_event_<call>);
368 * }
369 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400370 *
371 * For those macros defined with TRACE_EVENT:
372 *
373 * static struct ftrace_event_call event_<call>;
374 *
375 * static void ftrace_raw_event_<call>(proto)
376 * {
377 * struct ring_buffer_event *event;
378 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
379 * unsigned long irq_flags;
380 * int pc;
381 *
382 * local_save_flags(irq_flags);
383 * pc = preempt_count();
384 *
385 * event = trace_current_buffer_lock_reserve(event_<call>.id,
386 * sizeof(struct ftrace_raw_<call>),
387 * irq_flags, pc);
388 * if (!event)
389 * return;
390 * entry = ring_buffer_event_data(event);
391 *
392 * <assign>; <-- Here we assign the entries by the __field and
393 * __array macros.
394 *
395 * trace_current_buffer_unlock_commit(event, irq_flags, pc);
396 * }
397 *
398 * static int ftrace_raw_reg_event_<call>(void)
399 * {
400 * int ret;
401 *
402 * ret = register_trace_<call>(ftrace_raw_event_<call>);
403 * if (!ret)
404 * pr_info("event trace: Could not activate trace point "
405 * "probe to <call>");
406 * return ret;
407 * }
408 *
409 * static void ftrace_unreg_event_<call>(void)
410 * {
411 * unregister_trace_<call>(ftrace_raw_event_<call>);
412 * }
413 *
414 * static struct trace_event ftrace_event_type_<call> = {
415 * .trace = ftrace_raw_output_<call>, <-- stage 2
416 * };
417 *
418 * static int ftrace_raw_init_event_<call>(void)
419 * {
420 * int id;
421 *
422 * id = register_ftrace_event(&ftrace_event_type_<call>);
423 * if (!id)
424 * return -ENODEV;
425 * event_<call>.id = id;
426 * return 0;
427 * }
428 *
429 * static struct ftrace_event_call __used
430 * __attribute__((__aligned__(4)))
431 * __attribute__((section("_ftrace_events"))) event_<call> = {
432 * .name = "<call>",
433 * .system = "<system>",
434 * .raw_init = ftrace_raw_init_event_<call>,
435 * .regfunc = ftrace_reg_event_<call>,
436 * .unregfunc = ftrace_unreg_event_<call>,
437 * .show_format = ftrace_format_<call>,
438 * }
439 *
440 */
441
442#undef TP_FMT
443#define TP_FMT(fmt, args...) fmt "\n", ##args
444
445#ifdef CONFIG_EVENT_PROFILE
446#define _TRACE_PROFILE(call, proto, args) \
447static void ftrace_profile_##call(proto) \
448{ \
449 extern void perf_tpcounter_event(int); \
450 perf_tpcounter_event(event_##call.id); \
451} \
452 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800453static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400454{ \
455 int ret = 0; \
456 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800457 if (!atomic_inc_return(&event_call->profile_count)) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400458 ret = register_trace_##call(ftrace_profile_##call); \
459 \
460 return ret; \
461} \
462 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800463static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400464{ \
Zhaoleif2aebae2009-05-27 21:36:02 +0800465 if (atomic_add_negative(-1, &event_call->profile_count)) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400466 unregister_trace_##call(ftrace_profile_##call); \
467}
468
469#define _TRACE_PROFILE_INIT(call) \
470 .profile_count = ATOMIC_INIT(-1), \
471 .profile_enable = ftrace_profile_enable_##call, \
472 .profile_disable = ftrace_profile_disable_##call,
473
474#else
475#define _TRACE_PROFILE(call, proto, args)
476#define _TRACE_PROFILE_INIT(call)
477#endif
478
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400479#undef __entry
480#define __entry entry
481
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200482#undef __field
483#define __field(type, item)
484
485#undef __array
486#define __array(type, item, len)
487
Li Zefan7fcb7c42009-06-01 15:35:46 +0800488#undef __dynamic_array
489#define __dynamic_array(type, item, len) \
490 __entry->__data_loc_##item = __data_offsets.item;
491
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200492#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800493#define __string(item, src) __dynamic_array(char, item, -1) \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200494
495#undef __assign_str
496#define __assign_str(dst, src) \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200497 strcpy(__get_str(dst), src);
498
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400499#undef TRACE_EVENT
500#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
501_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
502 \
503static struct ftrace_event_call event_##call; \
504 \
505static void ftrace_raw_event_##call(proto) \
506{ \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800507 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
Zhaoleif2aebae2009-05-27 21:36:02 +0800508 struct ftrace_event_call *event_call = &event_##call; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400509 struct ring_buffer_event *event; \
510 struct ftrace_raw_##call *entry; \
511 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 Rostedtf42c85e2009-04-13 12:25:37 -0400520 event = trace_current_buffer_lock_reserve(event_##call.id, \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800521 sizeof(*entry) + __data_size, \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200522 irq_flags, pc); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400523 if (!event) \
524 return; \
525 entry = ring_buffer_event_data(event); \
526 \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800527 \
528 tstruct \
529 \
Li Zefana9c1c3a2009-06-01 15:35:13 +0800530 { assign; } \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400531 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800532 if (!filter_current_check_discard(event_call, entry, event)) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400533 trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
534} \
535 \
536static int ftrace_raw_reg_event_##call(void) \
537{ \
538 int ret; \
539 \
540 ret = register_trace_##call(ftrace_raw_event_##call); \
541 if (ret) \
542 pr_info("event trace: Could not activate trace point " \
543 "probe to " #call "\n"); \
544 return ret; \
545} \
546 \
547static void ftrace_raw_unreg_event_##call(void) \
548{ \
549 unregister_trace_##call(ftrace_raw_event_##call); \
550} \
551 \
552static struct trace_event ftrace_event_type_##call = { \
553 .trace = ftrace_raw_output_##call, \
554}; \
555 \
556static int ftrace_raw_init_event_##call(void) \
557{ \
558 int id; \
559 \
560 id = register_ftrace_event(&ftrace_event_type_##call); \
561 if (!id) \
562 return -ENODEV; \
563 event_##call.id = id; \
564 INIT_LIST_HEAD(&event_##call.fields); \
565 init_preds(&event_##call); \
566 return 0; \
567} \
568 \
569static struct ftrace_event_call __used \
570__attribute__((__aligned__(4))) \
571__attribute__((section("_ftrace_events"))) event_##call = { \
572 .name = #call, \
573 .system = __stringify(TRACE_SYSTEM), \
Steven Rostedt6d723732009-04-10 14:53:50 -0400574 .event = &ftrace_event_type_##call, \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400575 .raw_init = ftrace_raw_init_event_##call, \
576 .regfunc = ftrace_raw_reg_event_##call, \
577 .unregfunc = ftrace_raw_unreg_event_##call, \
578 .show_format = ftrace_format_##call, \
579 .define_fields = ftrace_define_fields_##call, \
580 _TRACE_PROFILE_INIT(call) \
581}
582
583#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
584
585#undef _TRACE_PROFILE
586#undef _TRACE_PROFILE_INIT
587