diff options
Diffstat (limited to 'include/trace/ftrace.h')
| -rw-r--r-- | include/trace/ftrace.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 75dd7787fb37..16253db38d73 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -763,13 +763,12 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 763 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 763 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 764 | static notrace void \ | 764 | static notrace void \ |
| 765 | perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | 765 | perf_trace_templ_##call(struct ftrace_event_call *event_call, \ |
| 766 | proto) \ | 766 | struct pt_regs *__regs, proto) \ |
| 767 | { \ | 767 | { \ |
| 768 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 768 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
| 769 | struct ftrace_raw_##call *entry; \ | 769 | struct ftrace_raw_##call *entry; \ |
| 770 | u64 __addr = 0, __count = 1; \ | 770 | u64 __addr = 0, __count = 1; \ |
| 771 | unsigned long irq_flags; \ | 771 | unsigned long irq_flags; \ |
| 772 | struct pt_regs *__regs; \ | ||
| 773 | int __entry_size; \ | 772 | int __entry_size; \ |
| 774 | int __data_size; \ | 773 | int __data_size; \ |
| 775 | int rctx; \ | 774 | int rctx; \ |
| @@ -790,20 +789,22 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | |||
| 790 | \ | 789 | \ |
| 791 | { assign; } \ | 790 | { assign; } \ |
| 792 | \ | 791 | \ |
| 793 | __regs = &__get_cpu_var(perf_trace_regs); \ | ||
| 794 | perf_fetch_caller_regs(__regs, 2); \ | ||
| 795 | \ | ||
| 796 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ | 792 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
| 797 | __count, irq_flags, __regs); \ | 793 | __count, irq_flags, __regs); \ |
| 798 | } | 794 | } |
| 799 | 795 | ||
| 800 | #undef DEFINE_EVENT | 796 | #undef DEFINE_EVENT |
| 801 | #define DEFINE_EVENT(template, call, proto, args) \ | 797 | #define DEFINE_EVENT(template, call, proto, args) \ |
| 802 | static notrace void perf_trace_##call(proto) \ | 798 | static notrace void perf_trace_##call(proto) \ |
| 803 | { \ | 799 | { \ |
| 804 | struct ftrace_event_call *event_call = &event_##call; \ | 800 | struct ftrace_event_call *event_call = &event_##call; \ |
| 805 | \ | 801 | struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \ |
| 806 | perf_trace_templ_##template(event_call, args); \ | 802 | \ |
| 803 | perf_fetch_caller_regs(__regs, 1); \ | ||
| 804 | \ | ||
| 805 | perf_trace_templ_##template(event_call, __regs, args); \ | ||
| 806 | \ | ||
| 807 | put_cpu_var(perf_trace_regs); \ | ||
| 807 | } | 808 | } |
| 808 | 809 | ||
| 809 | #undef DEFINE_EVENT_PRINT | 810 | #undef DEFINE_EVENT_PRINT |
