diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-04-20 13:24:21 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-04-20 13:24:21 -0400 |
commit | 17487bfeb6cfb05920e6a9d5a54f345f2917b4e7 (patch) | |
tree | 23064df0a7814788823484098450cb2924ff9a34 /kernel | |
parent | 23de29de2d8b227943be191d59fb6d983996d55e (diff) |
tracing: fix recursive test level calculation
The recursive tests to detect same level recursion in the ring buffers
did not account for the hard/softirq_counts to be shifted. Thus the
numbers could be larger than then mask to be tested.
This patch includes the shift for the calculation of the irq depth.
[ Impact: stop false positives in trace recursion detection ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ring_buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index e145969a8eda..aa40ae92233b 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -1483,7 +1483,9 @@ rb_reserve_next_event(struct ring_buffer_per_cpu *cpu_buffer, | |||
1483 | 1483 | ||
1484 | static int trace_irq_level(void) | 1484 | static int trace_irq_level(void) |
1485 | { | 1485 | { |
1486 | return hardirq_count() + softirq_count() + in_nmi(); | 1486 | return (hardirq_count() >> HARDIRQ_SHIFT) + |
1487 | (softirq_count() >> + SOFTIRQ_SHIFT) + | ||
1488 | !!in_nmi(); | ||
1487 | } | 1489 | } |
1488 | 1490 | ||
1489 | static int trace_recursive_lock(void) | 1491 | static int trace_recursive_lock(void) |