From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933955AbcLIQVG (ORCPT ); Fri, 9 Dec 2016 11:21:06 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:51924 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933204AbcLIQUg (ORCPT ); Fri, 9 Dec 2016 11:20:36 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 577866159D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=pkondeti@codeaurora.org From: Pavankumar Kondeti To: Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org Cc: pkondeti@codeaurora.org Subject: [RESEND] [PATCH] tracing: fix softirq flag detection Date: Fri, 9 Dec 2016 21:50:17 +0530 Message-Id: <1481300417-3564-1-git-send-email-pkondeti@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ae68222..1d0f1a1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -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); } -- 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.