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
768768 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
769769 struct ftrace_raw_##call *entry; \
770770 u64 __addr = 0, __count = 1; \
771− unsigned long irq_flags; \
772771 int __entry_size; \
773772 int __data_size; \
774773 int rctx; \
@@ -781,17 +780,18 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ · 6 unmodified lines
781780 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \
782781 "profile buffer not large enough")) \
783782 return; \
783+ \
784784 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); \
786786 if (!entry) \
787787 return; \
788+ \
788789 tstruct \
789790 \
790791 { assign; } \
791792 \
792793 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
793− __count, irq_flags, __regs, \
794− event_call->perf_data); \
794+ __count, __regs, event_call->perf_data); \
795795 }
796796
797797 #undef DEFINE_EVENT
@@ -799,13 +799,10 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ · 1 unmodified line
799799 static notrace void perf_trace_##call(proto) \
800800 { \
801801 struct ftrace_event_call *event_call = &event_##call; \
802− struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \
803− \
804− perf_fetch_caller_regs(__regs, 1); \
805− \
806− perf_trace_templ_##template(event_call, __regs, args); \
802+ struct pt_regs __regs; \
807803 \
808− put_cpu_var(perf_trace_regs); \
804+ perf_fetch_caller_regs(&__regs, 1); \
805+ perf_trace_templ_##template(event_call, &__regs, args); \
809806 }
810807
811808 #undef DEFINE_EVENT_PRINT