1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Stage 1 of the trace events.
5 * Override the macros in the event tracepoint header <trace/events/XXX.h>
6 * to include the following:
8 * struct trace_event_raw_<call> {
9 * struct trace_entry ent;
11 * <type2> <item2>[<len>];
15 * The <type> <item> is created by the __field(type, item) macro or
16 * the __array(type2, item2, len) macro.
17 * We simply do "type item;", and that will create the fields
21 #include <linux/trace_events.h>
23 #ifndef TRACE_SYSTEM_VAR
24 #define TRACE_SYSTEM_VAR TRACE_SYSTEM
27 #define __app__(x, y) str__##x##y
28 #define __app(x, y) __app__(x, y)
30 #define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
32 #define TRACE_MAKE_SYSTEM_STR() \
33 static const char TRACE_SYSTEM_STRING[] = \
34 __stringify(TRACE_SYSTEM)
36 TRACE_MAKE_SYSTEM_STR();
38 #undef TRACE_DEFINE_ENUM
39 #define TRACE_DEFINE_ENUM(a) \
40 static struct trace_eval_map __used __initdata \
41 __##TRACE_SYSTEM##_##a = \
43 .system = TRACE_SYSTEM_STRING, \
47 static struct trace_eval_map __used \
48 __section("_ftrace_eval_map") \
49 *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
51 #undef TRACE_DEFINE_SIZEOF
52 #define TRACE_DEFINE_SIZEOF(a) \
53 static struct trace_eval_map __used __initdata \
54 __##TRACE_SYSTEM##_##a = \
56 .system = TRACE_SYSTEM_STRING, \
57 .eval_string = "sizeof(" #a ")", \
58 .eval_value = sizeof(a) \
60 static struct trace_eval_map __used \
61 __section("_ftrace_eval_map") \
62 *TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
65 * DECLARE_EVENT_CLASS can be used to add a generic function
66 * handlers for events. That is, if all events have the same
67 * parameters and just have distinct trace points.
68 * Each tracepoint can be defined with DEFINE_EVENT and that
69 * will map the DECLARE_EVENT_CLASS to the tracepoint.
71 * TRACE_EVENT is a one to one mapping between tracepoint and template.
74 #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
75 DECLARE_EVENT_CLASS(name, \
81 DEFINE_EVENT(name, name, PARAMS(proto), PARAMS(args));
85 #define __field(type, item) type item;
88 #define __field_ext(type, item, filter_type) type item;
91 #define __field_struct(type, item) type item;
93 #undef __field_struct_ext
94 #define __field_struct_ext(type, item, filter_type) type item;
97 #define __array(type, item, len) type item[len];
99 #undef __dynamic_array
100 #define __dynamic_array(type, item, len) u32 __data_loc_##item;
103 #define __string(item, src) __dynamic_array(char, item, -1)
106 #define __string_len(item, src, len) __dynamic_array(char, item, -1)
109 #define __bitmask(item, nr_bits) __dynamic_array(char, item, -1)
111 #undef TP_STRUCT__entry
112 #define TP_STRUCT__entry(args...) args
114 #undef DECLARE_EVENT_CLASS
115 #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \
116 struct trace_event_raw_##name { \
117 struct trace_entry ent; \
122 static struct trace_event_class event_class_##name;
125 #define DEFINE_EVENT(template, name, proto, args) \
126 static struct trace_event_call __used \
127 __attribute__((__aligned__(4))) event_##name
129 #undef DEFINE_EVENT_FN
130 #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \
131 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
133 #undef DEFINE_EVENT_PRINT
134 #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
135 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
137 /* Callbacks are meaningless to ftrace. */
138 #undef TRACE_EVENT_FN
139 #define TRACE_EVENT_FN(name, proto, args, tstruct, \
140 assign, print, reg, unreg) \
141 TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \
142 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \
144 #undef TRACE_EVENT_FN_COND
145 #define TRACE_EVENT_FN_COND(name, proto, args, cond, tstruct, \
146 assign, print, reg, unreg) \
147 TRACE_EVENT_CONDITION(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \
148 PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \
150 #undef TRACE_EVENT_FLAGS
151 #define TRACE_EVENT_FLAGS(name, value) \
152 __TRACE_EVENT_FLAGS(name, value)
154 #undef TRACE_EVENT_PERF_PERM
155 #define TRACE_EVENT_PERF_PERM(name, expr...) \
156 __TRACE_EVENT_PERF_PERM(name, expr)
158 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
161 * Stage 2 of the trace events.
163 * Include the following:
165 * struct trace_event_data_offsets_<call> {
171 * The __dynamic_array() macro will create each u32 <item>, this is
172 * to keep the offset of each array from the beginning of the event.
173 * The size of an array is also encoded, in the higher 16 bits of <item>.
176 #undef TRACE_DEFINE_ENUM
177 #define TRACE_DEFINE_ENUM(a)
179 #undef TRACE_DEFINE_SIZEOF
180 #define TRACE_DEFINE_SIZEOF(a)
183 #define __field(type, item)
186 #define __field_ext(type, item, filter_type)
188 #undef __field_struct
189 #define __field_struct(type, item)
191 #undef __field_struct_ext
192 #define __field_struct_ext(type, item, filter_type)
195 #define __array(type, item, len)
197 #undef __dynamic_array
198 #define __dynamic_array(type, item, len) u32 item;
201 #define __string(item, src) __dynamic_array(char, item, -1)
204 #define __string_len(item, src, len) __dynamic_array(char, item, -1)
207 #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
209 #undef DECLARE_EVENT_CLASS
210 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
211 struct trace_event_data_offsets_##call { \
216 #define DEFINE_EVENT(template, name, proto, args)
218 #undef DEFINE_EVENT_PRINT
219 #define DEFINE_EVENT_PRINT(template, name, proto, args, print)
221 #undef TRACE_EVENT_FLAGS
222 #define TRACE_EVENT_FLAGS(event, flag)
224 #undef TRACE_EVENT_PERF_PERM
225 #define TRACE_EVENT_PERF_PERM(event, expr...)
227 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
230 * Stage 3 of the trace events.
232 * Override the macros in the event tracepoint header <trace/events/XXX.h>
233 * to include the following:
236 * trace_raw_output_<call>(struct trace_iterator *iter, int flags)
238 * struct trace_seq *s = &iter->seq;
239 * struct trace_event_raw_<call> *field; <-- defined in stage 1
240 * struct trace_seq *p = &iter->tmp_seq;
242 * -------(for event)-------
244 * struct trace_entry *entry;
248 * if (entry->type != event_<call>->event.type) {
250 * return TRACE_TYPE_UNHANDLED;
253 * field = (typeof(field))entry;
256 * return trace_output_call(iter, <call>, <TP_printk> "\n");
258 * ------(or, for event class)------
262 * field = (typeof(field))iter->ent;
264 * ret = trace_raw_output_prep(iter, trace_event);
265 * if (ret != TRACE_TYPE_HANDLED)
268 * trace_event_printf(iter, <TP_printk> "\n");
270 * return trace_handle_return(s);
274 * This is the method used to print the raw event to the trace
275 * output format. Note, this is not needed if the data is read
280 #define __entry field
283 #define TP_printk(fmt, args...) fmt "\n", args
285 #undef __get_dynamic_array
286 #define __get_dynamic_array(field) \
287 ((void *)__entry + (__entry->__data_loc_##field & 0xffff))
289 #undef __get_dynamic_array_len
290 #define __get_dynamic_array_len(field) \
291 ((__entry->__data_loc_##field >> 16) & 0xffff)
294 #define __get_str(field) ((char *)__get_dynamic_array(field))
297 #define __get_bitmask(field) \
299 void *__bitmask = __get_dynamic_array(field); \
300 unsigned int __bitmask_size; \
301 __bitmask_size = __get_dynamic_array_len(field); \
302 trace_print_bitmask_seq(p, __bitmask, __bitmask_size); \
306 #define __print_flags(flag, delim, flag_array...) \
308 static const struct trace_print_flags __flags[] = \
309 { flag_array, { -1, NULL }}; \
310 trace_print_flags_seq(p, delim, flag, __flags); \
313 #undef __print_symbolic
314 #define __print_symbolic(value, symbol_array...) \
316 static const struct trace_print_flags symbols[] = \
317 { symbol_array, { -1, NULL }}; \
318 trace_print_symbols_seq(p, value, symbols); \
321 #undef __print_flags_u64
322 #undef __print_symbolic_u64
323 #if BITS_PER_LONG == 32
324 #define __print_flags_u64(flag, delim, flag_array...) \
326 static const struct trace_print_flags_u64 __flags[] = \
327 { flag_array, { -1, NULL } }; \
328 trace_print_flags_seq_u64(p, delim, flag, __flags); \
331 #define __print_symbolic_u64(value, symbol_array...) \
333 static const struct trace_print_flags_u64 symbols[] = \
334 { symbol_array, { -1, NULL } }; \
335 trace_print_symbols_seq_u64(p, value, symbols); \
338 #define __print_flags_u64(flag, delim, flag_array...) \
339 __print_flags(flag, delim, flag_array)
341 #define __print_symbolic_u64(value, symbol_array...) \
342 __print_symbolic(value, symbol_array)
346 #define __print_hex(buf, buf_len) \
347 trace_print_hex_seq(p, buf, buf_len, false)
349 #undef __print_hex_str
350 #define __print_hex_str(buf, buf_len) \
351 trace_print_hex_seq(p, buf, buf_len, true)
354 #define __print_array(array, count, el_size) \
356 BUILD_BUG_ON(el_size != 1 && el_size != 2 && \
357 el_size != 4 && el_size != 8); \
358 trace_print_array_seq(p, array, count, el_size); \
361 #undef __print_hex_dump
362 #define __print_hex_dump(prefix_str, prefix_type, \
363 rowsize, groupsize, buf, len, ascii) \
364 trace_print_hex_dump_seq(p, prefix_str, prefix_type, \
365 rowsize, groupsize, buf, len, ascii)
367 #undef __print_ns_to_secs
368 #define __print_ns_to_secs(value) \
370 u64 ____val = (u64)(value); \
371 do_div(____val, NSEC_PER_SEC); \
375 #undef __print_ns_without_secs
376 #define __print_ns_without_secs(value) \
378 u64 ____val = (u64)(value); \
379 (u32) do_div(____val, NSEC_PER_SEC); \
382 #undef DECLARE_EVENT_CLASS
383 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
384 static notrace enum print_line_t \
385 trace_raw_output_##call(struct trace_iterator *iter, int flags, \
386 struct trace_event *trace_event) \
388 struct trace_seq *s = &iter->seq; \
389 struct trace_seq __maybe_unused *p = &iter->tmp_seq; \
390 struct trace_event_raw_##call *field; \
393 field = (typeof(field))iter->ent; \
395 ret = trace_raw_output_prep(iter, trace_event); \
396 if (ret != TRACE_TYPE_HANDLED) \
399 trace_event_printf(iter, print); \
401 return trace_handle_return(s); \
403 static struct trace_event_functions trace_event_type_funcs_##call = { \
404 .trace = trace_raw_output_##call, \
407 #undef DEFINE_EVENT_PRINT
408 #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
409 static notrace enum print_line_t \
410 trace_raw_output_##call(struct trace_iterator *iter, int flags, \
411 struct trace_event *event) \
413 struct trace_event_raw_##template *field; \
414 struct trace_entry *entry; \
415 struct trace_seq *p = &iter->tmp_seq; \
419 if (entry->type != event_##call.event.type) { \
421 return TRACE_TYPE_UNHANDLED; \
424 field = (typeof(field))entry; \
427 return trace_output_call(iter, #call, print); \
429 static struct trace_event_functions trace_event_type_funcs_##call = { \
430 .trace = trace_raw_output_##call, \
433 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
436 #define __field_ext(_type, _item, _filter_type) { \
437 .type = #_type, .name = #_item, \
438 .size = sizeof(_type), .align = __alignof__(_type), \
439 .is_signed = is_signed_type(_type), .filter_type = _filter_type },
441 #undef __field_struct_ext
442 #define __field_struct_ext(_type, _item, _filter_type) { \
443 .type = #_type, .name = #_item, \
444 .size = sizeof(_type), .align = __alignof__(_type), \
445 0, .filter_type = _filter_type },
448 #define __field(type, item) __field_ext(type, item, FILTER_OTHER)
450 #undef __field_struct
451 #define __field_struct(type, item) __field_struct_ext(type, item, FILTER_OTHER)
454 #define __array(_type, _item, _len) { \
455 .type = #_type"["__stringify(_len)"]", .name = #_item, \
456 .size = sizeof(_type[_len]), .align = __alignof__(_type), \
457 .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER },
459 #undef __dynamic_array
460 #define __dynamic_array(_type, _item, _len) { \
461 .type = "__data_loc " #_type "[]", .name = #_item, \
462 .size = 4, .align = 4, \
463 .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER },
466 #define __string(item, src) __dynamic_array(char, item, -1)
469 #define __string_len(item, src, len) __dynamic_array(char, item, -1)
472 #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
474 #undef DECLARE_EVENT_CLASS
475 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
476 static struct trace_event_fields trace_event_fields_##call[] = { \
480 #undef DEFINE_EVENT_PRINT
481 #define DEFINE_EVENT_PRINT(template, name, proto, args, print)
483 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
486 * remember the offset of each array from the beginning of the event.
490 #define __entry entry
493 #define __field(type, item)
496 #define __field_ext(type, item, filter_type)
498 #undef __field_struct
499 #define __field_struct(type, item)
501 #undef __field_struct_ext
502 #define __field_struct_ext(type, item, filter_type)
505 #define __array(type, item, len)
507 #undef __dynamic_array
508 #define __dynamic_array(type, item, len) \
509 __item_length = (len) * sizeof(type); \
510 __data_offsets->item = __data_size + \
511 offsetof(typeof(*entry), __data); \
512 __data_offsets->item |= __item_length << 16; \
513 __data_size += __item_length;
516 #define __string(item, src) __dynamic_array(char, item, \
517 strlen((src) ? (const char *)(src) : "(null)") + 1)
520 #define __string_len(item, src, len) __dynamic_array(char, item, (len) + 1)
523 * __bitmask_size_in_bytes_raw is the number of bytes needed to hold
524 * num_possible_cpus().
526 #define __bitmask_size_in_bytes_raw(nr_bits) \
527 (((nr_bits) + 7) / 8)
529 #define __bitmask_size_in_longs(nr_bits) \
530 ((__bitmask_size_in_bytes_raw(nr_bits) + \
531 ((BITS_PER_LONG / 8) - 1)) / (BITS_PER_LONG / 8))
534 * __bitmask_size_in_bytes is the number of bytes needed to hold
535 * num_possible_cpus() padded out to the nearest long. This is what
536 * is saved in the buffer, just to be consistent.
538 #define __bitmask_size_in_bytes(nr_bits) \
539 (__bitmask_size_in_longs(nr_bits) * (BITS_PER_LONG / 8))
542 #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, \
543 __bitmask_size_in_longs(nr_bits))
545 #undef DECLARE_EVENT_CLASS
546 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
547 static inline notrace int trace_event_get_offsets_##call( \
548 struct trace_event_data_offsets_##call *__data_offsets, proto) \
550 int __data_size = 0; \
551 int __maybe_unused __item_length; \
552 struct trace_event_raw_##call __maybe_unused *entry; \
556 return __data_size; \
559 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
562 * Stage 4 of the trace events.
564 * Override the macros in the event tracepoint header <trace/events/XXX.h>
565 * to include the following:
567 * For those macros defined with TRACE_EVENT:
569 * static struct trace_event_call event_<call>;
571 * static void trace_event_raw_event_<call>(void *__data, proto)
573 * struct trace_event_file *trace_file = __data;
574 * struct trace_event_call *event_call = trace_file->event_call;
575 * struct trace_event_data_offsets_<call> __maybe_unused __data_offsets;
576 * unsigned long eflags = trace_file->flags;
577 * enum event_trigger_type __tt = ETT_NONE;
578 * struct ring_buffer_event *event;
579 * struct trace_event_raw_<call> *entry; <-- defined in stage 1
580 * struct trace_buffer *buffer;
581 * unsigned long irq_flags;
585 * if (!(eflags & EVENT_FILE_FL_TRIGGER_COND)) {
586 * if (eflags & EVENT_FILE_FL_TRIGGER_MODE)
587 * event_triggers_call(trace_file, NULL);
588 * if (eflags & EVENT_FILE_FL_SOFT_DISABLED)
592 * local_save_flags(irq_flags);
593 * pc = preempt_count();
595 * __data_size = trace_event_get_offsets_<call>(&__data_offsets, args);
597 * event = trace_event_buffer_lock_reserve(&buffer, trace_file,
598 * event_<call>->event.type,
599 * sizeof(*entry) + __data_size,
603 * entry = ring_buffer_event_data(event);
605 * { <assign>; } <-- Here we assign the entries by the __field and
608 * if (eflags & EVENT_FILE_FL_TRIGGER_COND)
609 * __tt = event_triggers_call(trace_file, entry);
611 * if (test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT,
612 * &trace_file->flags))
613 * ring_buffer_discard_commit(buffer, event);
614 * else if (!filter_check_discard(trace_file, entry, buffer, event))
615 * trace_buffer_unlock_commit(buffer, event, irq_flags, pc);
618 * event_triggers_post_call(trace_file, __tt);
621 * static struct trace_event ftrace_event_type_<call> = {
622 * .trace = trace_raw_output_<call>, <-- stage 2
625 * static char print_fmt_<call>[] = <TP_printk>;
627 * static struct trace_event_class __used event_class_<template> = {
628 * .system = "<system>",
629 * .fields_array = trace_event_fields_<call>,
630 * .fields = LIST_HEAD_INIT(event_class_##call.fields),
631 * .raw_init = trace_event_raw_init,
632 * .probe = trace_event_raw_event_##call,
633 * .reg = trace_event_reg,
636 * static struct trace_event_call event_<call> = {
637 * .class = event_class_<template>,
639 * .tp = &__tracepoint_<call>,
641 * .event = &ftrace_event_type_<call>,
642 * .print_fmt = print_fmt_<call>,
643 * .flags = TRACE_EVENT_FL_TRACEPOINT,
645 * // its only safe to use pointers when doing linker tricks to
646 * // create an array.
647 * static struct trace_event_call __used
648 * __section("_ftrace_events") *__event_<call> = &event_<call>;
652 #ifdef CONFIG_PERF_EVENTS
654 #define _TRACE_PERF_PROTO(call, proto) \
655 static notrace void \
656 perf_trace_##call(void *__data, proto);
658 #define _TRACE_PERF_INIT(call) \
659 .perf_probe = perf_trace_##call,
662 #define _TRACE_PERF_PROTO(call, proto)
663 #define _TRACE_PERF_INIT(call)
664 #endif /* CONFIG_PERF_EVENTS */
667 #define __entry entry
670 #define __field(type, item)
672 #undef __field_struct
673 #define __field_struct(type, item)
676 #define __array(type, item, len)
678 #undef __dynamic_array
679 #define __dynamic_array(type, item, len) \
680 __entry->__data_loc_##item = __data_offsets.item;
683 #define __string(item, src) __dynamic_array(char, item, -1)
686 #define __string_len(item, src, len) __dynamic_array(char, item, -1)
689 #define __assign_str(dst, src) \
690 strcpy(__get_str(dst), (src) ? (const char *)(src) : "(null)");
692 #undef __assign_str_len
693 #define __assign_str_len(dst, src, len) \
695 memcpy(__get_str(dst), (src), (len)); \
696 __get_str(dst)[len] = '\0'; \
700 #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
703 #define __get_bitmask(field) (char *)__get_dynamic_array(field)
705 #undef __assign_bitmask
706 #define __assign_bitmask(dst, src, nr_bits) \
707 memcpy(__get_bitmask(dst), (src), __bitmask_size_in_bytes(nr_bits))
709 #undef TP_fast_assign
710 #define TP_fast_assign(args...) args
713 #define __perf_count(c) (c)
716 #define __perf_task(t) (t)
718 #undef DECLARE_EVENT_CLASS
719 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
721 static notrace void \
722 trace_event_raw_event_##call(void *__data, proto) \
724 struct trace_event_file *trace_file = __data; \
725 struct trace_event_data_offsets_##call __maybe_unused __data_offsets;\
726 struct trace_event_buffer fbuffer; \
727 struct trace_event_raw_##call *entry; \
730 if (trace_trigger_soft_disabled(trace_file)) \
733 __data_size = trace_event_get_offsets_##call(&__data_offsets, args); \
735 entry = trace_event_buffer_reserve(&fbuffer, trace_file, \
736 sizeof(*entry) + __data_size); \
745 trace_event_buffer_commit(&fbuffer); \
748 * The ftrace_test_probe is compiled out, it is only here as a build time check
749 * to make sure that if the tracepoint handling changes, the ftrace probe will
750 * fail to compile unless it too is updated.
754 #define DEFINE_EVENT(template, call, proto, args) \
755 static inline void ftrace_test_probe_##call(void) \
757 check_trace_callback_type_##call(trace_event_raw_event_##template); \
760 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
766 #undef __print_symbolic
768 #undef __print_hex_str
769 #undef __get_dynamic_array
770 #undef __get_dynamic_array_len
774 #undef __print_hex_dump
777 * The below is not executed in the kernel. It is only what is
778 * displayed in the print format for userspace to parse.
780 #undef __print_ns_to_secs
781 #define __print_ns_to_secs(val) (val) / 1000000000UL
783 #undef __print_ns_without_secs
784 #define __print_ns_without_secs(val) (val) % 1000000000UL
787 #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args)
789 #undef DECLARE_EVENT_CLASS
790 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
791 _TRACE_PERF_PROTO(call, PARAMS(proto)); \
792 static char print_fmt_##call[] = print; \
793 static struct trace_event_class __used __refdata event_class_##call = { \
794 .system = TRACE_SYSTEM_STRING, \
795 .fields_array = trace_event_fields_##call, \
796 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
797 .raw_init = trace_event_raw_init, \
798 .probe = trace_event_raw_event_##call, \
799 .reg = trace_event_reg, \
800 _TRACE_PERF_INIT(call) \
804 #define DEFINE_EVENT(template, call, proto, args) \
806 static struct trace_event_call __used event_##call = { \
807 .class = &event_class_##template, \
809 .tp = &__tracepoint_##call, \
811 .event.funcs = &trace_event_type_funcs_##template, \
812 .print_fmt = print_fmt_##template, \
813 .flags = TRACE_EVENT_FL_TRACEPOINT, \
815 static struct trace_event_call __used \
816 __section("_ftrace_events") *__event_##call = &event_##call
818 #undef DEFINE_EVENT_PRINT
819 #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
821 static char print_fmt_##call[] = print; \
823 static struct trace_event_call __used event_##call = { \
824 .class = &event_class_##template, \
826 .tp = &__tracepoint_##call, \
828 .event.funcs = &trace_event_type_funcs_##call, \
829 .print_fmt = print_fmt_##call, \
830 .flags = TRACE_EVENT_FL_TRACEPOINT, \
832 static struct trace_event_call __used \
833 __section("_ftrace_events") *__event_##call = &event_##call
835 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)