From patchwork Tue Jan 13 16:35:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 5622231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 74261C058D for ; Tue, 13 Jan 2015 16:38:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1A52202E9 for ; Tue, 13 Jan 2015 16:38:35 +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 CF972202EC for ; Tue, 13 Jan 2015 16:38:34 +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 1YB4SS-0008PW-Si; Tue, 13 Jan 2015 16:36:44 +0000 Received: from mail-wg0-f46.google.com ([74.125.82.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YB4S1-00088v-Iw for linux-arm-kernel@lists.infradead.org; Tue, 13 Jan 2015 16:36:18 +0000 Received: by mail-wg0-f46.google.com with SMTP id x13so4004961wgg.5 for ; Tue, 13 Jan 2015 08:35:55 -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=POnO3jM/wKiTcl5lFdfllp7PTPM7NyvQaLCQfvuIDC852bZqveOyJNguXdj+B6jZV/ 8TgQPJRmvTE/hOKJwx250c4wK17aqewKG48ImoB9wdvVnhoHkzQP1ggzbCqqMCbryggT 1LQbZIuoBspueGUuYJ7aOyV9kqVLR3VExPSjIdPyNAfhkMBGaYnK1eS5qtEmY3yxHFsB DMk5fjsU7ULqo6oOO/NNTlofQQZyyJebbr9wVpd07MKZrW6lHJHmD+cmXScg9beK436k Ugr6SPFGoWFSbI3DHDlXJfT55ri0ko1uEUYUK0S3yKrNQIq+c0EEBvh9j41sruesq9BA 085g== X-Gm-Message-State: ALoCoQlpBBIeIHu71jGDnAVTjAGcCF8Mee5g8ISNACjZNO2yZvGM3zl6BEq1aMhTRtDtRXyy4+9C X-Received: by 10.180.7.201 with SMTP id l9mr5960862wia.80.1421166955396; Tue, 13 Jan 2015 08:35:55 -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 q10sm26349181wjx.34.2015.01.13.08.35.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 08:35:54 -0800 (PST) From: Daniel Thompson To: Thomas Gleixner , Jason Cooper , Russell King Subject: [RFC PATCH 1/5] arm: irq: Add a __nmi_count stat Date: Tue, 13 Jan 2015 16:35:27 +0000 Message-Id: <1421166931-14134-2-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421166931-14134-1-git-send-email-daniel.thompson@linaro.org> References: <1421166931-14134-1-git-send-email-daniel.thompson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150113_083617_814318_91556CD7 X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: -0.7 (/) Cc: Daniel Thompson , linaro-kernel@lists.linaro.org, patches@linaro.org, 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