Skip to contentSkip to conversation

cpuidle: sysfs: Export target residency information

PATCH In review Daniel Lezcano 2 participants 3 messages Mar 17, 2014 – Apr 8, 2014 CPU idle time management framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuidle: sysfs: Export target residency information

Quoted 1 line

From userspace, there is no way to know the target residency for each idle

state. If we want to write tools to measure the accuracy of the idle state selection from the governor, we need this info.

As the exit latency is exported through sysfs, exporting the target residency in the same place makes sense.

---
 drivers/cpuidle/sysfs.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/cpuidle/sysfs.c +3 -0
index e918b6d..efe2f17 100644
@@ -293,6 +293,7 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
 }
 
 define_show_state_function(exit_latency)
+define_show_state_function(target_residency)
 define_show_state_function(power_usage)
 define_show_state_ull_function(usage)
 define_show_state_ull_function(time)
@@ -304,6 +305,7 @@ define_store_state_ull_function(disable)
 define_one_state_ro(name, show_state_name);
 define_one_state_ro(desc, show_state_desc);
 define_one_state_ro(latency, show_state_exit_latency);
+define_one_state_ro(residency, show_state_target_residency);
 define_one_state_ro(power, show_state_power_usage);
 define_one_state_ro(usage, show_state_usage);
 define_one_state_ro(time, show_state_time);
@@ -313,6 +315,7 @@ static struct attribute *cpuidle_state_default_attrs[] = {
 	&attr_name.attr,
 	&attr_desc.attr,
 	&attr_latency.attr,
+	&attr_residency.attr,
 	&attr_power.attr,
 	&attr_usage.attr,
 	&attr_time.attr,
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 9 lines · Daniel Lezcano

From userspace, there is no way to know the target residency for each idle
state. If we want to write tools to measure the accuracy of the idle state selection from the governor, we need this info.

As the exit latency is exported through sysfs, exporting the target residency in the same place makes sense.

---

Hi Rafael,

are you willing to take this patch ?

Thanks
-- Daniel

Quoted 32 lines
  drivers/cpuidle/sysfs.c |    3 +++
  1 file changed, 3 insertions(+)
drivers/cpuidle/sysfs.c +3 -0
index e918b6d..efe2f17 100644
@@ -293,6 +293,7 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
  }
 
  define_show_state_function(exit_latency)
+define_show_state_function(target_residency)
  define_show_state_function(power_usage)
  define_show_state_ull_function(usage)
  define_show_state_ull_function(time)
@@ -304,6 +305,7 @@ define_store_state_ull_function(disable)
  define_one_state_ro(name, show_state_name);
  define_one_state_ro(desc, show_state_desc);
  define_one_state_ro(latency, show_state_exit_latency);
+define_one_state_ro(residency, show_state_target_residency);
  define_one_state_ro(power, show_state_power_usage);
  define_one_state_ro(usage, show_state_usage);
  define_one_state_ro(time, show_state_time);
@@ -313,6 +315,7 @@ static struct attribute *cpuidle_state_default_attrs[] = {
  	&attr_name.attr,
  	&attr_desc.attr,
  	&attr_latency.attr,
+	&attr_residency.attr,
  	&attr_power.attr,
  	&attr_usage.attr,
  	&attr_time.attr,
Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#2 lore raw
Quoted 8 lines · Daniel Lezcano
Quoted 7 lines · Daniel Lezcano

From userspace, there is no way to know the target residency for each idle
state. If we want to write tools to measure the accuracy of the idle state selection from the governor, we need this info.

As the exit latency is exported through sysfs, exporting the target residency in the same place makes sense.

Quoted 6 lines
Quoted 2 lines

---

Hi Rafael,

are you willing to take this patch ?

Yes, I'm going to take it.

Thanks!

Quoted 35 lines
Quoted 32 lines
  drivers/cpuidle/sysfs.c |    3 +++
  1 file changed, 3 insertions(+)
drivers/cpuidle/sysfs.c +3 -0
index e918b6d..efe2f17 100644
@@ -293,6 +293,7 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
  }
 
  define_show_state_function(exit_latency)
+define_show_state_function(target_residency)
  define_show_state_function(power_usage)
  define_show_state_ull_function(usage)
  define_show_state_ull_function(time)
@@ -304,6 +305,7 @@ define_store_state_ull_function(disable)
  define_one_state_ro(name, show_state_name);
  define_one_state_ro(desc, show_state_desc);
  define_one_state_ro(latency, show_state_exit_latency);
+define_one_state_ro(residency, show_state_target_residency);
  define_one_state_ro(power, show_state_power_usage);
  define_one_state_ro(usage, show_state_usage);
  define_one_state_ro(time, show_state_time);
@@ -313,6 +315,7 @@ static struct attribute *cpuidle_state_default_attrs[] = {
  	&attr_name.attr,
  	&attr_desc.attr,
  	&attr_latency.attr,
+	&attr_residency.attr,
  	&attr_power.attr,
  	&attr_usage.attr,
  	&attr_time.attr,
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.