powerd++
0.4.4
|
File local scope. More...
Classes | |
class | Callback |
Implements a recursion safe std::function wrapper. More... | |
struct | CoreFrameReport |
The report frame information for a single CPU pipeline. More... | |
struct | CoreReport |
The reported state of a single CPU pipeline. More... | |
class | Emulator |
Instances of this class represent an emulator session. More... | |
class | Hold |
Sets a referenced variable to a given value and restores it when going out of context. More... | |
class | Main |
Singleton class representing the main execution environment. More... | |
struct | mib_t |
Represents MIB, but wraps it to provide the necessary operators to use it as an std::map key. More... | |
class | Report |
Provides a mechanism to provide frame wise per core load information. More... | |
class | Sysctls |
Singleton class representing the sysctl table for this library. More... | |
class | SysctlValue |
Instances of this class represents a specific sysctl value. More... | |
Typedefs | |
using | cycles_t = uint64_t |
Clock cycle counting type. | |
template<auto Ownership> | |
using | ofile = io::file< Ownership, io::write > |
Output file type alias. More... | |
template<auto Ownership> | |
using | ifile = io::file< Ownership, io::read > |
Input file type alias. More... | |
Functions | |
template<size_t Size> | |
int | strcmp (char const *const s1, char const (&s2)[Size]) |
Safe wrapper around strncmp, which automatically determines the buffer size of s2. More... | |
std::regex | operator""_r (char const *const str, size_t const len) |
User defined literal for regular expressions. More... | |
template<typename ... ArgTs> | |
constexpr void | dprintf (ArgTs &&... args) |
Calls io::ferr.printf(...) if built with -DEBUG. More... | |
template<> | |
std::string | SysctlValue::get< std::string > () const |
Returns a copy of the value string. More... | |
template<typename... MsgTs> | |
ofile< io::link > | debug (MsgTs &&... msg) |
Print a debugging message if built with -DEBUG. More... | |
template<typename... MsgTs> | |
ofile< io::link > | warn (MsgTs &&... msg) |
Print a warning. More... | |
int | sys_result (int const result) |
Combine sys_results with a computed result. More... | |
template<typename... MsgTs> | |
ofile< io::link > | fail (MsgTs &&... msg) |
This prints an error message and sets sys_results to make the hijacked process fail. More... | |
ofile< io::link > | operator<< (ofile< io::link > fout, CoreFrameReport const &frame) |
Print recorded and running clock frequency and load for a frame. More... | |
Variables | |
constexpr const flag_t | FEATURES |
The set of supported features. More... | |
int | sys_results = 0 |
The success return value of intercepted functions. | |
class anonymous_namespace{libloadplay.cpp}::Sysctls | sysctls |
Sole instance of Sysctls. | |
bool | sysctl_startup = true |
Set to activate fallback to the original sysctl functions. More... | |
class anonymous_namespace{libloadplay.cpp}::Main | main |
Sole instance of Main. | |
File local scope.
struct anonymous_namespace{libloadplay.cpp}::CoreFrameReport |
The report frame information for a single CPU pipeline.
Class Members | ||
---|---|---|
CoreReport | rec | The recorded core state. |
CoreReport | run | The running core state. |
struct anonymous_namespace{libloadplay.cpp}::CoreReport |
The reported state of a single CPU pipeline.
Class Members | ||
---|---|---|
mhz_t | freq | The core clock frequency in [MHz]. |
double | load | The core load as a fraction. |
using anonymous_namespace{libloadplay.cpp}::ifile = typedef io::file<Ownership, io::read> |
Input file type alias.
Ownership | The io::ownership type of the file |
using anonymous_namespace{libloadplay.cpp}::ofile = typedef io::file<Ownership, io::write> |
Output file type alias.
Ownership | The io::ownership type of the file |
|
inline |
Print a debugging message if built with -DEBUG.
MsgTs | The message argument types |
msg | The debugging message |
|
constexpr |
Calls io::ferr.printf(...) if built with -DEBUG.
ArgTs | The argument types to forward |
args | Arguments are forwarded to fprintf() |
|
inline |
This prints an error message and sets sys_results to make the hijacked process fail.
MsgTs | The message argument types |
msg | The error message |
|
inline |
User defined literal for regular expressions.
str,len | The literal string and its length |
ofile<io::link> anonymous_namespace{libloadplay.cpp}::operator<< | ( | ofile< io::link > | fout, |
CoreFrameReport const & | frame | ||
) |
Print recorded and running clock frequency and load for a frame.
The clock frequency is printed at 1 MHz resolution, the load at 0.1 MHz.
fout | The stream to print to |
frame | The frame information to print |
|
inline |
Safe wrapper around strncmp, which automatically determines the buffer size of s2.
Size | The size of the buffer s2 |
s1,s2 | The strings to compare |
0 | Strings are equal |
!0 | Strings are not equal |
|
inline |
Combine sys_results with a computed result.
result | A computed result |
sys_results | If sys_results is a non-zero value |
result | If sys_results is set to 0 |
std::string anonymous_namespace{libloadplay.cpp}::SysctlValue::get< std::string > | ( | ) | const |
Returns a copy of the value string.
|
inline |
Print a warning.
MsgTs | The message argument types |
msg | The warning message |
|
constexpr |
The set of supported features.
This value is used to ensure correct input data interpretation.
bool anonymous_namespace{libloadplay.cpp}::sysctl_startup = true |
Set to activate fallback to the original sysctl functions.
This is reset when Main initialisation completes.