From: Luke Parkin <luke.parkin@arm.com>
To: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org
Cc: sudeep.holla@arm.com, cristian.marussi@arm.com,
Luke Parkin <luke.parkin@arm.com>
Subject: [PATCH v2 4/4] firmware: arm_scmi: Create debugfs files for statistics
Date: Wed, 3 Jul 2024 15:37:38 +0100 [thread overview]
Message-ID: <20240703143738.2007457-5-luke.parkin@arm.com> (raw)
In-Reply-To: <20240703143738.2007457-1-luke.parkin@arm.com>
Create debugfs files for the statistics in the scmi_debug_stats struct
Signed-off-by: Luke Parkin <luke.parkin@arm.com>
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);
+
dbg->top_dentry = top_dentry;
if (devm_add_action_or_reset(info->dev,
--
2.34.1
next prev parent reply other threads:[~2024-07-03 14:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 14:37 [PATCH v2 0/4] Add Per-transport SCMI debug statistics Luke Parkin
2024-07-03 14:37 ` [PATCH v2 1/4] firmware: arm_scmi: Remove superfluous handle_to_scmi_info Luke Parkin
2024-07-08 11:08 ` Cristian Marussi
2024-07-03 14:37 ` [PATCH v2 2/4] firmware: arm_scmi: Add support for tracking statistics Luke Parkin
2024-07-08 13:01 ` Cristian Marussi
2024-07-03 14:37 ` [PATCH v2 3/4] firmware: arm_scmi: Track basic SCMI statistics Luke Parkin
2024-07-08 14:00 ` Cristian Marussi
2024-07-03 14:37 ` Luke Parkin [this message]
2024-07-08 14:07 ` [PATCH v2 4/4] firmware: arm_scmi: Create debugfs files for statistics 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=20240703143738.2007457-5-luke.parkin@arm.com \
--to=luke.parkin@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®