diff options
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r-- | include/trace/ftrace.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index e16610c208c9..3e68366d485a 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -446,14 +446,16 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
446 | * .reg = ftrace_event_reg, | 446 | * .reg = ftrace_event_reg, |
447 | * }; | 447 | * }; |
448 | * | 448 | * |
449 | * static struct ftrace_event_call __used | 449 | * static struct ftrace_event_call event_<call> = { |
450 | * __attribute__((__aligned__(4))) | ||
451 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
452 | * .name = "<call>", | 450 | * .name = "<call>", |
453 | * .class = event_class_<template>, | 451 | * .class = event_class_<template>, |
454 | * .event = &ftrace_event_type_<call>, | 452 | * .event = &ftrace_event_type_<call>, |
455 | * .print_fmt = print_fmt_<call>, | 453 | * .print_fmt = print_fmt_<call>, |
456 | * }; | 454 | * }; |
455 | * // its only safe to use pointers when doing linker tricks to | ||
456 | * // create an array. | ||
457 | * static struct ftrace_event_call __used | ||
458 | * __attribute__((section("_ftrace_events"))) *__event_<call> = &event_<call>; | ||
457 | * | 459 | * |
458 | */ | 460 | */ |
459 | 461 | ||
@@ -579,28 +581,28 @@ static struct ftrace_event_class __used event_class_##call = { \ | |||
579 | #undef DEFINE_EVENT | 581 | #undef DEFINE_EVENT |
580 | #define DEFINE_EVENT(template, call, proto, args) \ | 582 | #define DEFINE_EVENT(template, call, proto, args) \ |
581 | \ | 583 | \ |
582 | static struct ftrace_event_call __used \ | 584 | static struct ftrace_event_call __used event_##call = { \ |
583 | __attribute__((__aligned__(4))) \ | ||
584 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
585 | .name = #call, \ | 585 | .name = #call, \ |
586 | .class = &event_class_##template, \ | 586 | .class = &event_class_##template, \ |
587 | .event.funcs = &ftrace_event_type_funcs_##template, \ | 587 | .event.funcs = &ftrace_event_type_funcs_##template, \ |
588 | .print_fmt = print_fmt_##template, \ | 588 | .print_fmt = print_fmt_##template, \ |
589 | }; | 589 | }; \ |
590 | static struct ftrace_event_call __used \ | ||
591 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | ||
590 | 592 | ||
591 | #undef DEFINE_EVENT_PRINT | 593 | #undef DEFINE_EVENT_PRINT |
592 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 594 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
593 | \ | 595 | \ |
594 | static const char print_fmt_##call[] = print; \ | 596 | static const char print_fmt_##call[] = print; \ |
595 | \ | 597 | \ |
596 | static struct ftrace_event_call __used \ | 598 | static struct ftrace_event_call __used event_##call = { \ |
597 | __attribute__((__aligned__(4))) \ | ||
598 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
599 | .name = #call, \ | 599 | .name = #call, \ |
600 | .class = &event_class_##template, \ | 600 | .class = &event_class_##template, \ |
601 | .event.funcs = &ftrace_event_type_funcs_##call, \ | 601 | .event.funcs = &ftrace_event_type_funcs_##call, \ |
602 | .print_fmt = print_fmt_##call, \ | 602 | .print_fmt = print_fmt_##call, \ |
603 | } | 603 | }; \ |
604 | static struct ftrace_event_call __used \ | ||
605 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | ||
604 | 606 | ||
605 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 607 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
606 | 608 | ||