|
powerd++
0.4.4
|
Implements powerd++ a drop in replacement for FreeBSD's powerd. More...
#include "Options.hpp"#include "Cycle.hpp"#include "types.hpp"#include "constants.hpp"#include "errors.hpp"#include "clas.hpp"#include "utility.hpp"#include "sys/sysctl.hpp"#include "sys/pidfile.hpp"#include "sys/signal.hpp"#include "sys/io.hpp"#include <locale>#include <memory>#include <algorithm>#include <limits>#include <cstdlib>#include <cstdint>#include <sys/resource.h>Classes | |
| struct | anonymous_namespace{powerd++.cpp}::CoreGroup |
| Contains the management information for a group of cores with a common clock frequency. More... | |
| struct | anonymous_namespace{powerd++.cpp}::Core |
| Contains the management information for a single CPU core. More... | |
| struct | anonymous_namespace{powerd++.cpp}::Global |
| A collection of all the gloabl, mutable states. More... | |
| struct | anonymous_namespace{powerd++.cpp}::Global::ACSet |
| Per AC line state settings. More... | |
| class | anonymous_namespace{powerd++.cpp}::FreqGuard |
| A core frequency guard. More... | |
Namespaces | |
| anonymous_namespace{powerd++.cpp} | |
| File local scope. | |
Functions | |
| template<typename... MsgTs> | |
| void | anonymous_namespace{powerd++.cpp}::verbose (MsgTs &&... msg) |
| Outputs the given printf style message on stderr if g.verbose is set. More... | |
| void | anonymous_namespace{powerd++.cpp}::sysctl_fail (sys::sc_error< sys::ctl::error > const err) |
| Treat sysctl errors. More... | |
| void | anonymous_namespace{powerd++.cpp}::init () |
| Perform initial tasks. More... | |
| template<bool Load = 1, bool Temperature = 0> | |
| void | anonymous_namespace{powerd++.cpp}::update_loads () |
| Updates the cp_times ring buffer and computes the load average for each core. More... | |
| template<> | |
| void | anonymous_namespace{powerd++.cpp}::update_loads< 0, 0 > () |
| Do nada if neither load nor temperature are to be updated. | |
| template<bool Foreground, bool Temperature, bool Fixed> | |
| void | anonymous_namespace{powerd++.cpp}::update_freq (Global::ACSet const &acstate) |
| Update the CPU clocks depending on the AC line state and targets. More... | |
| void | anonymous_namespace{powerd++.cpp}::update_freq () |
| Dispatch update_freq<>(). | |
| void | anonymous_namespace{powerd++.cpp}::init_loads () |
| Fill the loads buffers with n samples. More... | |
| void | anonymous_namespace{powerd++.cpp}::set_mode (AcLineState const line, char const *const str) |
| Sets a load target or fixed frequency for the given AC line state. More... | |
| void | anonymous_namespace{powerd++.cpp}::read_args (int const argc, char const *const argv[]) |
| Parse command line arguments. More... | |
| void | anonymous_namespace{powerd++.cpp}::show_settings () |
| Prints the configuration on stderr in verbose mode. | |
| void | anonymous_namespace{powerd++.cpp}::signal_recv (int signal) |
| Sets g.signal, terminating the main loop. More... | |
| void | anonymous_namespace{powerd++.cpp}::run_daemon () |
| Daemonise and run the main loop. | |
| int | main (int argc, char *argv[]) |
| Main routine, setup and execute daemon, print errors. More... | |
Variables | |
| struct anonymous_namespace{powerd++.cpp}::Global | anonymous_namespace{powerd++.cpp}::g |
| The gobal state. | |
| const char *const | anonymous_namespace{powerd++.cpp}::USAGE = "[-hvfN] [-abn mode] [-mM freq] [-FAB freq:freq] [-H temp:temp] [-t sysctl] [-p ival] [-s cnt] [-P file]" |
| The short usage string. | |
| const Parameter< OE > | anonymous_namespace{powerd++.cpp}::PARAMETERS [] |
| Definitions of command line parameters. More... | |
Implements powerd++ a drop in replacement for FreeBSD's powerd.
| struct anonymous_namespace{powerd++.cpp}::CoreGroup |
Contains the management information for a group of cores with a common clock frequency.
| Class Members | ||
|---|---|---|
| coreid_t | corei |
The number of the core owning dev.cpu. d.freq. |
| SysctlSync< mhz_t > | freq |
The sysctl dev.cpu. d.freq. |
| Max< mhz_t > | load |
The maximum load reported by all cores in the group. This is updated by update_loads(). |
| unique_ptr< mhz_t[]> | loads |
A ring buffer of maximum load samples for this core group. Each maximum load sample is weighted with the core frequency at which it was taken. This is updated by update_loads(). |
| mhz_t | loadsum |
The maximum load sum of all controlled cores. This is updated by update_loads(). |
| Min< mhz_t > | max |
The maximum group clock rate. The least of all core maxima in the group. |
| Max< mhz_t > | min |
The minimum group clock rate. The greatest of all core minima in the group. |
| mhz_t | sample_freq |
The dev.cpu. d.freq value for the current load sample. This is updated by update_loads(). |
| Max< decikelvin_t > | temp | The maximum temperature measurement taken in the group. |
| Min< decikelvin_t > | temp_crit | Critical core temperature in dK. |
| Min< decikelvin_t > | temp_high | High core temperature in dK. |
| struct anonymous_namespace{powerd++.cpp}::Core |
Contains the management information for a single CPU core.
| Class Members | ||
|---|---|---|
| cptime_t | all | Count of all ticks. |
| const cptime_t * | cp_time | A pointer to the kern.cp_times section for this core. |
| CoreGroup * | group | The core that controls the frequency for this core. |
| cptime_t | idle | The idle ticks count. |
| SysctlSync< decikelvin_t > | temp |
The dev.cpu. d.temperature sysctl, if present. |
| struct anonymous_namespace{powerd++.cpp}::Global::ACSet |
Per AC line state settings.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Main routine, setup and execute daemon, print errors.
| argc,argv | The command line arguments |
1.8.17