Class used to implement the SysfsIOGroup base class.
More...
#include <SysfsDriver.hpp>
|
| SysfsDriver ()=default |
|
virtual | ~SysfsDriver ()=default |
|
virtual int | domain_type (const std::string &name) const =0 |
| Get the PlatformTopo domain type for an named attribute. More...
|
|
virtual std::string | attribute_path (const std::string &name, int domain_idx)=0 |
| Get the path to the sysfs entry for signal. More...
|
|
virtual std::function< double(const std::string &)> | signal_parse (const std::string &signal_name) const =0 |
| Get function to convert contents of sysfs file into signal. More...
|
|
virtual std::function< std::string(double)> | control_gen (const std::string &control_name) const =0 |
| Get a function to convert a control into a sysfs string. More...
|
|
virtual std::string | driver (void) const =0 |
|
virtual std::map< std::string, SysfsDriver::properties_s > | properties (void) const =0 |
| Query the meta data about a signal or control. More...
|
|
Class used to implement the SysfsIOGroup base class.
This virtual interface can be adapted for each Linux device driver. A concrete implementation can be used to construct a SysfsIOGroup object.
◆ SysfsDriver()
geopm::SysfsDriver::SysfsDriver |
( |
| ) |
|
|
default |
◆ ~SysfsDriver()
virtual geopm::SysfsDriver::~SysfsDriver |
( |
| ) |
|
|
virtualdefault |
◆ attribute_path()
virtual std::string geopm::SysfsDriver::attribute_path |
( |
const std::string & |
name, |
|
|
int |
domain_idx |
|
) |
| |
|
pure virtual |
Get the path to the sysfs entry for signal.
- Parameters
-
[in] | name | The name of the signal or control |
[in] | domain_idx | The index of the domain within the set of domains of the same type on the platform. |
- Returns
- File path to the sysfs entry to be read.
Implemented in geopm::DrmSysfsDriver, and geopm::CpufreqSysfsDriver.
◆ control_gen()
virtual std::function<std::string(double)> geopm::SysfsDriver::control_gen |
( |
const std::string & |
control_name | ) |
const |
|
pure virtual |
Get a function to convert a control into a sysfs string.
Converts from the SI unit control into the text representation required by the device driver.
- Parameters
-
[in] | signal_name | The name of the signal. |
- Returns
- Function returning string content to be written to sysfs file.
Implemented in geopm::DrmSysfsDriver, and geopm::CpufreqSysfsDriver.
◆ domain_type()
virtual int geopm::SysfsDriver::domain_type |
( |
const std::string & |
name | ) |
const |
|
pure virtual |
◆ driver()
virtual std::string geopm::SysfsDriver::driver |
( |
void |
| ) |
const |
|
pure virtual |
◆ parse_properties_json()
std::map< std::string, SysfsDriver::properties_s > geopm::SysfsDriver::parse_properties_json |
( |
const std::string & |
iogroup_name, |
|
|
const std::string & |
properties_json |
|
) |
| |
|
static |
◆ properties()
◆ signal_parse()
virtual std::function<double(const std::string&)> geopm::SysfsDriver::signal_parse |
( |
const std::string & |
signal_name | ) |
const |
|
pure virtual |
Get function to convert contents of sysfs file into signal.
This parsing includes the conversion of the numerical data into SI units.
- Parameters
-
[in] | properties_id | The unique identifier of the signal. |
[in] | content | The string content read from the sysfs file. |
- Returns
- The parsed signal value in SI units.
Implemented in geopm::DrmSysfsDriver, and geopm::CpufreqSysfsDriver.
◆ M_IO_BUFFER_SIZE
constexpr size_t geopm::SysfsDriver::M_IO_BUFFER_SIZE = 128 |
|
staticconstexpr |
Arbitrary buffer size.
We're generally looking at integer values much shorter than 100 digits in length. The IOGroup performs string truncation checks in case that ever changes.
The documentation for this class was generated from the following files: