From patchwork Wed Jan 21 17:03:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 5679581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 20F699F50F for ; Wed, 21 Jan 2015 17:06:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 481B9204DF for ; Wed, 21 Jan 2015 17:06:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AD4220462 for ; Wed, 21 Jan 2015 17:06:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YDyhi-0007DH-J7; Wed, 21 Jan 2015 17:04:30 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YDyhS-00076n-D0 for linux-arm-kernel@lists.infradead.org; Wed, 21 Jan 2015 17:04:15 +0000 Received: by mail-wi0-f177.google.com with SMTP id r20so27141531wiv.4 for ; Wed, 21 Jan 2015 09:03:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ajuc2Vh4gQrfMTDP0TVJiOjS8mYw/r16f3b2dkDkv60=; b=StF4g/xYdTzfzgY6Y1JSIa4nkX9rtPuDUkAD70WQPNauSRYifSVbRcFPltxT9vEA9p CmtnERc6T+VjJAAM2CGhl4bDyVp389yL8tLxRWH45Q01gQUoK2lagK24VQr/LAkgI9Q8 EdCdaxWB1rZjhRxelf5HPyFY51MtlGJFFpJmupJFNc49NRMGU/cnBLuEAgVEKn84R1CD My0kG+VRK9+IXArHodqfIFUor2teOCmxx3kQPTOzuejFDG16ij3hASUHKB+PgtWB0PND UkS8SafR/Uy6rFv8JTqb4J3y0A2ijVPViCZVPgfy4Y4JojPe65V+41dfE7Nh1sUD5Gu0 113Q== X-Gm-Message-State: ALoCoQk+1EAI+0LGfb6VxgixG8E2Z89+DXIruhx+JMK8a88N5xVzYTixcH29Pd4hXrkRyLnIPlV2 X-Received: by 10.180.95.9 with SMTP id dg9mr28996548wib.1.1421859831936; Wed, 21 Jan 2015 09:03:51 -0800 (PST) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id w16sm8021260wia.15.2015.01.21.09.03.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 09:03:51 -0800 (PST) From: Daniel Thompson To: Thomas Gleixner , Jason Cooper , Russell King Subject: [RFC PATCH v2 1/5] arm: irq: Add a __nmi_count stat Date: Wed, 21 Jan 2015 17:03:38 +0000 Message-Id: <1421859822-3621-2-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421859822-3621-1-git-send-email-daniel.thompson@linaro.org> References: <1421166931-14134-1-git-send-email-daniel.thompson@linaro.org> <1421859822-3621-1-git-send-email-daniel.thompson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150121_090414_604359_F33AE4C0 X-CRM114-Status: GOOD ( 12.84 ) X-Spam-Score: -0.7 (/) Cc: Daniel Thompson , linaro-kernel@lists.linaro.org, patches@linaro.org, Will Deacon , Stephen Boyd , linux-kernel@vger.kernel.org, Daniel Drake , Dmitry Pervushin , Dirk Behme , John Stultz , Tim Sander , Sumit Semwal , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Extends the irq statistics for ARM, making it possible to quickly observe how many times the default FIQ handler has executed. In /proc/interrupts we use the NMI terminology (rather than FIQ) because the statistic is only likely to be updated when we run the default FIQ handler (handle_fiq_as_nmi). Signed-off-by: Daniel Thompson --- arch/arm/include/asm/hardirq.h | 1 + arch/arm/kernel/irq.c | 7 ++++++- arch/arm/kernel/traps.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index 5df33e30ae1b..27ab43b5d7e2 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h @@ -9,6 +9,7 @@ typedef struct { unsigned int __softirq_pending; + unsigned int __nmi_count; #ifdef CONFIG_SMP unsigned int ipi_irqs[NR_IPI]; #endif diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index ad857bada96c..6dd1619e0700 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -48,13 +48,18 @@ unsigned long irq_err_count; int arch_show_interrupts(struct seq_file *p, int prec) { + int i; + #ifdef CONFIG_FIQ show_fiq_list(p, prec); #endif #ifdef CONFIG_SMP show_ipi_list(p, prec); #endif - seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count); + seq_printf(p, "%*s: ", prec, "NMI"); + for_each_online_cpu(i) + seq_printf(p, "%10u ", __get_irq_stat(i, __nmi_count)); + seq_printf(p, "\n%*s: %10lu\n", prec, "Err", irq_err_count); return 0; } diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 1836415b8a5c..5645f81ac4cc 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -476,8 +476,10 @@ die_sig: */ asmlinkage void __exception_irq_entry handle_fiq_as_nmi(struct pt_regs *regs) { + unsigned int cpu = smp_processor_id(); struct pt_regs *old_regs = set_irq_regs(regs); + __inc_irq_stat(cpu, __nmi_count); nmi_enter(); #ifdef CONFIG_ARM_GIC