aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/ftrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r--include/trace/ftrace.h56
1 files changed, 6 insertions, 50 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index d1b3de9c1a71..73523151a731 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -436,10 +436,6 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
436 struct ftrace_raw_##call field; \ 436 struct ftrace_raw_##call field; \
437 int ret; \ 437 int ret; \
438 \ 438 \
439 ret = trace_define_common_fields(event_call); \
440 if (ret) \
441 return ret; \
442 \
443 tstruct; \ 439 tstruct; \
444 \ 440 \
445 return ret; \ 441 return ret; \
@@ -559,13 +555,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
559 * 555 *
560 * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) 556 * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused)
561 * { 557 * {
562 * int ret; 558 * return register_trace_<call>(ftrace_event_<call>);
563 *
564 * ret = register_trace_<call>(ftrace_event_<call>);
565 * if (!ret)
566 * pr_info("event trace: Could not activate trace point "
567 * "probe to <call>");
568 * return ret;
569 * } 559 * }
570 * 560 *
571 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) 561 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
@@ -623,23 +613,12 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
623 * .trace = ftrace_raw_output_<call>, <-- stage 2 613 * .trace = ftrace_raw_output_<call>, <-- stage 2
624 * }; 614 * };
625 * 615 *
626 * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused)
627 * {
628 * int id;
629 *
630 * id = register_ftrace_event(&ftrace_event_type_<call>);
631 * if (!id)
632 * return -ENODEV;
633 * event_<call>.id = id;
634 * return 0;
635 * }
636 *
637 * static struct ftrace_event_call __used 616 * static struct ftrace_event_call __used
638 * __attribute__((__aligned__(4))) 617 * __attribute__((__aligned__(4)))
639 * __attribute__((section("_ftrace_events"))) event_<call> = { 618 * __attribute__((section("_ftrace_events"))) event_<call> = {
640 * .name = "<call>", 619 * .name = "<call>",
641 * .system = "<system>", 620 * .system = "<system>",
642 * .raw_init = ftrace_raw_init_event_<call>, 621 * .raw_init = trace_event_raw_init,
643 * .regfunc = ftrace_reg_event_<call>, 622 * .regfunc = ftrace_reg_event_<call>,
644 * .unregfunc = ftrace_unreg_event_<call>, 623 * .unregfunc = ftrace_unreg_event_<call>,
645 * .show_format = ftrace_format_<call>, 624 * .show_format = ftrace_format_<call>,
@@ -647,13 +626,9 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
647 * 626 *
648 */ 627 */
649 628
650#undef TP_FMT
651#define TP_FMT(fmt, args...) fmt "\n", ##args
652
653#ifdef CONFIG_EVENT_PROFILE 629#ifdef CONFIG_EVENT_PROFILE
654 630
655#define _TRACE_PROFILE_INIT(call) \ 631#define _TRACE_PROFILE_INIT(call) \
656 .profile_count = ATOMIC_INIT(-1), \
657 .profile_enable = ftrace_profile_enable_##call, \ 632 .profile_enable = ftrace_profile_enable_##call, \
658 .profile_disable = ftrace_profile_disable_##call, 633 .profile_disable = ftrace_profile_disable_##call,
659 634
@@ -728,13 +703,7 @@ static void ftrace_raw_event_##call(proto) \
728 \ 703 \
729static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ 704static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\
730{ \ 705{ \
731 int ret; \ 706 return register_trace_##call(ftrace_raw_event_##call); \
732 \
733 ret = register_trace_##call(ftrace_raw_event_##call); \
734 if (ret) \
735 pr_info("event trace: Could not activate trace point " \
736 "probe to " #call "\n"); \
737 return ret; \
738} \ 707} \
739 \ 708 \
740static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ 709static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\
@@ -744,19 +713,7 @@ static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\
744 \ 713 \
745static struct trace_event ftrace_event_type_##call = { \ 714static struct trace_event ftrace_event_type_##call = { \
746 .trace = ftrace_raw_output_##call, \ 715 .trace = ftrace_raw_output_##call, \
747}; \ 716};
748 \
749static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\
750{ \
751 int id; \
752 \
753 id = register_ftrace_event(&ftrace_event_type_##call); \
754 if (!id) \
755 return -ENODEV; \
756 event_##call.id = id; \
757 INIT_LIST_HEAD(&event_##call.fields); \
758 return 0; \
759}
760 717
761#undef DEFINE_EVENT_PRINT 718#undef DEFINE_EVENT_PRINT
762#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ 719#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
@@ -776,7 +733,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
776 .name = #call, \ 733 .name = #call, \
777 .system = __stringify(TRACE_SYSTEM), \ 734 .system = __stringify(TRACE_SYSTEM), \
778 .event = &ftrace_event_type_##call, \ 735 .event = &ftrace_event_type_##call, \
779 .raw_init = ftrace_raw_init_event_##call, \ 736 .raw_init = trace_event_raw_init, \
780 .regfunc = ftrace_raw_reg_event_##call, \ 737 .regfunc = ftrace_raw_reg_event_##call, \
781 .unregfunc = ftrace_raw_unreg_event_##call, \ 738 .unregfunc = ftrace_raw_unreg_event_##call, \
782 .show_format = ftrace_format_##template, \ 739 .show_format = ftrace_format_##template, \
@@ -793,7 +750,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
793 .name = #call, \ 750 .name = #call, \
794 .system = __stringify(TRACE_SYSTEM), \ 751 .system = __stringify(TRACE_SYSTEM), \
795 .event = &ftrace_event_type_##call, \ 752 .event = &ftrace_event_type_##call, \
796 .raw_init = ftrace_raw_init_event_##call, \ 753 .raw_init = trace_event_raw_init, \
797 .regfunc = ftrace_raw_reg_event_##call, \ 754 .regfunc = ftrace_raw_reg_event_##call, \
798 .unregfunc = ftrace_raw_unreg_event_##call, \ 755 .unregfunc = ftrace_raw_unreg_event_##call, \
799 .show_format = ftrace_format_##call, \ 756 .show_format = ftrace_format_##call, \
@@ -953,7 +910,6 @@ end: \
953 perf_swevent_put_recursion_context(rctx); \ 910 perf_swevent_put_recursion_context(rctx); \
954end_recursion: \ 911end_recursion: \
955 local_irq_restore(irq_flags); \ 912 local_irq_restore(irq_flags); \
956 \
957} 913}
958 914
959#undef DEFINE_EVENT 915#undef DEFINE_EVENT