summaryrefslogtreecommitdiff
path: root/tools/power/cpupower/utils/cpuidle-info.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-09-11 04:34:46 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-09-11 04:34:46 -0300
commit863981e96738983919de841ec669e157e6bdaeb0 (patch)
treed6d89a12e7eb8017837c057935a2271290907f76 /tools/power/cpupower/utils/cpuidle-info.c
parent8dec7c70575785729a6a9e6719a955e9c545bcab (diff)
Linux-libre 4.7.1-gnupck-4.7.1-gnu
Diffstat (limited to 'tools/power/cpupower/utils/cpuidle-info.c')
-rw-r--r--tools/power/cpupower/utils/cpuidle-info.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c
index 8bf8ab5ff..b59c85def 100644
--- a/tools/power/cpupower/utils/cpuidle-info.c
+++ b/tools/power/cpupower/utils/cpuidle-info.c
@@ -13,8 +13,10 @@
#include <string.h>
#include <getopt.h>
-#include "helpers/helpers.h"
+#include <cpuidle.h>
+
#include "helpers/sysfs.h"
+#include "helpers/helpers.h"
#include "helpers/bitmask.h"
#define LINE_LEN 10
@@ -24,7 +26,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
unsigned int idlestates, idlestate;
char *tmp;
- idlestates = sysfs_get_idlestate_count(cpu);
+ idlestates = cpuidle_state_count(cpu);
if (idlestates == 0) {
printf(_("CPU %u: No idle states\n"), cpu);
return;
@@ -33,7 +35,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
printf(_("Number of idle states: %d\n"), idlestates);
printf(_("Available idle states:"));
for (idlestate = 0; idlestate < idlestates; idlestate++) {
- tmp = sysfs_get_idlestate_name(cpu, idlestate);
+ tmp = cpuidle_state_name(cpu, idlestate);
if (!tmp)
continue;
printf(" %s", tmp);
@@ -45,28 +47,28 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
return;
for (idlestate = 0; idlestate < idlestates; idlestate++) {
- int disabled = sysfs_is_idlestate_disabled(cpu, idlestate);
+ int disabled = cpuidle_is_state_disabled(cpu, idlestate);
/* Disabled interface not supported on older kernels */
if (disabled < 0)
disabled = 0;
- tmp = sysfs_get_idlestate_name(cpu, idlestate);
+ tmp = cpuidle_state_name(cpu, idlestate);
if (!tmp)
continue;
printf("%s%s:\n", tmp, (disabled) ? " (DISABLED) " : "");
free(tmp);
- tmp = sysfs_get_idlestate_desc(cpu, idlestate);
+ tmp = cpuidle_state_desc(cpu, idlestate);
if (!tmp)
continue;
printf(_("Flags/Description: %s\n"), tmp);
free(tmp);
printf(_("Latency: %lu\n"),
- sysfs_get_idlestate_latency(cpu, idlestate));
+ cpuidle_state_latency(cpu, idlestate));
printf(_("Usage: %lu\n"),
- sysfs_get_idlestate_usage(cpu, idlestate));
+ cpuidle_state_usage(cpu, idlestate));
printf(_("Duration: %llu\n"),
- sysfs_get_idlestate_time(cpu, idlestate));
+ cpuidle_state_time(cpu, idlestate));
}
}
@@ -74,7 +76,7 @@ static void cpuidle_general_output(void)
{
char *tmp;
- tmp = sysfs_get_cpuidle_driver();
+ tmp = cpuidle_get_driver();
if (!tmp) {
printf(_("Could not determine cpuidle driver\n"));
return;
@@ -83,7 +85,7 @@ static void cpuidle_general_output(void)
printf(_("CPUidle driver: %s\n"), tmp);
free(tmp);
- tmp = sysfs_get_cpuidle_governor();
+ tmp = cpuidle_get_governor();
if (!tmp) {
printf(_("Could not determine cpuidle governor\n"));
return;
@@ -98,7 +100,7 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
long max_allowed_cstate = 2000000000;
unsigned int cstate, cstates;
- cstates = sysfs_get_idlestate_count(cpu);
+ cstates = cpuidle_state_count(cpu);
if (cstates == 0) {
printf(_("CPU %u: No C-states info\n"), cpu);
return;
@@ -113,11 +115,11 @@ static void proc_cpuidle_cpu_output(unsigned int cpu)
"type[C%d] "), cstate, cstate);
printf(_("promotion[--] demotion[--] "));
printf(_("latency[%03lu] "),
- sysfs_get_idlestate_latency(cpu, cstate));
+ cpuidle_state_latency(cpu, cstate));
printf(_("usage[%08lu] "),
- sysfs_get_idlestate_usage(cpu, cstate));
+ cpuidle_state_usage(cpu, cstate));
printf(_("duration[%020Lu] \n"),
- sysfs_get_idlestate_time(cpu, cstate));
+ cpuidle_state_time(cpu, cstate));
}
}