powerd++  0.4.4
Classes | Public Member Functions | Public Attributes | List of all members
anonymous_namespace{powerd++.cpp}::Global Struct Reference

A collection of all the gloabl, mutable states. More...

Collaboration diagram for anonymous_namespace{powerd++.cpp}::Global:
[legend]

Classes

struct  ACSet
 Per AC line state settings. More...
 

Public Member Functions

 Global ()
 Perform initialisations that cannot fail/throw.
 

Public Attributes

volatile sig_atomic_t signal {0}
 The last signal received, used for terminating.
 
size_t samples {4}
 The number of load samples to take.
 
ms interval {500}
 The polling interval.
 
size_t sample {0}
 The current sample.
 
const SysctlOnce< coreid_t, 2 > ncpu {1, {CTL_HW, HW_NCPU}}
 The number of CPU cores or threads.
 
ACSet acstates [3]
 The power states. More...
 
Sysctl< 0 > acline_ctl
 The hw.acpi.acline ctl.
 
bool verbose {false}
 Verbose mode.
 
bool foreground {false}
 Foreground mode.
 
bool idleStates [CPUSTATES] {}
 The list of states considered idle.
 
bool temp_throttling {false}
 Temperature throttling mode.
 
decikelvin_t temp_crit {0}
 User set critical core temperature in dK.
 
decikelvin_t temp_high {0}
 User set high core temperature in dK.
 
const char * pidfilename {POWERD_PIDFILE}
 Name of an alternative pidfile. More...
 
Sysctl< 0 > cp_times_ctl
 The kern.cp_times sysctl.
 
const char * tempctl_name {TEMPERATURE}
 The sysctl name pattern for the temperature sysctl. More...
 
std::unique_ptr< cptime_t[][CPUSTATES]> cp_times
 The kern.cp_times buffer for all cores.
 
std::unique_ptr< Core[]> cores {new Core[this->ncpu]}
 This buffer is to be allocated with ncpu instances of the Core struct to store the management information of every core.
 
coreid_t ngroups {0}
 The number of frequency controlling core groups.
 
std::unique_ptr< CoreGroup[]> groups {nullptr}
 This buffer is to be allocated with the number of core groups. More...
 

Detailed Description

A collection of all the gloabl, mutable states.

This is mostly for semantic clarity.


Class Documentation

◆ anonymous_namespace{powerd++.cpp}::Global::ACSet

struct anonymous_namespace{powerd++.cpp}::Global::ACSet

Per AC line state settings.

Collaboration diagram for anonymous_namespace{powerd++.cpp}::Global::ACSet:
[legend]
Class Members
mhz_t freq_max Highest frequency to set in MHz.
mhz_t freq_min Lowest frequency to set in MHz.
const char *const name The string representation of this state.
mhz_t target_freq Fixed clock frequencies to use if the target load is set to 0.
cptime_t target_load Target load times [0, 1024].

The value 0 indicates the corresponding fixed frequency setting from target_freqs should be used.

Member Data Documentation

◆ acstates

ACSet anonymous_namespace{powerd++.cpp}::Global::acstates[3]
Initial value:
{
{FREQ_UNSET, FREQ_UNSET, ADP, 0, "battery"},
{FREQ_UNSET, FREQ_UNSET, HADP, 0, "online"},
}

The power states.

◆ groups

std::unique_ptr<CoreGroup[]> anonymous_namespace{powerd++.cpp}::Global::groups {nullptr}

This buffer is to be allocated with the number of core groups.

A core group is created by init() for each core that has a dev.cpu.d.freq handle.

◆ pidfilename

const char* anonymous_namespace{powerd++.cpp}::Global::pidfilename {POWERD_PIDFILE}

Name of an alternative pidfile.

If not given pidfile_open() uses a default name.

◆ tempctl_name

const char* anonymous_namespace{powerd++.cpp}::Global::tempctl_name {TEMPERATURE}

The sysctl name pattern for the temperature sysctl.

May contain a single d.


The documentation for this struct was generated from the following file:
constants::FREQ_UNSET
const types::mhz_t FREQ_UNSET
Clock frequency representing an uninitialised value.
Definition: constants.hpp:83
constants::HADP
const types::cptime_t HADP
The load target for hiadaptive mode, equals 37.5% load.
Definition: constants.hpp:98
constants::FREQ_DEFAULT_MAX
const types::mhz_t FREQ_DEFAULT_MAX
Default maximum clock frequency value.
Definition: constants.hpp:73
constants::FREQ_DEFAULT_MIN
const types::mhz_t FREQ_DEFAULT_MIN
Default minimum clock frequency value.
Definition: constants.hpp:78
constants::ADP
const types::cptime_t ADP
The load target for adaptive mode, equals 50% load.
Definition: constants.hpp:93