diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-11-23 05:37:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-23 05:49:57 -0500 |
commit | 4ed7c92d68a5387ba5f7030dc76eab03558e27f5 (patch) | |
tree | 38d758819c41261275c2dbd6f64976f824c5fd27 /include/trace | |
parent | f67218c3e93abaf0f480bb94b53d234853ffe4de (diff) |
perf_events: Undo some recursion damage
Make perf_swevent_get_recursion_context return a context number
and disable preemption.
This could be used to remove the IRQ disable from the trace bit
and index the per-cpu buffer with.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091123103819.993226816@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/ftrace.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index c222ef5238bf..c3417c13e3ed 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -724,8 +724,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
724 | static void ftrace_profile_##call(proto) \ | 724 | static void ftrace_profile_##call(proto) \ |
725 | { \ | 725 | { \ |
726 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 726 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
727 | extern int perf_swevent_get_recursion_context(int **recursion); \ | 727 | extern int perf_swevent_get_recursion_context(void); \ |
728 | extern void perf_swevent_put_recursion_context(int *recursion); \ | 728 | extern void perf_swevent_put_recursion_context(int rctx); \ |
729 | struct ftrace_event_call *event_call = &event_##call; \ | 729 | struct ftrace_event_call *event_call = &event_##call; \ |
730 | extern void perf_tp_event(int, u64, u64, void *, int); \ | 730 | extern void perf_tp_event(int, u64, u64, void *, int); \ |
731 | struct ftrace_raw_##call *entry; \ | 731 | struct ftrace_raw_##call *entry; \ |
@@ -736,8 +736,8 @@ static void ftrace_profile_##call(proto) \ | |||
736 | int __data_size; \ | 736 | int __data_size; \ |
737 | char *trace_buf; \ | 737 | char *trace_buf; \ |
738 | char *raw_data; \ | 738 | char *raw_data; \ |
739 | int *recursion; \ | ||
740 | int __cpu; \ | 739 | int __cpu; \ |
740 | int rctx; \ | ||
741 | int pc; \ | 741 | int pc; \ |
742 | \ | 742 | \ |
743 | pc = preempt_count(); \ | 743 | pc = preempt_count(); \ |
@@ -753,8 +753,9 @@ static void ftrace_profile_##call(proto) \ | |||
753 | \ | 753 | \ |
754 | local_irq_save(irq_flags); \ | 754 | local_irq_save(irq_flags); \ |
755 | \ | 755 | \ |
756 | if (perf_swevent_get_recursion_context(&recursion)) \ | 756 | rctx = perf_swevent_get_recursion_context(); \ |
757 | goto end_recursion; \ | 757 | if (rctx < 0) \ |
758 | goto end_recursion; \ | ||
758 | \ | 759 | \ |
759 | __cpu = smp_processor_id(); \ | 760 | __cpu = smp_processor_id(); \ |
760 | \ | 761 | \ |
@@ -781,9 +782,9 @@ static void ftrace_profile_##call(proto) \ | |||
781 | perf_tp_event(event_call->id, __addr, __count, entry, \ | 782 | perf_tp_event(event_call->id, __addr, __count, entry, \ |
782 | __entry_size); \ | 783 | __entry_size); \ |
783 | \ | 784 | \ |
784 | end: \ | 785 | end: \ |
785 | perf_swevent_put_recursion_context(recursion); \ | 786 | perf_swevent_put_recursion_context(rctx); \ |
786 | end_recursion: \ | 787 | end_recursion: \ |
787 | local_irq_restore(irq_flags); \ | 788 | local_irq_restore(irq_flags); \ |
788 | \ | 789 | \ |
789 | } | 790 | } |