PS_Config Class Reference

Powersave configuration class. More...

#include <config_pm.h>

Inheritance diagram for PS_Config:

GeneralConfig SchemeConfig List of all members.

Public Types

typedef map< string, Event
>::iterator 
EventIter

Public Member Functions

 PS_Config ()
 constructor
virtual ~PS_Config ()
 destructor
virtual EventgetEvent (const string &event_name)
virtual int readConfigFile (const std::string &file="")
virtual void assignConfigEntries ()

Public Attributes

ThermalDev thermal_zones [MAX_THERMAL_ZONES]
string SCHEME_NAME
 a scheme name
string SCHEME_DESCRIPTION
 the scheme description
CPUFREQ_CONTROL_MODE CPUFREQ_CONTROL
 cpufreq should be controlled by userspace or kernel
int CPU_HIGH_LIMIT
 cpu load percentage at which we increase the cpu speed
THERMAL_MANAGEMENT_DELIGATION ENABLE_THERMAL_MANAGEMENT
unsigned long POLL_INTERVAL
 how long our event loop sleeps (in miliseconds)
unsigned long CPU_IDLE_TIMEOUT
 timeout (seconds) after which an additional idle event is thrown
int CPU_IDLE_LIMIT
 cpu limit (in percent) under which after CPU_IDLE_TIMEOUT the idle event is thrown
int MAX_CPUS_ONLINE
 how many CPUs should be only at max
int CONSIDER_NICE
 should niced processes count for cpufreq calculation, too?
int USER_SUSPEND2DISK_DISABLED
 if suspend to disk is disabled
int USER_SUSPEND2RAM_DISABLED
 if suspend to ram is disabled
int USER_STANDBY_DISABLED
 if standby is disabled
int SUSPEND2DISK_DELAY
 the time to delay when a suspend to disk event is executed until the suspend is actually performed
int SUSPEND2RAM_DELAY
 the time to delay when a suspend to ram event is executed until the suspend is actually performed
int STANDBY_DELAY
 the time to delay when a standby event is executed until the standby is actually performed
int DISPLAY_BRIGHTNESS
 absolute brightness level (depends on driver) or: -1 ignore -2 low -3 medium -4 high
int POWER_BUTTON_DELAY
 time an button/power acpi event is delayed until going on
int BAT_WARN_LIMIT
int BAT_LOW_LIMIT
int BAT_CRIT_LIMIT
int JUMP_CPU_FREQ_MAX_LIMIT
 percent on which the cpu frequency is set immediately to maximum
bool CPUFREQ_ENABLED
 whether cpufrequency scaling is enabled
bool DPM_ENABLED
 if dpm is enabled
int CPUFREQ_HYSTERESIS
string BATTERY_SCHEME
 filename of the battery scheme without the leading scheme_*
string AC_SCHEME
 filename of the ac scheme without the leading scheme_*
bool ALLOW_THROTTLING
 if throttling is allowed
int MAX_CPU_THROTTLING
 the maximum percent to which get throttled
bool ALWAYS_THROTTLE
 if we should always throttle
CPUFREQ_MODE CPUFREQUENCY
 one of dynamic, powersave or performance
_COOLING_POLICY COOLING_POLICY
 the cooling policy, either active or passive
map< string, EventeventMap
std::list< DPM_DEVICE_CLASSdpmClasses

Private Types

typedef std::map< std::string,
std::string > 
StringMap
 an array that can be accessed by string name

Private Member Functions

void strtointErr (char *str, int line, const char *file)
 predefined message for debugging string to int conversion
int checkValue (const std::string &what, int min, int max)
 checks a value from a configuration file
int checkValue (const std::string &what, int min)
 checks a value from a configuration file
int checkValue (int def, const std::string &what, int min, int max)
 checks a value from a configuration file
int checkValue (int def, const std::string &what, int min)
 checks a value from a configuration file
int checkYes (const std::string &what)
 checks a value from a configuration file for yes/no
int checkYes (int def, const std::string &what)
 checks a value from a configuration file for yes/no
void splitLine (std::string line, std::list< std::string > &strings)
 split a line into single strings

Private Attributes

StringMap data
 holds all configuration variables

Detailed Description

Powersave configuration class.


Member Typedef Documentation

typedef map< string, Event >::iterator PS_Config::EventIter
 

map that contains all EVENT objects. All EVENT objects are initialised in PM_Interface constructor.

typedef std::map< std::string, std::string > PS_Config::StringMap [private]
 

an array that can be accessed by string name


Constructor & Destructor Documentation

PS_Config::PS_Config  ) 
 

constructor

PS_Config::~PS_Config  )  [virtual]
 

destructor


Member Function Documentation

void PS_Config::assignConfigEntries  )  [virtual]
 

int PS_Config::checkValue int  def,
const std::string &  what,
int  min
[private]
 

checks a value from a configuration file

Parameters:
def default value returned on error/empty value
what string containing an interger value from configuration file
min the minimum value allowed
Returns:
integer value contained in what, default value or negative value on error
Return values:
-1 string what is empty
-2 if integer contained in what outside of min or max

int PS_Config::checkValue int  def,
const std::string &  what,
int  min,
int  max
[private]
 

checks a value from a configuration file

Parameters:
def default value returned on error/empty value
what string containing an interger value from configuration file
min the minimum value allowed
max the maximum value allowed
Returns:
integer value contained in what, default value or negative value on error
Return values:
-1 string what is empty
-2 if integer contained in what outside of min or max

int PS_Config::checkValue const std::string &  what,
int  min
[private]
 

checks a value from a configuration file

Parameters:
what string containing an interger value from configuration file
min the minimum value allowed
Returns:
integer value contained in what, negative value on error
Return values:
-1 string what is empty
-2 if integer contained in what outside of min or max

int PS_Config::checkValue const std::string &  what,
int  min,
int  max
[private]
 

checks a value from a configuration file

Parameters:
what string containing an interger value from configuration file
min the minimum value allowed
max the maximum value allowed
Returns:
integer value contained in what, negative value on error
Return values:
-1 string what is empty
-2 if integer contained in what outside of min or max

int PS_Config::checkYes int  def,
const std::string &  what
[private]
 

checks a value from a configuration file for yes/no

Parameters:
def default value to return if value is empty
what string containing a value
Returns:
true if value is 'yes', def if empty
Return values:
def if empty value
1 if value is 'yes'
0 if value is not yes

int PS_Config::checkYes const std::string &  what  )  [private]
 

checks a value from a configuration file for yes/no

Parameters:
what string containing a value
Returns:
true if value is 'yes' or empty, false otherwise
Return values:
-1 if empty value
1 if value is 'yes'
0 if value is not yes

Event & PS_Config::getEvent const string &  event_name  )  [virtual]
 

int PS_Config::readConfigFile const std::string &  file = ""  )  [virtual]
 

void PS_Config::splitLine std::string  line,
std::list< std::string > &  strings
[private]
 

split a line into single strings

Parameters:
line the line to split delimited by whitespace(s)
strings list which gets filled with single values

void PS_Config::strtointErr char *  str,
int  line,
const char *  file
[private]
 

predefined message for debugging string to int conversion


Member Data Documentation

string PS_Config::AC_SCHEME
 

filename of the ac scheme without the leading scheme_*

Do not mix up with the SCHEME_NAME variable inside the scheme

bool PS_Config::ALLOW_THROTTLING
 

if throttling is allowed

bool PS_Config::ALWAYS_THROTTLE
 

if we should always throttle

int PS_Config::BAT_CRIT_LIMIT
 

int PS_Config::BAT_LOW_LIMIT
 

int PS_Config::BAT_WARN_LIMIT
 

string PS_Config::BATTERY_SCHEME
 

filename of the battery scheme without the leading scheme_*

Do not mix up with the SCHEME_NAME variable inside the scheme

int PS_Config::CONSIDER_NICE
 

should niced processes count for cpufreq calculation, too?

_COOLING_POLICY PS_Config::COOLING_POLICY
 

the cooling policy, either active or passive

int PS_Config::CPU_HIGH_LIMIT
 

cpu load percentage at which we increase the cpu speed

int PS_Config::CPU_IDLE_LIMIT
 

cpu limit (in percent) under which after CPU_IDLE_TIMEOUT the idle event is thrown

unsigned long PS_Config::CPU_IDLE_TIMEOUT
 

timeout (seconds) after which an additional idle event is thrown

CPUFREQ_CONTROL_MODE PS_Config::CPUFREQ_CONTROL
 

cpufreq should be controlled by userspace or kernel

bool PS_Config::CPUFREQ_ENABLED
 

whether cpufrequency scaling is enabled

int PS_Config::CPUFREQ_HYSTERESIS
 

The hysteresis for calculating the CPU load limit to switch to the next lover CPU frequency. Increasing this value lowers the load percentage at which the deamon switches down one step. This might be useful if you notice that the frequency continuously oscilates at a almost constant CPU usage (e.g. when watching a movie). 5 is default, you should not set it higher than 40. Zero is not allowed.

CPUFREQ_MODE PS_Config::CPUFREQUENCY
 

one of dynamic, powersave or performance

StringMap PS_Config::data [private]
 

holds all configuration variables

int PS_Config::DISPLAY_BRIGHTNESS
 

absolute brightness level (depends on driver) or: -1 ignore -2 low -3 medium -4 high

bool PS_Config::DPM_ENABLED
 

if dpm is enabled

std::list< DPM_DEVICE_CLASS > PS_Config::dpmClasses
 

list containing device classes DPM_DEVICE_CLASS which should get suspended

THERMAL_MANAGEMENT_DELIGATION PS_Config::ENABLE_THERMAL_MANAGEMENT
 

what't that. I can't find word deligation

map< string, Event > PS_Config::eventMap
 

Actions for events as specified in events config file or maybe specialised in a scheme configuration

int PS_Config::JUMP_CPU_FREQ_MAX_LIMIT
 

percent on which the cpu frequency is set immediately to maximum

Set the CPU load difference limit for which the highest available frequency is set immediately (e.g. if set to 60, it switches to full speed if the CPU load jumps from 5% to 66% or higher instead of ramping up through all available frequencies). Disable the direct triggering of the highest frequency by setting a value of 0.

int PS_Config::MAX_CPU_THROTTLING
 

the maximum percent to which get throttled

int PS_Config::MAX_CPUS_ONLINE
 

how many CPUs should be only at max

0 means all

unsigned long PS_Config::POLL_INTERVAL
 

how long our event loop sleeps (in miliseconds)

int PS_Config::POWER_BUTTON_DELAY
 

time an button/power acpi event is delayed until going on

string PS_Config::SCHEME_DESCRIPTION
 

the scheme description

string PS_Config::SCHEME_NAME
 

a scheme name

this will only be assigned with valid value for schemes

int PS_Config::STANDBY_DELAY
 

the time to delay when a standby event is executed until the standby is actually performed

int PS_Config::SUSPEND2DISK_DELAY
 

the time to delay when a suspend to disk event is executed until the suspend is actually performed

int PS_Config::SUSPEND2RAM_DELAY
 

the time to delay when a suspend to ram event is executed until the suspend is actually performed

ThermalDev PS_Config::thermal_zones[MAX_THERMAL_ZONES]
 

holds all thermal info coming from powerlib.h. It is initialised with kernel/BIOS values that could be overridden by config files

int PS_Config::USER_STANDBY_DISABLED
 

if standby is disabled

int PS_Config::USER_SUSPEND2DISK_DISABLED
 

if suspend to disk is disabled

int PS_Config::USER_SUSPEND2RAM_DISABLED
 

if suspend to ram is disabled


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