cpupowerutils - cpufrequtils extended with quite some features

CPU power consumption vs performance tuning is no longer
limited to CPU frequency switching anymore: deep sleep states,
traditional dynamic frequency scaling and hidden turbo/boost
frequencies are tied close together and depend on each other.
The first two exist on different architectures like PPC, Itanium and
ARM, the latter (so far) only on X86. On X86 the APU (CPU+GPU) will
only run most efficiently if CPU and GPU has proper power management
in place.

Users and Developers want to have *one* tool to get an overview what
their system supports and to monitor and debug CPU power management
in detail. The tool should compile and work on as many architectures
as possible.

Once this tool stabilizes a bit, it is intended to replace the
Intel-specific tools in tools/power/x86

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Dominik Brodowski
2011-03-30 16:30:11 +02:00
parent 02f8c6aee8
commit 7fe2f6399a
73 changed files with 14423 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#if defined(__i386__) || defined(__x86_64__)
#include "helpers/helpers.h"
int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active, int * states)
{
struct cpupower_cpu_info cpu_info;
int ret;
*support = *active = *states = 0;
ret = get_cpu_info(0, &cpu_info);
if (ret)
return ret;
if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_CBP) {
*support = 1;
amd_pci_get_num_boost_states(active, states);
if (ret <= 0)
return ret;
*support = 1;
} else if (cpupower_cpu_info.vendor == X86_VENDOR_INTEL) {
ret = msr_intel_has_boost_support(cpu);
if (ret <= 0)
return ret;
*support = ret;
ret = msr_intel_boost_is_active(cpu);
if (ret <= 0)
return ret;
*active = ret;
}
return 0;
}
#endif /* #if defined(__i386__) || defined(__x86_64__) */