summaryrefslogtreecommitdiff
path: root/tools/power/cpupower/utils/idle_monitor
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.com>2016-04-28 13:24:40 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-28 14:02:29 (GMT)
commitac5a181d065d74fb6b213d538f743392f27bcdbd (patch)
treece5eab193a80e4514c1ebe931c391af57741a99d /tools/power/cpupower/utils/idle_monitor
parentfe7656a8e8fcb3a0151b36b2f4c66763fa9553ea (diff)
downloadlinux-ac5a181d065d74fb6b213d538f743392f27bcdbd.tar.xz
cpupower: Add cpuidle parts into library
This more or less is a renaming and moving of functions and should not introduce any functional change. cpupower was built from cpufrequtils (which had a C library providing easy access to cpu frequency platform info). In the meantime it got enhanced by quite some neat cpuidle userspace tools. Now the cpu idle functions have been separated and added to the cpupower.so library. So beside an already existing public header file: cpufreq.h cpupower now also exports these cpu idle functions in: cpuidle.h Here again pasted for better review of the interfaces: ====================================== int cpuidle_is_state_disabled(unsigned int cpu, unsigned int idlestate); int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate, unsigned int disable); unsigned long cpuidle_state_latency(unsigned int cpu, unsigned int idlestate); unsigned long cpuidle_state_usage(unsigned int cpu, unsigned int idlestate); unsigned long long cpuidle_state_time(unsigned int cpu, unsigned int idlestate); char *cpuidle_state_name(unsigned int cpu, unsigned int idlestate); char *cpuidle_state_desc(unsigned int cpu, unsigned int idlestate); unsigned int cpuidle_state_count(unsigned int cpu); char *cpuidle_get_governor(void); char *cpuidle_get_driver(void); ====================================== Signed-off-by: Thomas Renninger <trenn@suse.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/cpupower/utils/idle_monitor')
-rw-r--r--tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
index bcd22a1..1b5da00 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
@@ -10,8 +10,8 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
+#include <cpuidle.h>
-#include "helpers/sysfs.h"
#include "helpers/helpers.h"
#include "idle_monitor/cpupower-monitor.h"
@@ -51,7 +51,7 @@ static int cpuidle_start(void)
for (state = 0; state < cpuidle_sysfs_monitor.hw_states_num;
state++) {
previous_count[cpu][state] =
- sysfs_get_idlestate_time(cpu, state);
+ cpuidle_state_time(cpu, state);
dprint("CPU %d - State: %d - Val: %llu\n",
cpu, state, previous_count[cpu][state]);
}
@@ -70,7 +70,7 @@ static int cpuidle_stop(void)
for (state = 0; state < cpuidle_sysfs_monitor.hw_states_num;
state++) {
current_count[cpu][state] =
- sysfs_get_idlestate_time(cpu, state);
+ cpuidle_state_time(cpu, state);
dprint("CPU %d - State: %d - Val: %llu\n",
cpu, state, previous_count[cpu][state]);
}
@@ -132,13 +132,13 @@ static struct cpuidle_monitor *cpuidle_register(void)
char *tmp;
/* Assume idle state count is the same for all CPUs */
- cpuidle_sysfs_monitor.hw_states_num = sysfs_get_idlestate_count(0);
+ cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(0);
if (cpuidle_sysfs_monitor.hw_states_num <= 0)
return NULL;
for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) {
- tmp = sysfs_get_idlestate_name(0, num);
+ tmp = cpuidle_state_name(0, num);
if (tmp == NULL)
continue;
@@ -146,7 +146,7 @@ static struct cpuidle_monitor *cpuidle_register(void)
strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1);
free(tmp);
- tmp = sysfs_get_idlestate_desc(0, num);
+ tmp = cpuidle_state_desc(0, num);
if (tmp == NULL)
continue;
strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1);