#include <cpufreq_management.h>
Public Member Functions | |
CpufreqManagement () | |
constructor | |
~CpufreqManagement () | |
destructor | |
void | init () |
creates the cpufreq objects for each base cpu | |
bool | isSupported () |
This can be called outside after calling createCPUFreqObject(). | |
void | adjustSpeeds () |
adjusts the speeds of all CPUs to their load (if in dynamic mode) | |
int | setModes (CPUFREQ_MODE mode, EventManagement *eM) |
set cpufreq policy for all CPUs | |
CPUFREQ_MODE | getMode () |
get the current cpu policy | |
void | reinitSpeeds () |
This function can be used if the userspace class thinks it run out of sync, what means it has another frequency stored that actually is active. IIRC this has been used after suspend, but should be obsolute. The same for the according reinitSpeed function. | |
void | rereadFrequencies () |
Reinitialises speeds. This function should be called if the frequencies could change unnoticably (e.g. after supsend, AC events, ...) This funcion should only be called if the userspace class is used. | |
int | setGovernors (const string &new_governor) |
set the governor on all CPUs | |
void | setConfigs () |
set configs of all cpus | |
CPUFREQ_CONTROL_MODE | controlMode () |
get the current control mode used | |
int | enableCPU (int cpu) |
enables a CPU | |
int | disableCPU (int cpu) |
disables a CPU | |
bool | hasControlMode (CPUFREQ_CONTROL_MODE control_mode) |
check if all cpufreq objects contain a control mode | |
Private Member Functions | |
bool | initSingleInterface (std::list< int > &cores, CPUFREQ_CONTROL_MODE control_mode) |
inits one single cpufreq interface | |
bool | getCoresAffectedCpus (std::list< std::list< int > > &cpu_list, int num_cpus) |
get cpu cores which belong together via the affectec_cpus file | |
bool | getCoresProcfile (list< list< int > > &cpu_list, int num_cpus) |
get cpucores which belong together via parsing /proc/cpuinfi | |
bool | readCpu (std::list< int > &core_list, int cpu) |
split up the given cpu in its siblings | |
bool | siblingExists (list< int > core_list, int core) |
check whether the given list contains the given core | |
void | checkCPUHotplug () |
checks CPU hotplugging depending on the scheme | |
Private Attributes | |
std::list< CPUFreq_Interface * > | _cpufreq_objects |
stl list holding all cpufreq objects | |
std::list< std::list< int > > | _cpus |
stl list holding all cpus | |
int | _control_modes |
bitmask containin control modes used | |
CPUFREQ_CONTROL_MODE | _initial_control_mode |
default control mode | |
int | _initial_cpu_count |
number of CPUs on startup |
|
constructor
|
|
destructor
|
|
adjusts the speeds of all CPUs to their load (if in dynamic mode)
|
|
checks CPU hotplugging depending on the scheme
|
|
get the current control mode used
|
|
disables a CPU
|
|
enables a CPU
|
|
get cpu cores which belong together via the affectec_cpus file
sockel 0 -------> core 0 | |----> core 1 | ... sockel 1 -------> core 0 | |----> core 1 | ...
|
|
get cpucores which belong together via parsing /proc/cpuinfi this function is kept to get cpufreq and multicores working with older kernels. It should not be needed with a kernel > 2.6.13
|
|
get the current cpu policy
|
|
check if all cpufreq objects contain a control mode
|
|
creates the cpufreq objects for each base cpu
|
|
inits one single cpufreq interface this function tries to initialize a cpufreq interface, either kernel or userspace. If kernel does not work, it falls back to a userspace object
|
|
This can be called outside after calling createCPUFreqObject().
|
|
split up the given cpu in its siblings
|
|
This function can be used if the userspace class thinks it run out of sync, what means it has another frequency stored that actually is active. IIRC this has been used after suspend, but should be obsolute. The same for the according reinitSpeed function.
|
|
Reinitialises speeds. This function should be called if the frequencies could change unnoticably (e.g. after supsend, AC events, ...) This funcion should only be called if the userspace class is used.
|
|
set configs of all cpus
|
|
set the governor on all CPUs
|
|
set cpufreq policy for all CPUs
|
|
check whether the given list contains the given core
|
|
bitmask containin control modes used
|
|
stl list holding all cpufreq objects
|
|
stl list holding all cpus
|
|
default control mode needed to check whether we automatically switched to userspace if kernel does not work. On scheme switch, we need this as reference whether the settings for the control mode changed. |
|
number of CPUs on startup
|