Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4929105imm; Tue, 11 Sep 2018 21:34:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb7IlrAZNvsEInjhOhE0A+Xnr2YVjgRNLJXDdDFkSD+deqeTG0LF0Pvy/Zc2V58k+ysgyUl X-Received: by 2002:a63:5904:: with SMTP id n4-v6mr56017pgb.134.1536726860397; Tue, 11 Sep 2018 21:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536726860; cv=none; d=google.com; s=arc-20160816; b=fjGS5ld4d3x02e3XHeUaG+njIrZlwj5e7XvtrndbEfLN51oPAHD/suesbo9H2gJYE5 a3ZFLFMKEt8c6OG5swJZe+2NagzO7h42Wff/UinoOrEw4OBc98K2x4l/h7eyzLAA7Vmp d8aNNIei+m+F5Fiu6uktdNTa2VSye/iAWmKTCiJIUbMbI0BNVANm6siwLv3c04itJ3Hd ib178fTxelQfXtmAu8PhhLLuIYuxUpN6RzXXAYblzAHPS4jaq23NvDKEaJsMlcUV6/0a q5z9zHE1EZbBQSAulLBk0430rbPooyOTlYLFlPFXCuuWRbedt9uXhz4JbzXGxQEmd4/O pA2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=s5revAGdcgwwzMsVyObx5m2/n5lDDpzS9zyAF6+/hO4=; b=QDl0yIhK/tTxk60JDSY+Kt6pKTaaGWPInHM+VcB2caxnmoXr+oSm+aEOHhUScjbLXA SFCy4TyeogoLNABWgkM0X+Ou0ci461HVZ6/tEHpnvIkekgNARlbEBzgse48ehaBWFohP F8umI+Pdl5IkrKt6BIuUb0IyTGuqg8g165qeZunaV9LPhXEQyaS9Ei6THX5OUZ+fOcWt tZbjL+sxfyZYPMLkJNEpPACGoZEytzyg8YEotg5p8hmCfwzuSJEacHC0K7vgPU6BzC4d kg9dhSuCzMYDInEsLdW9WpYm+usdniGA3TAQcnflSnFJT5WeXNcEujKCURcFpX0lg7o7 EI6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=U8FsUs6B; 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 v36-v6si23067727pga.336.2018.09.11.21.34.05; Tue, 11 Sep 2018 21:34:20 -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=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=U8FsUs6B; 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 S1726359AbeILJgi (ORCPT + 99 others); Wed, 12 Sep 2018 05:36:38 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38213 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725738AbeILJgh (ORCPT ); Wed, 12 Sep 2018 05:36:37 -0400 Received: by mail-wr1-f65.google.com with SMTP id w11-v6so464345wrc.5 for ; Tue, 11 Sep 2018 21:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=s5revAGdcgwwzMsVyObx5m2/n5lDDpzS9zyAF6+/hO4=; b=U8FsUs6B5hvnUlYGvqtbC0wz5oMC7Z0NR6ecUrmRCyQRJLitAUpExrzhiMF6gEJshy BYarh09g3OvkhkvzthjUtxI2X2xF3qJm2cUxrne5nElq1hnTPFighZKsbDEKAnBP5aLr QUIrykU/z808zhbSwA2TBYZR55hbN16YDyY6fVyGyoEBhkS4INw9X5xVRrrY8PV8gTsO 9yXZIWl/VAyFBo90UmVnNkwRox03+ZSJm7NmMp1XovmnJ55q5fPEKbDoPwvqZFrEOStU 9DVpdlvpZsimk6vVhvnPPxNpbB7KmdgbxAGImAet8g3L9VnNYkC93zRg1QqMKISJB47p Vgpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=s5revAGdcgwwzMsVyObx5m2/n5lDDpzS9zyAF6+/hO4=; b=RNa565ycO1Esx8hRP8ZlZe4qad4ajaBkOif08olXqWXDDEBFAtLBsolyDgl1UwiyPz +WAqE0yElXD6i7rfq/Ts89rvh+4SaRWEl8X7Y3ts/v+n6GelbHhLjvseSi7HvY2vYbXG JysJHbzCvwWMZX6/yPSmJxzwO8io5Ag0lkdPWOYjNljOZGHNlNZCRxvhZpeGkk2T13cW qnrYntkxTSQvTzgEeHSbuJmrhA9h9KZb+C7NEUgxdno+8aD30T1vMfqTAr+Bny21sksr 3i46BuapNe2cZXVo5PIqUeBt6xylLI6b4gFEe2nvf845t98OduzJzHuHotUdadWlFLo4 tNpQ== X-Gm-Message-State: APzg51Bo4qkdYXnB5UXNPSJ8vmmULbuk2FaSb56dDAQvw3AA6Jto+7Cg Qqa1y77Py9Ba2IZyBffUaK+lBtIO4+vhAuEMYGBe7g== X-Received: by 2002:a5d:6550:: with SMTP id z16-v6mr28352wrv.194.1536726837365; Tue, 11 Sep 2018 21:33:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9dcb:0:0:0:0:0 with HTTP; Tue, 11 Sep 2018 21:33:56 -0700 (PDT) In-Reply-To: <20180910134659.GA30774@infradead.org> References: <20180907124429.31407-1-anup@brainfault.org> <20180910134659.GA30774@infradead.org> From: Anup Patel Date: Wed, 12 Sep 2018 10:03:56 +0530 Message-ID: Subject: Re: [PATCH] RISC-V: Show IPI stats To: Christoph Hellwig Cc: Palmer Dabbelt , Albert Ou , Atish Patra , linux-riscv@lists.infradead.org, "linux-kernel@vger.kernel.org List" , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 10, 2018 at 7:16 PM, Christoph Hellwig wrote: > 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? Let's not include timer stats here until RISCV INTC driver is concluded. We can do it as separate patch if required. > >> --- 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. I understand you want to avoid #ifdef here. We can do same thing by having empty inline function show_ipi_stats() in asm/smp.h for !CONFIG_SMP case. This way we can keep arch_show_interrupts() in kernel/irq.c which is intuitively correct location for arch_show_interrupts(). > >> +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", > }; Sure, will do. Regards, Anup