blob: b5478dab579b77906ec29e51b04876092c14831f [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 Rostedtbe74b73a2009-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 Rostedtbe74b73a2009-05-26 20:25:22 +0200106 * p = get_cpu_var(ftrace_event_seq);
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400107 * ret = trace_seq_printf(s, <TP_printk> "\n");
Steven Rostedtbe74b73a2009-05-26 20:25:22 +0200108 * put_cpu();
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400109 * if (!ret)
110 * return TRACE_TYPE_PARTIAL_LINE;
111 *
112 * return TRACE_TYPE_HANDLED;
113 * }
114 *
115 * This is the method used to print the raw event to the trace
116 * output format. Note, this is not needed if the data is read
117 * in binary.
118 */
119
120#undef __entry
121#define __entry field
122
123#undef TP_printk
124#define TP_printk(fmt, args...) fmt "\n", args
125
Li Zefan7fcb7c42009-06-01 15:35:46 +0800126#undef __get_dynamic_array
127#define __get_dynamic_array(field) \
128 ((void *)__entry + __entry->__data_loc_##field)
129
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200130#undef __get_str
Li Zefan7fcb7c42009-06-01 15:35:46 +0800131#define __get_str(field) (char *)__get_dynamic_array(field)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200132
Steven Rostedtbe74b73a2009-05-26 20:25:22 +0200133#undef __print_flags
134#define __print_flags(flag, delim, flag_array...) \
135 ({ \
136 static const struct trace_print_flags flags[] = \
137 { flag_array, { -1, NULL }}; \
138 ftrace_print_flags_seq(p, delim, flag, flags); \
139 })
140
Steven Rostedt0f4fc292009-05-20 19:21:47 -0400141#undef __print_symbolic
142#define __print_symbolic(value, symbol_array...) \
143 ({ \
144 static const struct trace_print_flags symbols[] = \
145 { symbol_array, { -1, NULL }}; \
146 ftrace_print_symbols_seq(p, value, symbols); \
147 })
148
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400149#undef TRACE_EVENT
150#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
151enum print_line_t \
152ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
153{ \
154 struct trace_seq *s = &iter->seq; \
155 struct ftrace_raw_##call *field; \
156 struct trace_entry *entry; \
Steven Rostedtbe74b73a2009-05-26 20:25:22 +0200157 struct trace_seq *p; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400158 int ret; \
159 \
160 entry = iter->ent; \
161 \
162 if (entry->type != event_##call.id) { \
163 WARN_ON_ONCE(1); \
164 return TRACE_TYPE_UNHANDLED; \
165 } \
166 \
167 field = (typeof(field))entry; \
168 \
Steven Rostedtbe74b73a2009-05-26 20:25:22 +0200169 p = &get_cpu_var(ftrace_event_seq); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400170 ret = trace_seq_printf(s, #call ": " print); \
Steven Rostedtbe74b73a2009-05-26 20:25:22 +0200171 put_cpu(); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400172 if (!ret) \
173 return TRACE_TYPE_PARTIAL_LINE; \
174 \
175 return TRACE_TYPE_HANDLED; \
176}
177
178#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
179
180/*
181 * Setup the showing format of trace point.
182 *
183 * int
184 * ftrace_format_##call(struct trace_seq *s)
185 * {
186 * struct ftrace_raw_##call field;
187 * int ret;
188 *
189 * ret = trace_seq_printf(s, #type " " #item ";"
190 * " offset:%u; size:%u;\n",
191 * offsetof(struct ftrace_raw_##call, item),
192 * sizeof(field.type));
193 *
194 * }
195 */
196
197#undef TP_STRUCT__entry
198#define TP_STRUCT__entry(args...) args
199
200#undef __field
201#define __field(type, item) \
202 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
203 "offset:%u;\tsize:%u;\n", \
204 (unsigned int)offsetof(typeof(field), item), \
205 (unsigned int)sizeof(field.item)); \
206 if (!ret) \
207 return 0;
208
209#undef __array
210#define __array(type, item, len) \
211 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
212 "offset:%u;\tsize:%u;\n", \
213 (unsigned int)offsetof(typeof(field), item), \
214 (unsigned int)sizeof(field.item)); \
215 if (!ret) \
216 return 0;
217
Li Zefan7fcb7c42009-06-01 15:35:46 +0800218#undef __dynamic_array
219#define __dynamic_array(type, item, len) \
220 ret = trace_seq_printf(s, "\tfield:__data_loc " #item ";\t" \
Li Zefan6e25db42009-05-29 11:24:59 +0800221 "offset:%u;\tsize:%u;\n", \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200222 (unsigned int)offsetof(typeof(field), \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800223 __data_loc_##item), \
224 (unsigned int)sizeof(field.__data_loc_##item)); \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200225 if (!ret) \
226 return 0;
227
Li Zefan7fcb7c42009-06-01 15:35:46 +0800228#undef __string
229#define __string(item, src) __dynamic_array(char, item, -1)
230
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400231#undef __entry
232#define __entry REC
233
234#undef TP_printk
235#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
236
237#undef TP_fast_assign
238#define TP_fast_assign(args...) args
239
240#undef TRACE_EVENT
241#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
242static int \
243ftrace_format_##call(struct trace_seq *s) \
244{ \
Jeremy Fitzhardinge76aa8112009-04-16 23:35:39 -0700245 struct ftrace_raw_##call field __attribute__((unused)); \
246 int ret = 0; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400247 \
248 tstruct; \
249 \
250 trace_seq_printf(s, "\nprint fmt: " print); \
251 \
252 return ret; \
253}
254
255#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
256
257#undef __field
258#define __field(type, item) \
259 ret = trace_define_field(event_call, #type, #item, \
260 offsetof(typeof(field), item), \
Tom Zanussia118e4d2009-04-28 03:04:53 -0500261 sizeof(field.item), is_signed_type(type)); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400262 if (ret) \
263 return ret;
264
265#undef __array
266#define __array(type, item, len) \
267 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
268 ret = trace_define_field(event_call, #type "[" #len "]", #item, \
269 offsetof(typeof(field), item), \
Tom Zanussia118e4d2009-04-28 03:04:53 -0500270 sizeof(field.item), 0); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400271 if (ret) \
272 return ret;
273
Li Zefan7fcb7c42009-06-01 15:35:46 +0800274#undef __dynamic_array
275#define __dynamic_array(type, item, len) \
276 ret = trace_define_field(event_call, "__data_loc" "[" #type "]", #item,\
277 offsetof(typeof(field), __data_loc_##item), \
278 sizeof(field.__data_loc_##item), 0);
279
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200280#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800281#define __string(item, src) __dynamic_array(char, item, -1)
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200282
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400283#undef TRACE_EVENT
284#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
285int \
286ftrace_define_fields_##call(void) \
287{ \
288 struct ftrace_raw_##call field; \
289 struct ftrace_event_call *event_call = &event_##call; \
290 int ret; \
291 \
Tom Zanussia118e4d2009-04-28 03:04:53 -0500292 __common_field(int, type, 1); \
293 __common_field(unsigned char, flags, 0); \
294 __common_field(unsigned char, preempt_count, 0); \
295 __common_field(int, pid, 1); \
296 __common_field(int, tgid, 1); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400297 \
298 tstruct; \
299 \
300 return ret; \
301}
302
303#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
304
305/*
Li Zefan7fcb7c42009-06-01 15:35:46 +0800306 * remember the offset of each array from the beginning of the event.
307 */
308
309#undef __entry
310#define __entry entry
311
312#undef __field
313#define __field(type, item)
314
315#undef __array
316#define __array(type, item, len)
317
318#undef __dynamic_array
319#define __dynamic_array(type, item, len) \
320 __data_offsets->item = __data_size + \
321 offsetof(typeof(*entry), __data); \
322 __data_size += (len) * sizeof(type);
323
324#undef __string
325#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \
326
327#undef TRACE_EVENT
328#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
329static inline int ftrace_get_offsets_##call( \
330 struct ftrace_data_offsets_##call *__data_offsets, proto) \
331{ \
332 int __data_size = 0; \
333 struct ftrace_raw_##call __maybe_unused *entry; \
334 \
335 tstruct; \
336 \
337 return __data_size; \
338}
339
340#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
341
342/*
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200343 * Stage 4 of the trace events.
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400344 *
345 * Override the macros in <trace/trace_events.h> to include the following:
346 *
347 * static void ftrace_event_<call>(proto)
348 * {
349 * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
350 * }
351 *
352 * static int ftrace_reg_event_<call>(void)
353 * {
354 * int ret;
355 *
356 * ret = register_trace_<call>(ftrace_event_<call>);
357 * if (!ret)
358 * pr_info("event trace: Could not activate trace point "
359 * "probe to <call>");
360 * return ret;
361 * }
362 *
363 * static void ftrace_unreg_event_<call>(void)
364 * {
365 * unregister_trace_<call>(ftrace_event_<call>);
366 * }
367 *
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400368 *
369 * For those macros defined with TRACE_EVENT:
370 *
371 * static struct ftrace_event_call event_<call>;
372 *
373 * static void ftrace_raw_event_<call>(proto)
374 * {
375 * struct ring_buffer_event *event;
376 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
377 * unsigned long irq_flags;
378 * int pc;
379 *
380 * local_save_flags(irq_flags);
381 * pc = preempt_count();
382 *
383 * event = trace_current_buffer_lock_reserve(event_<call>.id,
384 * sizeof(struct ftrace_raw_<call>),
385 * irq_flags, pc);
386 * if (!event)
387 * return;
388 * entry = ring_buffer_event_data(event);
389 *
390 * <assign>; <-- Here we assign the entries by the __field and
391 * __array macros.
392 *
393 * trace_current_buffer_unlock_commit(event, irq_flags, pc);
394 * }
395 *
396 * static int ftrace_raw_reg_event_<call>(void)
397 * {
398 * int ret;
399 *
400 * ret = register_trace_<call>(ftrace_raw_event_<call>);
401 * if (!ret)
402 * pr_info("event trace: Could not activate trace point "
403 * "probe to <call>");
404 * return ret;
405 * }
406 *
407 * static void ftrace_unreg_event_<call>(void)
408 * {
409 * unregister_trace_<call>(ftrace_raw_event_<call>);
410 * }
411 *
412 * static struct trace_event ftrace_event_type_<call> = {
413 * .trace = ftrace_raw_output_<call>, <-- stage 2
414 * };
415 *
416 * static int ftrace_raw_init_event_<call>(void)
417 * {
418 * int id;
419 *
420 * id = register_ftrace_event(&ftrace_event_type_<call>);
421 * if (!id)
422 * return -ENODEV;
423 * event_<call>.id = id;
424 * return 0;
425 * }
426 *
427 * static struct ftrace_event_call __used
428 * __attribute__((__aligned__(4)))
429 * __attribute__((section("_ftrace_events"))) event_<call> = {
430 * .name = "<call>",
431 * .system = "<system>",
432 * .raw_init = ftrace_raw_init_event_<call>,
433 * .regfunc = ftrace_reg_event_<call>,
434 * .unregfunc = ftrace_unreg_event_<call>,
435 * .show_format = ftrace_format_<call>,
436 * }
437 *
438 */
439
440#undef TP_FMT
441#define TP_FMT(fmt, args...) fmt "\n", ##args
442
443#ifdef CONFIG_EVENT_PROFILE
444#define _TRACE_PROFILE(call, proto, args) \
445static void ftrace_profile_##call(proto) \
446{ \
447 extern void perf_tpcounter_event(int); \
448 perf_tpcounter_event(event_##call.id); \
449} \
450 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800451static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400452{ \
453 int ret = 0; \
454 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800455 if (!atomic_inc_return(&event_call->profile_count)) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400456 ret = register_trace_##call(ftrace_profile_##call); \
457 \
458 return ret; \
459} \
460 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800461static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400462{ \
Zhaoleif2aebae2009-05-27 21:36:02 +0800463 if (atomic_add_negative(-1, &event_call->profile_count)) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400464 unregister_trace_##call(ftrace_profile_##call); \
465}
466
467#define _TRACE_PROFILE_INIT(call) \
468 .profile_count = ATOMIC_INIT(-1), \
469 .profile_enable = ftrace_profile_enable_##call, \
470 .profile_disable = ftrace_profile_disable_##call,
471
472#else
473#define _TRACE_PROFILE(call, proto, args)
474#define _TRACE_PROFILE_INIT(call)
475#endif
476
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400477#undef __entry
478#define __entry entry
479
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200480#undef __field
481#define __field(type, item)
482
483#undef __array
484#define __array(type, item, len)
485
Li Zefan7fcb7c42009-06-01 15:35:46 +0800486#undef __dynamic_array
487#define __dynamic_array(type, item, len) \
488 __entry->__data_loc_##item = __data_offsets.item;
489
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200490#undef __string
Li Zefan7fcb7c42009-06-01 15:35:46 +0800491#define __string(item, src) __dynamic_array(char, item, -1) \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200492
493#undef __assign_str
494#define __assign_str(dst, src) \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200495 strcpy(__get_str(dst), src);
496
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400497#undef TRACE_EVENT
498#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
499_TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \
500 \
501static struct ftrace_event_call event_##call; \
502 \
503static void ftrace_raw_event_##call(proto) \
504{ \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800505 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
Zhaoleif2aebae2009-05-27 21:36:02 +0800506 struct ftrace_event_call *event_call = &event_##call; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400507 struct ring_buffer_event *event; \
508 struct ftrace_raw_##call *entry; \
509 unsigned long irq_flags; \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800510 int __data_size; \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400511 int pc; \
512 \
513 local_save_flags(irq_flags); \
514 pc = preempt_count(); \
515 \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800516 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200517 \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400518 event = trace_current_buffer_lock_reserve(event_##call.id, \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800519 sizeof(*entry) + __data_size, \
Frederic Weisbecker9cbf1172009-04-19 04:51:29 +0200520 irq_flags, pc); \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400521 if (!event) \
522 return; \
523 entry = ring_buffer_event_data(event); \
524 \
Li Zefan7fcb7c42009-06-01 15:35:46 +0800525 \
526 tstruct \
527 \
Li Zefana9c1c3a2009-06-01 15:35:13 +0800528 { assign; } \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400529 \
Zhaoleif2aebae2009-05-27 21:36:02 +0800530 if (!filter_current_check_discard(event_call, entry, event)) \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400531 trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
532} \
533 \
534static int ftrace_raw_reg_event_##call(void) \
535{ \
536 int ret; \
537 \
538 ret = register_trace_##call(ftrace_raw_event_##call); \
539 if (ret) \
540 pr_info("event trace: Could not activate trace point " \
541 "probe to " #call "\n"); \
542 return ret; \
543} \
544 \
545static void ftrace_raw_unreg_event_##call(void) \
546{ \
547 unregister_trace_##call(ftrace_raw_event_##call); \
548} \
549 \
550static struct trace_event ftrace_event_type_##call = { \
551 .trace = ftrace_raw_output_##call, \
552}; \
553 \
554static int ftrace_raw_init_event_##call(void) \
555{ \
556 int id; \
557 \
558 id = register_ftrace_event(&ftrace_event_type_##call); \
559 if (!id) \
560 return -ENODEV; \
561 event_##call.id = id; \
562 INIT_LIST_HEAD(&event_##call.fields); \
563 init_preds(&event_##call); \
564 return 0; \
565} \
566 \
567static struct ftrace_event_call __used \
568__attribute__((__aligned__(4))) \
569__attribute__((section("_ftrace_events"))) event_##call = { \
570 .name = #call, \
571 .system = __stringify(TRACE_SYSTEM), \
Steven Rostedt6d723732009-04-10 14:53:50 -0400572 .event = &ftrace_event_type_##call, \
Steven Rostedtf42c85e2009-04-13 12:25:37 -0400573 .raw_init = ftrace_raw_init_event_##call, \
574 .regfunc = ftrace_raw_reg_event_##call, \
575 .unregfunc = ftrace_raw_unreg_event_##call, \
576 .show_format = ftrace_format_##call, \
577 .define_fields = ftrace_define_fields_##call, \
578 _TRACE_PROFILE_INIT(call) \
579}
580
581#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
582
583#undef _TRACE_PROFILE
584#undef _TRACE_PROFILE_INIT
585