From: Dhruva Gole <d-gole@ti.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: <linux-pm@vger.kernel.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Kevin Hilman <khilman@baylibre.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] pmdomain: core: Show latency/residency for domain idle states in debugfs
Date: Tue, 27 Jan 2026 19:26:46 +0530 [thread overview]
Message-ID: <20260127135646.7o6bq7ptfh3gak2x@lcpd911> (raw)
In-Reply-To: <20260119143121.161583-3-ulf.hansson@linaro.org>
On Jan 19, 2026 at 15:31:14 +0100, Ulf Hansson wrote:
> Similar to how cpuidle provides the values for latency and residency for
> CPU's idle states through sysfs, let's make the corresponding data for PM
> domain's idle states available for user space, via genpd's debugfs support.
>
> Suggested-by: Dhruva Gole <d-gole@ti.com>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> drivers/pmdomain/core.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
> index 919dff2081d6..bf512ff0857d 100644
> --- a/drivers/pmdomain/core.c
> +++ b/drivers/pmdomain/core.c
> @@ -3809,15 +3809,24 @@ static int idle_states_desc_show(struct seq_file *s, void *data)
> if (ret)
> return -ERESTARTSYS;
>
> - seq_puts(s, "State Name\n");
> + seq_puts(s, "State Latency(us) Residency(us) Name\n");
>
> for (i = 0; i < genpd->state_count; i++) {
> struct genpd_power_state *state = &genpd->states[i];
> + u64 latency, residency;
> char state_name[7];
>
> + latency = state->power_off_latency_ns +
> + state->power_on_latency_ns;
> + do_div(latency, NSEC_PER_USEC);
> +
> + residency = state->residency_ns;
> + do_div(residency, NSEC_PER_USEC);
> +
> snprintf(state_name, ARRAY_SIZE(state_name), "S%-5d", i);
> - seq_printf(s, "%-6s %s\n",
> - state_name, state->name ?: "N/A");
> + seq_printf(s, "%-6s %-12llu %-14llu %s\n",
> + state_name, latency, residency,
> + state->name ?: "N/A");
Much needed indeed, thanks!!
Reviewed-by: Dhruva Gole <d-gole@ti.com>
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated
next prev parent reply other threads:[~2026-01-27 13:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 14:31 [PATCH 0/3] pmdomain: core: Extend domain idle states debugfs support Ulf Hansson
2026-01-19 14:31 ` [PATCH 1/3] pmdomain: core: Restructure domain idle states data for genpd in debugfs Ulf Hansson
2026-01-19 14:31 ` [PATCH 2/3] pmdomain: core: Show latency/residency for domain idle states " Ulf Hansson
2026-01-27 13:56 ` Dhruva Gole [this message]
2026-01-19 14:31 ` [PATCH 3/3] pmdomain: core: Extend statistics for domain idle states with s2idle data Ulf Hansson
2026-01-27 13:54 ` Dhruva Gole
2026-01-27 14:27 ` [PATCH 0/3] pmdomain: core: Extend domain idle states debugfs support Ulf Hansson
2026-01-27 21:25 ` Kevin Hilman
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=20260127135646.7o6bq7ptfh3gak2x@lcpd911 \
--to=d-gole@ti.com \
--cc=khilman@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=ulf.hansson@linaro.org \
/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®