diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-03-10 14:03:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-10 15:03:01 -0400 |
commit | 6cc3c6e12bb039047974ad2e7e2d46d15a1b762f (patch) | |
tree | 1c3ff8b51757674ead536a3220c0da14608ee267 /kernel/trace/trace_clock.c | |
parent | 2395037e5dd6841a6fa23afbb31e79d92e549cd1 (diff) |
trace_clock: fix preemption bug
Using the function_graph tracer in recent kernels generates a spew of
preemption BUGs. Fix this by not requiring trace_clock_local() users
to disable preemption themselves.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_clock.c')
-rw-r--r-- | kernel/trace/trace_clock.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c index 2d4953f93560..05b176abfd30 100644 --- a/kernel/trace/trace_clock.c +++ b/kernel/trace/trace_clock.c | |||
@@ -27,12 +27,19 @@ | |||
27 | */ | 27 | */ |
28 | u64 notrace trace_clock_local(void) | 28 | u64 notrace trace_clock_local(void) |
29 | { | 29 | { |
30 | unsigned long flags; | ||
31 | u64 clock; | ||
32 | |||
30 | /* | 33 | /* |
31 | * sched_clock() is an architecture implemented, fast, scalable, | 34 | * sched_clock() is an architecture implemented, fast, scalable, |
32 | * lockless clock. It is not guaranteed to be coherent across | 35 | * lockless clock. It is not guaranteed to be coherent across |
33 | * CPUs, nor across CPU idle events. | 36 | * CPUs, nor across CPU idle events. |
34 | */ | 37 | */ |
35 | return sched_clock(); | 38 | raw_local_irq_save(flags); |
39 | clock = sched_clock(); | ||
40 | raw_local_irq_restore(flags); | ||
41 | |||
42 | return clock; | ||
36 | } | 43 | } |
37 | 44 | ||
38 | /* | 45 | /* |