提交 17487bfe 编写于 作者: S Steven Rostedt 提交者: Steven Rostedt

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: NSteven Rostedt <rostedt@goodmis.org>
上级 23de29de
...@@ -1483,7 +1483,9 @@ rb_reserve_next_event(struct ring_buffer_per_cpu *cpu_buffer, ...@@ -1483,7 +1483,9 @@ rb_reserve_next_event(struct ring_buffer_per_cpu *cpu_buffer,
static int trace_irq_level(void) static int trace_irq_level(void)
{ {
return hardirq_count() + softirq_count() + in_nmi(); return (hardirq_count() >> HARDIRQ_SHIFT) +
(softirq_count() >> + SOFTIRQ_SHIFT) +
!!in_nmi();
} }
static int trace_recursive_lock(void) static int trace_recursive_lock(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册