Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2811212imm; Mon, 10 Sep 2018 06:53:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYjzfxZQpFEK+bGtvn6fquGlyniSaBbB14nXWVZb0RxPQHy8qiyLr8r5OtOMaheiaQoIf9M X-Received: by 2002:a62:5290:: with SMTP id g138-v6mr23698013pfb.46.1536587609695; Mon, 10 Sep 2018 06:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536587609; cv=none; d=google.com; s=arc-20160816; b=KTLcaKRfJjMi53+dsaxlstvfywMP94sNJuqkgzRJifGBYD8B30VbNLe8l+SZBCXFPg nB4Js4DQV56m7Bml9abkuhb1FKbhtLHEUpLR0C3ek+VM+A09dTFYuMSYRBti2E6gqUpQ DCeSlNlpJCTfp79M2wfJzsYgiO1zclZVOaxkUJsgFj3rZNIfqLzPzNoLSm24Oi/vYY1y t9dc77d6cN43mHIkwlDMpVbB/9D86Nj2oOuy8NMjZH3gOGMiTFL3QRebqSx3wyociWke T6yKxKeYZRv9zPcN5LXV3HGfit+WyrN0QGPCeR15yhj1Z7CgvS5b1uO0+eYJ/e0eoN7U 2wlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FVdSVNFJp0QvNizd2aYHJH9Nx3e9PKDutqDOLkgauko=; b=xxcqaIlKIsgXjan13bwhlEeGM6CAc9ZOAG4mpvv3MS6YQdfji9daNwIdDeqB2Q6P50 PVfcvBbOV+C8HoalDpYBN4eJbj2Pggzoh3RHsvsp7Y4ry2xacPo+04iMGUt4/1GmbMDs C/0pPxnYx5JoXr17QfBEW6HNC7gMf7gpXUNYdh8yUtT+yDbfyXX4xDt2xzJuUG0XV7q5 U6Qh7DJ5c9yFuC/+++FlQypFRTnIG/CHs+85lY9E2z951cw4J340WOKK1OteENvhNIJv 1qdYBh4ezL2LSlY3+CS/F1tyzdH2cMiCrWfZby32aROI8X+XBK7CBad1m0H4o8Q8Zv8d unEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RTkObx3R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d36-v6si16472214pla.446.2018.09.10.06.52.44; Mon, 10 Sep 2018 06:53:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RTkObx3R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728770AbeIJSlL (ORCPT + 99 others); Mon, 10 Sep 2018 14:41:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46940 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728174AbeIJSlL (ORCPT ); Mon, 10 Sep 2018 14:41:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FVdSVNFJp0QvNizd2aYHJH9Nx3e9PKDutqDOLkgauko=; b=RTkObx3RzZu7PqYri57+SEsim Vv7EyJrDKF+rtfMCSmBxxq0XZ/V1GCdhWHNBGSza65tGMSuGRldWGwUtN7kNJt+Lf7o6tuKsLboyb kFRCixQzqm+qX+ctUWpPy+LW1n3YrV0D5S95vQLMQxMLWYmJNJtKxl5HzvL5ThRR123yINo9nQT27 iL+HERkHSjugVVEyPgnNhTxcVBiFsl1kGotPWR4DV18nPJCAKv0bri7Rg4uNT41BTAkw4V3O2xhQg w81sLxK77c8IIUw0M43bQZK5UBpUFz79sew0CNy3Uh8RwI4bVq2QXX9/hqkuC84R7sIrS8t7C9iwH FWci5xD0g==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fzMWq-0003FS-3c; Mon, 10 Sep 2018 13:47:00 +0000 Date: Mon, 10 Sep 2018 06:46:59 -0700 From: Christoph Hellwig To: Anup Patel Cc: Palmer Dabbelt , Albert Ou , Christoph Hellwig , Atish Patra , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH] RISC-V: Show IPI stats Message-ID: <20180910134659.GA30774@infradead.org> References: <20180907124429.31407-1-anup@brainfault.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180907124429.31407-1-anup@brainfault.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 07, 2018 at 06:14:29PM +0530, Anup Patel wrote: > This patch provides arch_show_interrupts() implementation to > show IPI stats via /proc/interrupts. > > Now the contents of /proc/interrupts" will look like below: > CPU0 CPU1 CPU2 CPU3 > 8: 17 7 6 14 SiFive PLIC 8 virtio0 > 10: 10 10 9 11 SiFive PLIC 10 ttyS0 > IPI0: 170 673 251 79 Rescheduling interrupts > IPI1: 1 12 27 1 Function call interrupts > IPI2: 0 0 0 0 CPU wake-up interrupts > > Signed-off-by: Anup Patel Thanks, this looks pretty sensible to me. Maybe we want to also show timer interrupts if we do this? > --- a/arch/riscv/kernel/irq.c > +++ b/arch/riscv/kernel/irq.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > > /* > * Possible interrupt causes: > @@ -24,6 +25,14 @@ > */ > #define INTERRUPT_CAUSE_FLAG (1UL << (__riscv_xlen - 1)) > > +int arch_show_interrupts(struct seq_file *p, int prec) > +{ > +#ifdef CONFIG_SMP > + show_ipi_stats(p, prec); > +#endif > + return 0; > +} If we don't also add timer stats I'd just move arch_show_interrupts to smp.c and make it conditional. If we don't this split might make more sense. > +static const char *ipi_names[IPI_MAX] = { > + [IPI_RESCHEDULE] = "Rescheduling interrupts", > + [IPI_CALL_FUNC] = "Function call interrupts", > + [IPI_CALL_WAKEUP] = "CPU wake-up interrupts", > +}; No need for the explicit array size. Also please use a few tabs to align this nicely: static const char *ipi_names[] = { [IPI_RESCHEDULE] = "Rescheduling interrupts", [IPI_CALL_FUNC] = "Function call interrupts", [IPI_CALL_WAKEUP] = "CPU wake-up interrupts", };