tracing: fix softirq flag detection
PATCH RESEND 1/1 tracing: fix softirq flag detection
The 's' flag is supposed to indicate that a softirq is running. This can be detected by testing the preempt_count with SOFTIRQ_OFFSET.
The current code tests the preempt_count with SOFTIRQ_MASK, which would be true even when softirqs are disabled but not serving a softirq.
Signed-off-by Pavankumar Kondeti <[email protected]>
--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace.c +1 -1
@@ -1685,7 +1685,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,TRACE_FLAG_IRQS_NOSUPPORT | #endif ((pc &HARDIRQ_MASK ) ?TRACE_FLAG_HARDIRQ :0 ) | - ((pc &SOFTIRQ_MASK ) ?TRACE_FLAG_SOFTIRQ :0 ) | + ((pc &SOFTIRQ_OFFSET ) ?TRACE_FLAG_SOFTIRQ :0 ) | (tif_need_resched () ?TRACE_FLAG_NEED_RESCHED :0 ) | (test_preempt_need_resched() ? TRACE_FLAG_PREEMPT_RESCHED : 0); }
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.