CPUFreq_Kernel Class Reference

Class to control one CPU's frequency by a kernel governor. More...

#include <cpufreq_interface.h>

Inheritance diagram for CPUFreq_Kernel:

CPUFreq_Interface CPU List of all members.

Public Member Functions

 CPUFreq_Kernel (std::list< int > cpu_list, unsigned long sampling_rate=333000)
 constructor
 ~CPUFreq_Kernel ()
 destructor
bool init ()
 init cpufreq interface and set kernel governor

Private Member Functions

bool readFrequencies ()
 reads out frequencies
int adjustSpeed ()
 adjusts speeds
void reinitSpeed ()
 reinits speeds
void setConfig ()
 set configuration in initialize values
int writeOndemand (const string &name, int value)
 write a value to an ondemand file

Private Attributes

unsigned long _sampling_rate
 the sampling rate to use
int _down_threshold
 down threshold
int _sampling_down_factor
 _sampling down factor
string ON_DEMAND_STRING
 name of ondemand governor to write to governor file
string POWERSAVE_STRING
 name of powersave governor to write to governor file
string PERFORMANCE_STRING
 name of performance governor to write to governor file

Detailed Description

Class to control one CPU's frequency by a kernel governor.


Constructor & Destructor Documentation

CPUFreq_Kernel::CPUFreq_Kernel std::list< int >  cpu_list,
unsigned long  sampling_rate = 333000
 

constructor

Parameters:
cpu_list stl list containing all cores the object has to care about
sampling_rate the sampling rate to use

CPUFreq_Kernel::~CPUFreq_Kernel  ) 
 

destructor


Member Function Documentation

int CPUFreq_Kernel::adjustSpeed  )  [private, virtual]
 

adjusts speeds

Returns:
  • -1 if speed has been decreased
  • 1 if speed has been increased
  • 0 if speed has not been modified

Implements CPUFreq_Interface.

bool CPUFreq_Kernel::init  )  [virtual]
 

init cpufreq interface and set kernel governor

Returns:
true on success, false otherwise

Implements CPUFreq_Interface.

bool CPUFreq_Kernel::readFrequencies  )  [private, virtual]
 

reads out frequencies

Returns:
false on error

Implements CPUFreq_Interface.

void CPUFreq_Kernel::reinitSpeed  )  [private, virtual]
 

reinits speeds

function for suspend workaround. after resuming the frequency might have changed and we haven't recognized. This could possibly break old PowerNow! machines, but as far as I know jumping more than one frequency at once is fixed in kernel module for that machines

Implements CPUFreq_Interface.

void CPUFreq_Kernel::setConfig  )  [private, virtual]
 

set configuration in initialize values

Implements CPUFreq_Interface.

int CPUFreq_Kernel::writeOndemand const string &  name,
int  value
[private]
 

write a value to an ondemand file

write value to a file in /sys/.../cpufreq/ondemand/

Parameters:
name the name of the file to write to
value the value to write
Returns:
0 on success
Return values:
-1 if file does not exist
1 if writing failed
0 on success


Member Data Documentation

int CPUFreq_Kernel::_down_threshold [private]
 

down threshold

int CPUFreq_Kernel::_sampling_down_factor [private]
 

_sampling down factor

unsigned long CPUFreq_Kernel::_sampling_rate [private]
 

the sampling rate to use

string CPUFreq_Kernel::ON_DEMAND_STRING [private]
 

name of ondemand governor to write to governor file

string CPUFreq_Kernel::PERFORMANCE_STRING [private]
 

name of performance governor to write to governor file

string CPUFreq_Kernel::POWERSAVE_STRING [private]
 

name of powersave governor to write to governor file


The documentation for this class was generated from the following files:
Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6