linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: Luke Parkin <luke.parkin@arm.com>
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 3/3] Create debugfs files for statistics
Date: Mon, 1 Jul 2024 17:19:58 +0100	[thread overview]
Message-ID: <ZoLXLlgmNea-Q05n@pluto> (raw)
In-Reply-To: <20240701142851.1448515-4-luke.parkin@arm.com>

On Mon, Jul 01, 2024 at 03:28:51PM +0100, Luke Parkin wrote:
> Create debugfs files for the statistics in the scmi_debug_stats struct
> 
> Signed-off-by: Luke Parkin <luke.parkin@arm.com>
> ---
>  drivers/firmware/arm_scmi/driver.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index f69dff699d48..509ea42d17bf 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -2884,7 +2884,7 @@ static void scmi_debugfs_common_cleanup(void *d)
>  static struct scmi_debug_info *scmi_debugfs_common_setup(struct scmi_info *info)
>  {
>  	char top_dir[16];
> -	struct dentry *trans, *top_dentry;
> +	struct dentry *trans, *top_dentry, *stats;

stats are conditional...so...

>  	struct scmi_debug_info *dbg;
>  	const char *c_ptr = NULL;
>  
> @@ -2935,6 +2935,19 @@ 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)) {
> +		stats = debugfs_create_dir("stats", trans);

you can put the above local *stats var instead so that it is NOT even
defined when STATS=n

> +		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);
> +	}

... moreover...this is not always enabled BUT certainly will be extend
sooner with more counters...so please split this setup out in a local helper
function.

Thanks,
Cristian


  reply	other threads:[~2024-07-01 16:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 14:28 [PATCH 0/3] Add Per-transport SCMI debug statistics Luke Parkin
2024-07-01 14:28 ` [PATCH 1/3] Add Kconfig option for scmi " Luke Parkin
2024-07-01 15:32   ` Cristian Marussi
2024-07-01 14:28 ` [PATCH 2/3] Track basic SCMI statistics Luke Parkin
2024-07-01 16:15   ` Cristian Marussi
2024-07-02  9:57     ` Luke Parkin
2024-07-02 11:10       ` Cristian Marussi
2024-07-02 12:50         ` Luke Parkin
2024-07-01 14:28 ` [PATCH 3/3] Create debugfs files for statistics Luke Parkin
2024-07-01 16:19   ` Cristian Marussi [this message]
2024-07-01 15:20 ` [PATCH 0/3] Add Per-transport SCMI debug statistics Cristian Marussi
2024-07-01 16:21 ` Cristian Marussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZoLXLlgmNea-Q05n@pluto \
    --to=cristian.marussi@arm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke.parkin@arm.com \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).