diff options
Diffstat (limited to 'include/trace/ftrace.h')
-rw-r--r-- | include/trace/ftrace.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 139b5067345b..41bf65f04dd9 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -263,6 +263,14 @@ | |||
263 | #undef __print_hex | 263 | #undef __print_hex |
264 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) | 264 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) |
265 | 265 | ||
266 | #undef __print_array | ||
267 | #define __print_array(array, count, el_size) \ | ||
268 | ({ \ | ||
269 | BUILD_BUG_ON(el_size != 1 && el_size != 2 && \ | ||
270 | el_size != 4 && el_size != 8); \ | ||
271 | ftrace_print_array_seq(p, array, count, el_size); \ | ||
272 | }) | ||
273 | |||
266 | #undef DECLARE_EVENT_CLASS | 274 | #undef DECLARE_EVENT_CLASS |
267 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 275 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
268 | static notrace enum print_line_t \ | 276 | static notrace enum print_line_t \ |
@@ -674,6 +682,7 @@ static inline void ftrace_test_probe_##call(void) \ | |||
674 | #undef __get_dynamic_array_len | 682 | #undef __get_dynamic_array_len |
675 | #undef __get_str | 683 | #undef __get_str |
676 | #undef __get_bitmask | 684 | #undef __get_bitmask |
685 | #undef __print_array | ||
677 | 686 | ||
678 | #undef TP_printk | 687 | #undef TP_printk |
679 | #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args) | 688 | #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args) |
@@ -763,7 +772,7 @@ perf_trace_##call(void *__data, proto) \ | |||
763 | struct ftrace_event_call *event_call = __data; \ | 772 | struct ftrace_event_call *event_call = __data; \ |
764 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 773 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
765 | struct ftrace_raw_##call *entry; \ | 774 | struct ftrace_raw_##call *entry; \ |
766 | struct pt_regs __regs; \ | 775 | struct pt_regs *__regs; \ |
767 | u64 __addr = 0, __count = 1; \ | 776 | u64 __addr = 0, __count = 1; \ |
768 | struct task_struct *__task = NULL; \ | 777 | struct task_struct *__task = NULL; \ |
769 | struct hlist_head *head; \ | 778 | struct hlist_head *head; \ |
@@ -782,18 +791,19 @@ perf_trace_##call(void *__data, proto) \ | |||
782 | sizeof(u64)); \ | 791 | sizeof(u64)); \ |
783 | __entry_size -= sizeof(u32); \ | 792 | __entry_size -= sizeof(u32); \ |
784 | \ | 793 | \ |
785 | perf_fetch_caller_regs(&__regs); \ | ||
786 | entry = perf_trace_buf_prepare(__entry_size, \ | 794 | entry = perf_trace_buf_prepare(__entry_size, \ |
787 | event_call->event.type, &__regs, &rctx); \ | 795 | event_call->event.type, &__regs, &rctx); \ |
788 | if (!entry) \ | 796 | if (!entry) \ |
789 | return; \ | 797 | return; \ |
790 | \ | 798 | \ |
799 | perf_fetch_caller_regs(__regs); \ | ||
800 | \ | ||
791 | tstruct \ | 801 | tstruct \ |
792 | \ | 802 | \ |
793 | { assign; } \ | 803 | { assign; } \ |
794 | \ | 804 | \ |
795 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ | 805 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
796 | __count, &__regs, head, __task); \ | 806 | __count, __regs, head, __task); \ |
797 | } | 807 | } |
798 | 808 | ||
799 | /* | 809 | /* |