History

perf, trace: Optimize tracepoints by removing IRQ-disable from perf/tracepoint interaction

Improves performance.

Peter Zijlstra committed 16 years ago

Commit b7e2ece1 parent 1c34bde5 files · +47 −72Browse files

Showing the changes to include/trace (1 of 5 files). Show all

Unified · Split

include/trace/ftrace.h+7−10
@@ -768,7 +768,6 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ · 767 unmodified lines
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; \
772 int __entry_size; \771 int __entry_size; \
773 int __data_size; \772 int __data_size; \
774 int rctx; \773 int rctx; \
@@ -781,17 +780,18 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ · 6 unmodified lines
781 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \780 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \
782 "profile buffer not large enough")) \781 "profile buffer not large enough")) \
783 return; \782 return; \
783 \
784 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \784 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
785 __entry_size, event_call->id, &rctx, &irq_flags); \785 __entry_size, event_call->id, __regs, &rctx); \
786 if (!entry) \786 if (!entry) \
787 return; \787 return; \
788 \
788 tstruct \789 tstruct \
789 \790 \
790 { assign; } \791 { assign; } \
791 \792 \
792 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \793 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
793 __count, irq_flags, __regs, \794 __count, __regs, event_call->perf_data); \
794 event_call->perf_data); \
795}795}
796 796
797#undef DEFINE_EVENT797#undef DEFINE_EVENT
@@ -799,13 +799,10 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ · 1 unmodified line
799static notrace void perf_trace_##call(proto) \799static notrace void perf_trace_##call(proto) \
800{ \800{ \
801 struct ftrace_event_call *event_call = &event_##call; \801 struct ftrace_event_call *event_call = &event_##call; \
802 struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \802 struct pt_regs __regs; \
803 \
804 perf_fetch_caller_regs(__regs, 1); \
805 \
806 perf_trace_templ_##template(event_call, __regs, args); \
807 \803 \
808 put_cpu_var(perf_trace_regs); \804 perf_fetch_caller_regs(&__regs, 1); \
805 perf_trace_templ_##template(event_call, &__regs, args); \
809}806}
810 807
811#undef DEFINE_EVENT_PRINT808#undef DEFINE_EVENT_PRINT