Skip to content

Commit 6482439

Browse files
committed
Merge tag 'linux-cpupower-6.12-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/shuah/linux
Merge a cpupower utility update for 6.12 from Shuah Khan: "This cpupower update for Linux 6.12-rc1 consists of an enhancement to cpuidle tool to display the residency value of cpuidle states. This addition provides a clearer and more detailed view of idle state information when using cpuidle-info." * tag 'linux-cpupower-6.12-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/shuah/linux: tools/cpupower: display residency value in idle-info
2 parents 387ce37 + 76fb981 commit 6482439

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

tools/power/cpupower/lib/cpuidle.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ enum idlestate_value {
116116
IDLESTATE_USAGE,
117117
IDLESTATE_POWER,
118118
IDLESTATE_LATENCY,
119+
IDLESTATE_RESIDENCY,
119120
IDLESTATE_TIME,
120121
IDLESTATE_DISABLE,
121122
MAX_IDLESTATE_VALUE_FILES
@@ -125,6 +126,7 @@ static const char *idlestate_value_files[MAX_IDLESTATE_VALUE_FILES] = {
125126
[IDLESTATE_USAGE] = "usage",
126127
[IDLESTATE_POWER] = "power",
127128
[IDLESTATE_LATENCY] = "latency",
129+
[IDLESTATE_RESIDENCY] = "residency",
128130
[IDLESTATE_TIME] = "time",
129131
[IDLESTATE_DISABLE] = "disable",
130132
};
@@ -254,6 +256,12 @@ unsigned long cpuidle_state_latency(unsigned int cpu,
254256
return cpuidle_state_get_one_value(cpu, idlestate, IDLESTATE_LATENCY);
255257
}
256258

259+
unsigned long cpuidle_state_residency(unsigned int cpu,
260+
unsigned int idlestate)
261+
{
262+
return cpuidle_state_get_one_value(cpu, idlestate, IDLESTATE_RESIDENCY);
263+
}
264+
257265
unsigned long cpuidle_state_usage(unsigned int cpu,
258266
unsigned int idlestate)
259267
{

tools/power/cpupower/lib/cpuidle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate,
88
unsigned int disable);
99
unsigned long cpuidle_state_latency(unsigned int cpu,
1010
unsigned int idlestate);
11+
unsigned long cpuidle_state_residency(unsigned int cpu,
12+
unsigned int idlestate);
1113
unsigned long cpuidle_state_usage(unsigned int cpu,
1214
unsigned int idlestate);
1315
unsigned long long cpuidle_state_time(unsigned int cpu,

tools/power/cpupower/utils/cpuidle-info.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
6464

6565
printf(_("Latency: %lu\n"),
6666
cpuidle_state_latency(cpu, idlestate));
67+
printf(_("Residency: %lu\n"),
68+
cpuidle_state_residency(cpu, idlestate));
6769
printf(_("Usage: %lu\n"),
6870
cpuidle_state_usage(cpu, idlestate));
6971
printf(_("Duration: %llu\n"),
@@ -115,6 +117,8 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
115117
printf(_("promotion[--] demotion[--] "));
116118
printf(_("latency[%03lu] "),
117119
cpuidle_state_latency(cpu, cstate));
120+
printf(_("residency[%05lu] "),
121+
cpuidle_state_residency(cpu, cstate));
118122
printf(_("usage[%08lu] "),
119123
cpuidle_state_usage(cpu, cstate));
120124
printf(_("duration[%020Lu] \n"),

0 commit comments

Comments
 (0)