* [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs.
@ 2017-06-13 20:27 Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 1/2] PM / Domains: Add time accounting to various genpd states Thara Gopinath
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Thara Gopinath @ 2017-06-13 20:27 UTC (permalink / raw)
To: ulf.hansson, khilman, rjw, gregkh, linux-pm
This patch set attempts to improve the existing generic power domain
debugfs capabilities. The first patch adds various accounting and
other bits needed to expose out the generic power domain statistics.
The second patch introduces new debugfs entries and attributes.
V1->V2:
- Removed calling of update accounting from suspend resume context
where time keeping can be disabled.
- Added back the pm_genpd_summary which was removed by the first version
of this patchset.
- Renamed a few debugfs parameters.
Thara Gopinath (2):
PM / Domains: Add time accounting to various genpd states.
PM / Domains: Extend generic power domain debugfs.
drivers/base/power/domain.c | 229 ++++++++++++++++++++++++++++++++++++++++++--
include/linux/pm_domain.h | 3 +
2 files changed, 224 insertions(+), 8 deletions(-)
--
2.1.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH V2 1/2] PM / Domains: Add time accounting to various genpd states.
2017-06-13 20:27 [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs Thara Gopinath
@ 2017-06-13 20:27 ` Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs Thara Gopinath
2017-06-14 8:24 ` [PATCH V2 0/2] PM / Domains: Expand " Geert Uytterhoeven
2 siblings, 0 replies; 7+ messages in thread
From: Thara Gopinath @ 2017-06-13 20:27 UTC (permalink / raw)
To: ulf.hansson, khilman, rjw, gregkh, linux-pm
This patch adds support to calculate the time spent by the generic
power domains in on and various idle states.
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
drivers/base/power/domain.c | 26 ++++++++++++++++++++++++++
include/linux/pm_domain.h | 3 +++
2 files changed, 29 insertions(+)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index da49a83..33b4632 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -207,6 +207,28 @@ static void genpd_sd_counter_inc(struct generic_pm_domain *genpd)
smp_mb__after_atomic();
}
+#ifdef CONFIG_DEBUG_FS
+static void genpd_update_accounting(struct generic_pm_domain *genpd)
+{
+ ktime_t delta, now;
+
+ now = ktime_get();
+ delta = ktime_sub(now, genpd->accounting_time);
+
+ if (genpd->status == GPD_STATE_ACTIVE) {
+ genpd->on_time = ktime_add(genpd->on_time, delta);
+ } else {
+ int state_idx = genpd->state_idx;
+
+ genpd->states[state_idx].idle_time =
+ ktime_add(genpd->states[state_idx].idle_time, delta);
+ }
+ genpd->accounting_time = now;
+}
+#else
+static inline void genpd_update_accounting(struct generic_pm_domain *genpd) {}
+#endif
+
static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
{
unsigned int state_idx = genpd->state_idx;
@@ -358,6 +380,7 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on,
return ret;
}
+ genpd_update_accounting(genpd);
genpd->status = GPD_STATE_POWER_OFF;
list_for_each_entry(link, &genpd->slave_links, slave_node) {
@@ -410,7 +433,9 @@ static int genpd_power_on(struct generic_pm_domain *genpd, unsigned int depth)
if (ret)
goto err;
+ genpd_update_accounting(genpd);
genpd->status = GPD_STATE_ACTIVE;
+
return 0;
err:
@@ -1486,6 +1511,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
genpd->max_off_time_changed = true;
genpd->provider = NULL;
genpd->has_provider = false;
+ genpd->accounting_time = ktime_get();
genpd->domain.ops.runtime_suspend = genpd_runtime_suspend;
genpd->domain.ops.runtime_resume = genpd_runtime_resume;
genpd->domain.ops.prepare = pm_genpd_prepare;
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index b7803a2..9c8b334 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -43,6 +43,7 @@ struct genpd_power_state {
s64 power_on_latency_ns;
s64 residency_ns;
struct fwnode_handle *fwnode;
+ ktime_t idle_time;
};
struct genpd_lock_ops;
@@ -78,6 +79,8 @@ struct generic_pm_domain {
unsigned int state_count; /* number of states */
unsigned int state_idx; /* state that genpd will go to when off */
void *free; /* Free the state that was allocated for default */
+ ktime_t on_time;
+ ktime_t accounting_time;
const struct genpd_lock_ops *lock_ops;
union {
struct mutex mlock;
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs.
2017-06-13 20:27 [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 1/2] PM / Domains: Add time accounting to various genpd states Thara Gopinath
@ 2017-06-13 20:27 ` Thara Gopinath
2017-06-14 8:01 ` Geert Uytterhoeven
2017-06-14 8:26 ` Geert Uytterhoeven
2017-06-14 8:24 ` [PATCH V2 0/2] PM / Domains: Expand " Geert Uytterhoeven
2 siblings, 2 replies; 7+ messages in thread
From: Thara Gopinath @ 2017-06-13 20:27 UTC (permalink / raw)
To: ulf.hansson, khilman, rjw, gregkh, linux-pm
This patch extends the existing generic power domain debugfs.
Changes involve the following
- Introduce a unique debugfs entry for each generic power domain with the
following attributes
- current_state - Displays current state of the domain.
- devices - Displays the devices associated with this domain.
- sub_domains - Displays the sub power domains.
- active_time - Displays the time the domain was in active state
in ms.
- total_idle_time - Displays the time the domain was in any of the idle
states in ms.
- idle_states - Displays the various idle states and the time
spent in each idle state in ms.
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
drivers/base/power/domain.c | 203 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 195 insertions(+), 8 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 33b4632..c1a0cd1 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2322,21 +2322,189 @@ static int pm_genpd_summary_show(struct seq_file *s, void *data)
return ret;
}
-static int pm_genpd_summary_open(struct inode *inode, struct file *file)
+static int pm_genpd_status_show(struct seq_file *s, void *data)
{
- return single_open(file, pm_genpd_summary_show, NULL);
+ static const char * const status_lookup[] = {
+ [GPD_STATE_ACTIVE] = "on",
+ [GPD_STATE_POWER_OFF] = "off"
+ };
+
+ struct generic_pm_domain *genpd = s->private;
+ int ret = 0;
+
+ ret = genpd_lock_interruptible(genpd);
+ if (ret)
+ return -ERESTARTSYS;
+
+ if (WARN_ON(genpd->status >= ARRAY_SIZE(status_lookup)))
+ goto exit;
+
+ if (genpd->status == GPD_STATE_POWER_OFF)
+ seq_printf(s, "%s-%u\n", status_lookup[genpd->status],
+ genpd->state_idx);
+ else
+ seq_printf(s, "%s\n", status_lookup[genpd->status]);
+exit:
+ genpd_unlock(genpd);
+ return ret;
}
-static const struct file_operations pm_genpd_summary_fops = {
- .open = pm_genpd_summary_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+static int pm_genpd_sub_domains_show(struct seq_file *s, void *data)
+{
+ struct generic_pm_domain *genpd = s->private;
+ struct gpd_link *link;
+ int ret = 0;
+
+ ret = genpd_lock_interruptible(genpd);
+ if (ret)
+ return -ERESTARTSYS;
+
+ list_for_each_entry(link, &genpd->master_links, master_node) {
+ seq_printf(s, "%s", link->slave->name);
+ if (!list_is_last(&link->master_node, &genpd->master_links))
+ seq_puts(s, ", ");
+ }
+ seq_puts(s, "\n");
+
+ genpd_unlock(genpd);
+ return ret;
+}
+
+static int pm_genpd_idle_states_show(struct seq_file *s, void *data)
+{
+ struct generic_pm_domain *genpd = s->private;
+ int i, ret = 0;
+
+ ret = genpd_lock_interruptible(genpd);
+ if (ret)
+ return -ERESTARTSYS;
+
+ seq_puts(s, "State Time Spent(ms)\n");
+
+ for (i = 0; i < genpd->state_count; i++) {
+ ktime_t delta = 0;
+ s64 msecs;
+
+ if ((genpd->status == GPD_STATE_POWER_OFF) &&
+ (genpd->state_idx == i))
+ delta = ktime_sub(ktime_get(), genpd->accounting_time);
+
+ msecs = ktime_to_ms(
+ ktime_add(genpd->states[i].idle_time, delta));
+ seq_printf(s, "S%-15i %lld\n", i, msecs);
+ }
+
+ genpd_unlock(genpd);
+ return ret;
+}
+
+static int pm_genpd_active_time_show(struct seq_file *s, void *data)
+{
+ struct generic_pm_domain *genpd = s->private;
+ ktime_t delta = 0;
+ int ret = 0;
+
+ ret = genpd_lock_interruptible(genpd);
+ if (ret)
+ return -ERESTARTSYS;
+
+ if (genpd->status == GPD_STATE_ACTIVE)
+ delta = ktime_sub(ktime_get(), genpd->accounting_time);
+
+ seq_printf(s, "%lld ms\n", ktime_to_ms(
+ ktime_add(genpd->on_time, delta)));
+
+ genpd_unlock(genpd);
+ return ret;
+}
+
+static int pm_genpd_total_idle_time_show(struct seq_file *s, void *data)
+{
+ struct generic_pm_domain *genpd = s->private;
+ ktime_t delta = 0, total = 0;
+ int i, ret = 0;
+
+ ret = genpd_lock_interruptible(genpd);
+ if (ret)
+ return -ERESTARTSYS;
+
+ for (i = 0; i < genpd->state_count; i++) {
+
+ if ((genpd->status == GPD_STATE_POWER_OFF) &&
+ (genpd->state_idx == i))
+ delta = ktime_sub(ktime_get(), genpd->accounting_time);
+
+ total = ktime_add(total, genpd->states[i].idle_time);
+ }
+ total = ktime_add(total, delta);
+
+ seq_printf(s, "%lld ms\n", ktime_to_ms(total));
+
+ genpd_unlock(genpd);
+ return ret;
+}
+
+
+static int pm_genpd_devices_show(struct seq_file *s, void *data)
+{
+ struct generic_pm_domain *genpd = s->private;
+ struct pm_domain_data *pm_data;
+ const char *kobj_path;
+ int ret = 0;
+
+ ret = genpd_lock_interruptible(genpd);
+ if (ret)
+ return -ERESTARTSYS;
+
+ list_for_each_entry(pm_data, &genpd->dev_list, list_node) {
+ kobj_path = kobject_get_path(&pm_data->dev->kobj,
+ genpd_is_irq_safe(genpd) ?
+ GFP_ATOMIC : GFP_KERNEL);
+ if (kobj_path == NULL)
+ continue;
+
+ seq_printf(s, "%s\n", kobj_path);
+ kfree(kobj_path);
+ }
+
+ genpd_unlock(genpd);
+ return ret;
+}
+
+#define define_pm_genpd_open_function(name) \
+static int pm_genpd_##name##_open(struct inode *inode, struct file *file) \
+{ \
+ return single_open(file, pm_genpd_##name##_show, inode->i_private); \
+}
+
+define_pm_genpd_open_function(summary);
+define_pm_genpd_open_function(status);
+define_pm_genpd_open_function(sub_domains);
+define_pm_genpd_open_function(idle_states);
+define_pm_genpd_open_function(active_time);
+define_pm_genpd_open_function(total_idle_time);
+define_pm_genpd_open_function(devices);
+
+#define define_pm_genpd_debugfs_fops(name) \
+static const struct file_operations pm_genpd_##name##_fops = { \
+ .open = pm_genpd_##name##_open, \
+ .read = seq_read, \
+ .llseek = seq_lseek, \
+ .release = single_release, \
+}
+
+define_pm_genpd_debugfs_fops(summary);
+define_pm_genpd_debugfs_fops(status);
+define_pm_genpd_debugfs_fops(sub_domains);
+define_pm_genpd_debugfs_fops(idle_states);
+define_pm_genpd_debugfs_fops(active_time);
+define_pm_genpd_debugfs_fops(total_idle_time);
+define_pm_genpd_debugfs_fops(devices);
static int __init pm_genpd_debug_init(void)
{
struct dentry *d;
+ struct generic_pm_domain *genpd;
pm_genpd_debugfs_dir = debugfs_create_dir("pm_genpd", NULL);
@@ -2348,6 +2516,25 @@ static int __init pm_genpd_debug_init(void)
if (!d)
return -ENOMEM;
+ list_for_each_entry(genpd, &gpd_list, gpd_list_node) {
+ d = debugfs_create_dir(genpd->name, pm_genpd_debugfs_dir);
+ if (!d)
+ return -ENOMEM;
+
+ debugfs_create_file("current_state", 0444,
+ d, genpd, &pm_genpd_status_fops);
+ debugfs_create_file("sub_domains", 0444,
+ d, genpd, &pm_genpd_sub_domains_fops);
+ debugfs_create_file("idle_states", 0444,
+ d, genpd, &pm_genpd_idle_states_fops);
+ debugfs_create_file("active_time", 0444,
+ d, genpd, &pm_genpd_active_time_fops);
+ debugfs_create_file("total_idle_time", 0444,
+ d, genpd, &pm_genpd_total_idle_time_fops);
+ debugfs_create_file("devices", 0444,
+ d, genpd, &pm_genpd_devices_fops);
+ }
+
return 0;
}
late_initcall(pm_genpd_debug_init);
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs.
2017-06-13 20:27 ` [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs Thara Gopinath
@ 2017-06-14 8:01 ` Geert Uytterhoeven
2017-06-14 8:26 ` Geert Uytterhoeven
1 sibling, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-06-14 8:01 UTC (permalink / raw)
To: Thara Gopinath
Cc: Ulf Hansson, Kevin Hilman, Rafael J. Wysocki, Greg KH,
Linux PM list
Hi Thara,
On Tue, Jun 13, 2017 at 10:27 PM, Thara Gopinath
<thara.gopinath@linaro.org> wrote:
> This patch extends the existing generic power domain debugfs.
> Changes involve the following
> - Introduce a unique debugfs entry for each generic power domain with the
> following attributes
> - current_state - Displays current state of the domain.
> - devices - Displays the devices associated with this domain.
> - sub_domains - Displays the sub power domains.
> - active_time - Displays the time the domain was in active state
> in ms.
> - total_idle_time - Displays the time the domain was in any of the idle
> states in ms.
> - idle_states - Displays the various idle states and the time
> spent in each idle state in ms.
>
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Thanks for your patch!
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2322,21 +2322,189 @@ static int pm_genpd_summary_show(struct seq_file *s, void *data)
> return ret;
> }
>
> -static int pm_genpd_summary_open(struct inode *inode, struct file *file)
> +static int pm_genpd_status_show(struct seq_file *s, void *data)
> {
> - return single_open(file, pm_genpd_summary_show, NULL);
> + static const char * const status_lookup[] = {
> + [GPD_STATE_ACTIVE] = "on",
> + [GPD_STATE_POWER_OFF] = "off"
> + };
> +
> + struct generic_pm_domain *genpd = s->private;
> + int ret = 0;
> +
> + ret = genpd_lock_interruptible(genpd);
> + if (ret)
> + return -ERESTARTSYS;
> +
> + if (WARN_ON(genpd->status >= ARRAY_SIZE(status_lookup)))
WARN_ON_ONCE()?
If this ever triggers, it can be retriggered at will from userspace,
flooding the logs.
> +static int pm_genpd_idle_states_show(struct seq_file *s, void *data)
> +{
> + struct generic_pm_domain *genpd = s->private;
> + int i, ret = 0;
unsigned int i;
> +
> + ret = genpd_lock_interruptible(genpd);
> + if (ret)
> + return -ERESTARTSYS;
> +
> + seq_puts(s, "State Time Spent(ms)\n");
> +
> + for (i = 0; i < genpd->state_count; i++) {
> + ktime_t delta = 0;
> + s64 msecs;
> +
> + if ((genpd->status == GPD_STATE_POWER_OFF) &&
> + (genpd->state_idx == i))
> + delta = ktime_sub(ktime_get(), genpd->accounting_time);
> +
> + msecs = ktime_to_ms(
> + ktime_add(genpd->states[i].idle_time, delta));
The above two lines still fit on a single line, right?
> +static int pm_genpd_total_idle_time_show(struct seq_file *s, void *data)
> +{
> + struct generic_pm_domain *genpd = s->private;
> + ktime_t delta = 0, total = 0;
> + int i, ret = 0;
unsigned int i;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs.
2017-06-13 20:27 [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 1/2] PM / Domains: Add time accounting to various genpd states Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs Thara Gopinath
@ 2017-06-14 8:24 ` Geert Uytterhoeven
2017-06-14 20:59 ` Thara Gopinath
2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-06-14 8:24 UTC (permalink / raw)
To: Thara Gopinath
Cc: Ulf Hansson, Kevin Hilman, Rafael J. Wysocki, Greg KH,
Linux PM list
Hi Thara,
On Tue, Jun 13, 2017 at 10:27 PM, Thara Gopinath
<thara.gopinath@linaro.org> wrote:
> This patch set attempts to improve the existing generic power domain
> debugfs capabilities. The first patch adds various accounting and
> other bits needed to expose out the generic power domain statistics.
> The second patch introduces new debugfs entries and attributes.
>
> V1->V2:
> - Removed calling of update accounting from suspend resume context
> where time keeping can be disabled.
> - Added back the pm_genpd_summary which was removed by the first version
> of this patchset.
> - Renamed a few debugfs parameters.
Thanks for your patches!
For reference, I'm adding the output of all new files on a Renesas Salvator-X
board (slightly reformatted, as "idle_states" and "devices" may span multiple
lines):
3dg-a
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 305565
sub_domains : 3dg-b
total_idle_time : 305782 ms
3dg-b
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 306142
sub_domains : 3dg-c
total_idle_time : 306351 ms
3dg-c
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 306706
sub_domains : 3dg-d
total_idle_time : 306923 ms
3dg-d
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 307299
sub_domains : 3dg-e
total_idle_time : 307516 ms
3dg-e
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 307902
sub_domains :
total_idle_time : 308119 ms
a2vc1
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 308511
sub_domains :
total_idle_time : 308722 ms
a3ir
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 309115
sub_domains :
total_idle_time : 309332 ms
a3vc
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 309705
sub_domains : a2vc1
total_idle_time : 309905 ms
a3vp
active_time : 4552 ms
current_state : off-0
devices : /devices/platform/soc/fe92f000.fcp
/devices/platform/soc/fe950000.fcp
/devices/platform/soc/fe951000.fcp
/devices/platform/soc/fe96f000.fcp
/devices/platform/soc/fe9af000.fcp
/devices/platform/soc/fe9bf000.fcp
/devices/platform/soc/fe940000.fdp1
/devices/platform/soc/fe944000.fdp1
/devices/platform/soc/fe920000.vsp
/devices/platform/soc/fe960000.vsp
/devices/platform/soc/fe9a0000.vsp
/devices/platform/soc/fe9b0000.vsp
idle_states : State Time Spent(ms)
S0 312002
sub_domains :
total_idle_time : 312219 ms
always-on
active_time : 316884 ms
current_state : on
devices : /devices/platform/soc/e60b0000.i2c
/devices/platform/soc/ee0a0200.usb-phy
/devices/platform/soc/ee0c0200.usb-phy
/devices/platform/soc/e6050000.gpio
/devices/platform/soc/e6051000.gpio
/devices/platform/soc/e6052000.gpio
/devices/platform/soc/e6053000.gpio
/devices/platform/soc/e6054000.gpio
/devices/platform/soc/e6055000.gpio
/devices/platform/soc/e6055400.gpio
/devices/platform/soc/e6055800.gpio
/devices/platform/soc/e6700000.dma-controller
/devices/platform/soc/e7300000.dma-controller
/devices/platform/soc/e7310000.dma-controller
/devices/platform/soc/ec700000.dma-controller
/devices/platform/soc/ec720000.dma-controller
/devices/platform/soc/e65a0000.dma-controller
/devices/platform/soc/e65b0000.dma-controller
/devices/platform/soc/e6e68000.serial
/devices/platform/soc/e6e88000.serial
/devices/platform/soc/fead0000.hdmi0
/devices/platform/soc/feae0000.hdmi1
/devices/platform/soc/e6800000.ethernet
/devices/platform/soc/ee0a0100.usb
/devices/platform/soc/ee0c0100.usb
/devices/platform/soc/ee0a0000.usb
/devices/platform/soc/ee0c0000.usb
/devices/platform/soc/e6510000.i2c
/devices/platform/soc/e66d8000.i2c
/devices/platform/soc/fea27000.fcp
/devices/platform/soc/fea2f000.fcp
/devices/platform/soc/fea37000.fcp
/devices/platform/soc/fea28000.vsp
/devices/platform/soc/fea30000.vsp
/devices/platform/soc/e6198000.thermal
/devices/platform/soc/e6020000.watchdog
/devices/platform/soc/ee140000.sd
/devices/platform/soc/ec500000.sound
/devices/platform/soc/e61c0000.interrupt-controller
/devices/platform/soc/ee080200.usb-phy
/devices/platform/soc/ee080100.usb
/devices/platform/soc/ee080000.usb
/devices/platform/soc/ee100000.sd
/devices/platform/soc/ee160000.sd
idle_states : State Time Spent(ms)
S0 0
sub_domains : ca57-scu, ca53-scu, a3vp, cr7, a3vc, 3dg-a, a3ir
total_idle_time : 0 ms
ca53-cpu0
active_time : 317535 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca53-cpu1
active_time : 318121 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca53-cpu2
active_time : 318691 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca53-cpu3
active_time : 319273 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca53-scu
active_time : 319874 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains : ca53-cpu0, ca53-cpu1, ca53-cpu2, ca53-cpu3
total_idle_time : 0 ms
ca57-cpu0
active_time : 320455 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca57-cpu1
active_time : 321014 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca57-cpu2
active_time : 321569 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca57-cpu3
active_time : 322147 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
ca57-scu
active_time : 322748 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains : ca57-cpu0, ca57-cpu1, ca57-cpu2, ca57-cpu3
total_idle_time : 0 ms
clock-controller
active_time : 323302 ms
current_state : on
devices :
idle_states : State Time Spent(ms)
S0 0
sub_domains :
total_idle_time : 0 ms
cr7
active_time : 6231 ms
current_state : off-0
devices :
idle_states : State Time Spent(ms)
S0 318018
sub_domains :
total_idle_time : 318237 ms
Plain pm_genpd_summary:
domain status slaves
/device runtime status
----------------------------------------------------------------------
clock-controller on
a3ir off-0
3dg-e off-0
3dg-d off-0 3dg-e
3dg-c off-0 3dg-d
3dg-b off-0 3dg-c
3dg-a off-0 3dg-b
a2vc1 off-0
a3vc off-0 a2vc1
cr7 off-0
a3vp off-0
/devices/platform/soc/fe92f000.fcp suspended
/devices/platform/soc/fe950000.fcp suspended
/devices/platform/soc/fe951000.fcp suspended
/devices/platform/soc/fe96f000.fcp suspended
/devices/platform/soc/fe9af000.fcp suspended
/devices/platform/soc/fe9bf000.fcp suspended
/devices/platform/soc/fe940000.fdp1 suspended
/devices/platform/soc/fe944000.fdp1 suspended
/devices/platform/soc/fe920000.vsp suspended
/devices/platform/soc/fe960000.vsp suspended
/devices/platform/soc/fe9a0000.vsp suspended
/devices/platform/soc/fe9b0000.vsp suspended
ca53-cpu3 on
ca53-cpu2 on
ca53-cpu1 on
ca53-cpu0 on
ca53-scu on ca53-cpu0, ca53-cpu1,
ca53-cpu2, ca53-cpu3
ca57-cpu3 on
ca57-cpu2 on
ca57-cpu1 on
ca57-cpu0 on
ca57-scu on ca57-cpu0, ca57-cpu1,
ca57-cpu2, ca57-cpu3
always-on on ca57-scu, ca53-scu,
a3vp, cr7, a3vc, 3dg-a, a3ir
/devices/platform/soc/e60b0000.i2c suspended
/devices/platform/soc/ee0a0200.usb-phy active
/devices/platform/soc/ee0c0200.usb-phy active
/devices/platform/soc/e6050000.gpio suspended
/devices/platform/soc/e6051000.gpio suspended
/devices/platform/soc/e6052000.gpio active
/devices/platform/soc/e6053000.gpio active
/devices/platform/soc/e6054000.gpio active
/devices/platform/soc/e6055000.gpio active
/devices/platform/soc/e6055400.gpio active
/devices/platform/soc/e6055800.gpio suspended
/devices/platform/soc/e6700000.dma-controller active
/devices/platform/soc/e7300000.dma-controller active
/devices/platform/soc/e7310000.dma-controller suspended
/devices/platform/soc/ec700000.dma-controller suspended
/devices/platform/soc/ec720000.dma-controller suspended
/devices/platform/soc/e65a0000.dma-controller suspended
/devices/platform/soc/e65b0000.dma-controller suspended
/devices/platform/soc/e6e68000.serial active
/devices/platform/soc/e6e88000.serial active
/devices/platform/soc/fead0000.hdmi0 unsupported
/devices/platform/soc/feae0000.hdmi1 unsupported
/devices/platform/soc/e6800000.ethernet active
/devices/platform/soc/ee0a0100.usb unsupported
/devices/platform/soc/ee0c0100.usb unsupported
/devices/platform/soc/ee0a0000.usb suspended
/devices/platform/soc/ee0c0000.usb suspended
/devices/platform/soc/e6510000.i2c suspended
/devices/platform/soc/e66d8000.i2c suspended
/devices/platform/soc/fea27000.fcp suspended
/devices/platform/soc/fea2f000.fcp suspended
/devices/platform/soc/fea37000.fcp suspended
/devices/platform/soc/fea28000.vsp suspended
/devices/platform/soc/fea30000.vsp suspended
/devices/platform/soc/e6198000.thermal active
/devices/platform/soc/e6020000.watchdog active
/devices/platform/soc/ee140000.sd active
/devices/platform/soc/ec500000.sound suspended
/devices/platform/soc/e61c0000.interrupt-controller active
/devices/platform/soc/ee080200.usb-phy active
/devices/platform/soc/ee080100.usb unsupported
/devices/platform/soc/ee080000.usb suspended
/devices/platform/soc/ee100000.sd active
/devices/platform/soc/ee160000.sd active
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs.
2017-06-13 20:27 ` [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs Thara Gopinath
2017-06-14 8:01 ` Geert Uytterhoeven
@ 2017-06-14 8:26 ` Geert Uytterhoeven
1 sibling, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-06-14 8:26 UTC (permalink / raw)
To: Thara Gopinath
Cc: Ulf Hansson, Kevin Hilman, Rafael J. Wysocki, Greg KH,
Linux PM list
Hi Thara,
On Tue, Jun 13, 2017 at 10:27 PM, Thara Gopinath
<thara.gopinath@linaro.org> wrote:
> +static int pm_genpd_idle_states_show(struct seq_file *s, void *data)
> +{
> + struct generic_pm_domain *genpd = s->private;
> + int i, ret = 0;
> +
> + ret = genpd_lock_interruptible(genpd);
> + if (ret)
> + return -ERESTARTSYS;
> +
> + seq_puts(s, "State Time Spent(ms)\n");
> +
> + for (i = 0; i < genpd->state_count; i++) {
> + ktime_t delta = 0;
> + s64 msecs;
> +
> + if ((genpd->status == GPD_STATE_POWER_OFF) &&
> + (genpd->state_idx == i))
> + delta = ktime_sub(ktime_get(), genpd->accounting_time);
> +
> + msecs = ktime_to_ms(
> + ktime_add(genpd->states[i].idle_time, delta));
> + seq_printf(s, "S%-15i %lld\n", i, msecs);
> + }
The ms values are misaligned by one space, compared to the table header:
State Time Spent(ms)
S0 0
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs.
2017-06-14 8:24 ` [PATCH V2 0/2] PM / Domains: Expand " Geert Uytterhoeven
@ 2017-06-14 20:59 ` Thara Gopinath
0 siblings, 0 replies; 7+ messages in thread
From: Thara Gopinath @ 2017-06-14 20:59 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Ulf Hansson, Kevin Hilman, Rafael J. Wysocki, Greg KH,
Linux PM list
Hi Geert,
On 06/14/2017 04:24 AM, Geert Uytterhoeven wrote:
> Hi Thara,
>
> On Tue, Jun 13, 2017 at 10:27 PM, Thara Gopinath
> <thara.gopinath@linaro.org> wrote:
>> This patch set attempts to improve the existing generic power domain
>> debugfs capabilities. The first patch adds various accounting and
>> other bits needed to expose out the generic power domain statistics.
>> The second patch introduces new debugfs entries and attributes.
>>
>> V1->V2:
>> - Removed calling of update accounting from suspend resume context
>> where time keeping can be disabled.
>> - Added back the pm_genpd_summary which was removed by the first version
>> of this patchset.
>> - Renamed a few debugfs parameters.
>
> Thanks for your patches!
>
> For reference, I'm adding the output of all new files on a Renesas Salvator-X
> board (slightly reformatted, as "idle_states" and "devices" may span multiple
> lines):
Thanks for the review and testing. The results below look good. I did
see your minor comments in the other email. I will fix all of them in
the next version.
Regards
Thara
>
> 3dg-a
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 305565
> sub_domains : 3dg-b
> total_idle_time : 305782 ms
> 3dg-b
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 306142
> sub_domains : 3dg-c
> total_idle_time : 306351 ms
> 3dg-c
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 306706
> sub_domains : 3dg-d
> total_idle_time : 306923 ms
> 3dg-d
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 307299
> sub_domains : 3dg-e
> total_idle_time : 307516 ms
> 3dg-e
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 307902
> sub_domains :
> total_idle_time : 308119 ms
> a2vc1
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 308511
> sub_domains :
> total_idle_time : 308722 ms
> a3ir
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 309115
> sub_domains :
> total_idle_time : 309332 ms
> a3vc
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 309705
> sub_domains : a2vc1
> total_idle_time : 309905 ms
> a3vp
> active_time : 4552 ms
> current_state : off-0
> devices : /devices/platform/soc/fe92f000.fcp
> /devices/platform/soc/fe950000.fcp
> /devices/platform/soc/fe951000.fcp
> /devices/platform/soc/fe96f000.fcp
> /devices/platform/soc/fe9af000.fcp
> /devices/platform/soc/fe9bf000.fcp
> /devices/platform/soc/fe940000.fdp1
> /devices/platform/soc/fe944000.fdp1
> /devices/platform/soc/fe920000.vsp
> /devices/platform/soc/fe960000.vsp
> /devices/platform/soc/fe9a0000.vsp
> /devices/platform/soc/fe9b0000.vsp
> idle_states : State Time Spent(ms)
> S0 312002
> sub_domains :
> total_idle_time : 312219 ms
> always-on
> active_time : 316884 ms
> current_state : on
> devices : /devices/platform/soc/e60b0000.i2c
> /devices/platform/soc/ee0a0200.usb-phy
> /devices/platform/soc/ee0c0200.usb-phy
> /devices/platform/soc/e6050000.gpio
> /devices/platform/soc/e6051000.gpio
> /devices/platform/soc/e6052000.gpio
> /devices/platform/soc/e6053000.gpio
> /devices/platform/soc/e6054000.gpio
> /devices/platform/soc/e6055000.gpio
> /devices/platform/soc/e6055400.gpio
> /devices/platform/soc/e6055800.gpio
> /devices/platform/soc/e6700000.dma-controller
> /devices/platform/soc/e7300000.dma-controller
> /devices/platform/soc/e7310000.dma-controller
> /devices/platform/soc/ec700000.dma-controller
> /devices/platform/soc/ec720000.dma-controller
> /devices/platform/soc/e65a0000.dma-controller
> /devices/platform/soc/e65b0000.dma-controller
> /devices/platform/soc/e6e68000.serial
> /devices/platform/soc/e6e88000.serial
> /devices/platform/soc/fead0000.hdmi0
> /devices/platform/soc/feae0000.hdmi1
> /devices/platform/soc/e6800000.ethernet
> /devices/platform/soc/ee0a0100.usb
> /devices/platform/soc/ee0c0100.usb
> /devices/platform/soc/ee0a0000.usb
> /devices/platform/soc/ee0c0000.usb
> /devices/platform/soc/e6510000.i2c
> /devices/platform/soc/e66d8000.i2c
> /devices/platform/soc/fea27000.fcp
> /devices/platform/soc/fea2f000.fcp
> /devices/platform/soc/fea37000.fcp
> /devices/platform/soc/fea28000.vsp
> /devices/platform/soc/fea30000.vsp
> /devices/platform/soc/e6198000.thermal
> /devices/platform/soc/e6020000.watchdog
> /devices/platform/soc/ee140000.sd
> /devices/platform/soc/ec500000.sound
> /devices/platform/soc/e61c0000.interrupt-controller
> /devices/platform/soc/ee080200.usb-phy
> /devices/platform/soc/ee080100.usb
> /devices/platform/soc/ee080000.usb
> /devices/platform/soc/ee100000.sd
> /devices/platform/soc/ee160000.sd
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains : ca57-scu, ca53-scu, a3vp, cr7, a3vc, 3dg-a, a3ir
> total_idle_time : 0 ms
> ca53-cpu0
> active_time : 317535 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca53-cpu1
> active_time : 318121 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca53-cpu2
> active_time : 318691 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca53-cpu3
> active_time : 319273 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca53-scu
> active_time : 319874 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains : ca53-cpu0, ca53-cpu1, ca53-cpu2, ca53-cpu3
> total_idle_time : 0 ms
> ca57-cpu0
> active_time : 320455 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca57-cpu1
> active_time : 321014 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca57-cpu2
> active_time : 321569 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca57-cpu3
> active_time : 322147 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> ca57-scu
> active_time : 322748 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains : ca57-cpu0, ca57-cpu1, ca57-cpu2, ca57-cpu3
> total_idle_time : 0 ms
> clock-controller
> active_time : 323302 ms
> current_state : on
> devices :
> idle_states : State Time Spent(ms)
> S0 0
> sub_domains :
> total_idle_time : 0 ms
> cr7
> active_time : 6231 ms
> current_state : off-0
> devices :
> idle_states : State Time Spent(ms)
> S0 318018
> sub_domains :
> total_idle_time : 318237 ms
>
> Plain pm_genpd_summary:
>
> domain status slaves
> /device runtime status
> ----------------------------------------------------------------------
> clock-controller on
> a3ir off-0
> 3dg-e off-0
> 3dg-d off-0 3dg-e
> 3dg-c off-0 3dg-d
> 3dg-b off-0 3dg-c
> 3dg-a off-0 3dg-b
> a2vc1 off-0
> a3vc off-0 a2vc1
> cr7 off-0
> a3vp off-0
> /devices/platform/soc/fe92f000.fcp suspended
> /devices/platform/soc/fe950000.fcp suspended
> /devices/platform/soc/fe951000.fcp suspended
> /devices/platform/soc/fe96f000.fcp suspended
> /devices/platform/soc/fe9af000.fcp suspended
> /devices/platform/soc/fe9bf000.fcp suspended
> /devices/platform/soc/fe940000.fdp1 suspended
> /devices/platform/soc/fe944000.fdp1 suspended
> /devices/platform/soc/fe920000.vsp suspended
> /devices/platform/soc/fe960000.vsp suspended
> /devices/platform/soc/fe9a0000.vsp suspended
> /devices/platform/soc/fe9b0000.vsp suspended
> ca53-cpu3 on
> ca53-cpu2 on
> ca53-cpu1 on
> ca53-cpu0 on
> ca53-scu on ca53-cpu0, ca53-cpu1,
> ca53-cpu2, ca53-cpu3
> ca57-cpu3 on
> ca57-cpu2 on
> ca57-cpu1 on
> ca57-cpu0 on
> ca57-scu on ca57-cpu0, ca57-cpu1,
> ca57-cpu2, ca57-cpu3
> always-on on ca57-scu, ca53-scu,
> a3vp, cr7, a3vc, 3dg-a, a3ir
> /devices/platform/soc/e60b0000.i2c suspended
> /devices/platform/soc/ee0a0200.usb-phy active
> /devices/platform/soc/ee0c0200.usb-phy active
> /devices/platform/soc/e6050000.gpio suspended
> /devices/platform/soc/e6051000.gpio suspended
> /devices/platform/soc/e6052000.gpio active
> /devices/platform/soc/e6053000.gpio active
> /devices/platform/soc/e6054000.gpio active
> /devices/platform/soc/e6055000.gpio active
> /devices/platform/soc/e6055400.gpio active
> /devices/platform/soc/e6055800.gpio suspended
> /devices/platform/soc/e6700000.dma-controller active
> /devices/platform/soc/e7300000.dma-controller active
> /devices/platform/soc/e7310000.dma-controller suspended
> /devices/platform/soc/ec700000.dma-controller suspended
> /devices/platform/soc/ec720000.dma-controller suspended
> /devices/platform/soc/e65a0000.dma-controller suspended
> /devices/platform/soc/e65b0000.dma-controller suspended
> /devices/platform/soc/e6e68000.serial active
> /devices/platform/soc/e6e88000.serial active
> /devices/platform/soc/fead0000.hdmi0 unsupported
> /devices/platform/soc/feae0000.hdmi1 unsupported
> /devices/platform/soc/e6800000.ethernet active
> /devices/platform/soc/ee0a0100.usb unsupported
> /devices/platform/soc/ee0c0100.usb unsupported
> /devices/platform/soc/ee0a0000.usb suspended
> /devices/platform/soc/ee0c0000.usb suspended
> /devices/platform/soc/e6510000.i2c suspended
> /devices/platform/soc/e66d8000.i2c suspended
> /devices/platform/soc/fea27000.fcp suspended
> /devices/platform/soc/fea2f000.fcp suspended
> /devices/platform/soc/fea37000.fcp suspended
> /devices/platform/soc/fea28000.vsp suspended
> /devices/platform/soc/fea30000.vsp suspended
> /devices/platform/soc/e6198000.thermal active
> /devices/platform/soc/e6020000.watchdog active
> /devices/platform/soc/ee140000.sd active
> /devices/platform/soc/ec500000.sound suspended
> /devices/platform/soc/e61c0000.interrupt-controller active
> /devices/platform/soc/ee080200.usb-phy active
> /devices/platform/soc/ee080100.usb unsupported
> /devices/platform/soc/ee080000.usb suspended
> /devices/platform/soc/ee100000.sd active
> /devices/platform/soc/ee160000.sd active
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
--
Regards
Thara
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-14 20:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 20:27 [PATCH V2 0/2] PM / Domains: Expand generic power domain debugfs Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 1/2] PM / Domains: Add time accounting to various genpd states Thara Gopinath
2017-06-13 20:27 ` [PATCH V2 2/2] PM / Domains: Extend generic power domain debugfs Thara Gopinath
2017-06-14 8:01 ` Geert Uytterhoeven
2017-06-14 8:26 ` Geert Uytterhoeven
2017-06-14 8:24 ` [PATCH V2 0/2] PM / Domains: Expand " Geert Uytterhoeven
2017-06-14 20:59 ` Thara Gopinath
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).