From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2538DC3271E for ; Mon, 8 Jul 2024 14:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3enWE4fK7IkpzqFvJ54Ff+hEVQkhD3okaJuyOjxSrkU=; b=ANCgtjbEfDFpwj33sR8YfCZEVq ZsEzsxQSHQydeW62uuZ0NE+bBP5ygJTRtbKI15rJAGJabTuEme8deatovGjvzNLG/e2htk6r1QzTC A0Wkn4438GuGv+GKnDA27Xaz/cLzpbKyuA1DZUcLOelwEl0If/6wxq9ncjD++icT0g/Kz0xDmObyR ES2ZGewvqGifbQ99zXOcHb0uEOW+eDXQardzh2haQI8z6b7QPapsZIJqy/U6duUrx6BvBZhvoXB1l 68RS2JME2HeyOMQuoBsblM99zPVYo9DiLLHVwLa3y3VHwTG6Mh9JISOnpTeAWBr3dZ0yl2ljonEjJ A5vuvJMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQp2D-0000000412X-0AAP; Mon, 08 Jul 2024 14:08:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQp1x-000000040zE-2kd7 for linux-arm-kernel@lists.infradead.org; Mon, 08 Jul 2024 14:07:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7CDF11042; Mon, 8 Jul 2024 07:08:13 -0700 (PDT) Received: from pluto (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7AB6B3F766; Mon, 8 Jul 2024 07:07:47 -0700 (PDT) Date: Mon, 8 Jul 2024 15:07:45 +0100 From: Cristian Marussi To: Luke Parkin Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org, sudeep.holla@arm.com, cristian.marussi@arm.com Subject: Re: [PATCH v2 4/4] firmware: arm_scmi: Create debugfs files for statistics Message-ID: References: <20240703143738.2007457-1-luke.parkin@arm.com> <20240703143738.2007457-5-luke.parkin@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240703143738.2007457-5-luke.parkin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240708_070749_758926_C41A7853 X-CRM114-Status: GOOD ( 18.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 03, 2024 at 03:37:38PM +0100, Luke Parkin wrote: > Create debugfs files for the statistics in the scmi_debug_stats struct > > Signed-off-by: Luke Parkin Missing --- > v1->v2 > Only create stats pointer if stats are enabled > Move stats debugfs creation into a seperate helper function > --- > drivers/firmware/arm_scmi/driver.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > index 937546397cf2..10cd9a319ffb 100644 > --- a/drivers/firmware/arm_scmi/driver.c > +++ b/drivers/firmware/arm_scmi/driver.c > @@ -2858,6 +2858,24 @@ static int scmi_device_request_notifier(struct notifier_block *nb, > return NOTIFY_OK; > } > > +static void scmi_debugfs_stats_setup(struct scmi_info *info, > + struct dentry *trans) > +{ > + struct dentry *stats; > + > + stats = debugfs_create_dir("stats", trans); > + debugfs_create_atomic_t("response_ok", 0400, stats, > + &info->stats.response_ok); > + debugfs_create_atomic_t("dlyd_response_ok", 0400, stats, > + &info->stats.dlyd_response_ok); > + debugfs_create_atomic_t("sent_ok", 0400, stats, > + &info->stats.sent_ok); > + debugfs_create_atomic_t("sent_fail", 0400, stats, > + &info->stats.sent_fail); > + debugfs_create_atomic_t("xfers_response_timeout", 0400, stats, > + &info->stats.xfers_response_timeout); > +} > + > static void scmi_debugfs_common_cleanup(void *d) > { > struct scmi_debug_info *dbg = d; > @@ -2924,6 +2942,9 @@ static struct scmi_debug_info *scmi_debugfs_common_setup(struct scmi_info *info) > debugfs_create_u32("rx_max_msg", 0400, trans, > (u32 *)&info->rx_minfo.max_msg); > > + if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_STATISTICS)) > + scmi_debugfs_stats_setup(info, trans); > + Nothing to say here if not that more entries will need to be added as said. Moreover, You could take the chance in V3 to add in this patch the support to handle resetting each single counter (hint...this is a low hanging fruit :D) and also to support something like: transports/stats/reset which will be a WOnly booolean entry that will reset ALL the counters in one go. Thanks, Cristian