geopm 3.2.1.dev516+g3137a7fce
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
geopm::UncoreFreqSysfsDriver Class Reference

SysfsDriver implementation for the Linux intel_uncore_frequency driver. More...

#include <UncoreFreqSysfsDriver.hpp>

Inheritance diagram for geopm::UncoreFreqSysfsDriver:
Inheritance graph
[legend]
Collaboration diagram for geopm::UncoreFreqSysfsDriver:
Collaboration graph
[legend]

Public Member Functions

 UncoreFreqSysfsDriver ()
 
 UncoreFreqSysfsDriver (const std::string &uncore_directory)
 
virtual ~UncoreFreqSysfsDriver ()=default
 
int domain_type (const std::string &name) const override
 Get the PlatformTopo domain type for an named attribute.
 
std::string attribute_path (const std::string &name, int domain_idx) override
 Get the path to the sysfs entry for signal.
 
std::function< double(const std::string &)> signal_parse (const std::string &signal_name) const override
 Get function to convert contents of sysfs file into signal.
 
std::function< std::string(double)> control_gen (const std::string &control_name) const override
 Get a function to convert a control into a sysfs string.
 
std::string driver (void) const override
 
std::map< std::string, properties_s > properties (void) const override
 Query the meta data about a signal or control.
 
- Public Member Functions inherited from geopm::SysfsDriver
 SysfsDriver ()=default
 
virtual ~SysfsDriver ()=default
 
virtual std::map< std::string, derived_signal_info_s > derived_signals (void) const
 Query mapping of derived signal aliases to their metadata and sources.
 

Static Public Member Functions

static std::string plugin_name (void)
 
static std::unique_ptr< IOGroup > make_plugin (void)
 
- Static Public Member Functions inherited from geopm::SysfsDriver
static std::map< std::string, SysfsDriver::properties_s > parse_properties_json (const std::string &iogroup_name, const std::string &properties_json)
 

Additional Inherited Members

- Static Public Attributes inherited from geopm::SysfsDriver
static constexpr size_t M_IO_BUFFER_SIZE = 128
 Arbitrary buffer size.
 

Detailed Description

SysfsDriver implementation for the Linux intel_uncore_frequency driver.

On recent Intel Xeon parts (Granite Rapids, Sierra Forest, Clearwater Forest, and later) the uncore frequency knobs moved from MSRs to the TPMI memory-mapped interface and are exposed to userspace through /sys/devices/system/cpu/intel_uncore_frequency/. This driver maps that sysfs surface onto the generic SysfsIOGroup so that the existing CPU_UNCORE_FREQUENCY_{MAX,MIN}_CONTROL and CPU_UNCORE_FREQUENCY_STATUS aliases keep working on those platforms. Controls are package-scoped: max/min are read from and written to the package_*_die_* fan-out directory, while the current-frequency status is read from a representative uncore* domain in the package.

Constructor & Destructor Documentation

◆ UncoreFreqSysfsDriver() [1/2]

geopm::UncoreFreqSysfsDriver::UncoreFreqSysfsDriver ( )

◆ UncoreFreqSysfsDriver() [2/2]

geopm::UncoreFreqSysfsDriver::UncoreFreqSysfsDriver ( const std::string &  uncore_directory)

◆ ~UncoreFreqSysfsDriver()

virtual geopm::UncoreFreqSysfsDriver::~UncoreFreqSysfsDriver ( )
virtualdefault

Member Function Documentation

◆ attribute_path()

std::string geopm::UncoreFreqSysfsDriver::attribute_path ( const std::string &  name,
int  domain_idx 
)
overridevirtual

Get the path to the sysfs entry for signal.

Parameters
[in]nameThe name of the signal or control
[in]domain_idxThe 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.

Implements geopm::SysfsDriver.

◆ control_gen()

std::function< std::string(double)> geopm::UncoreFreqSysfsDriver::control_gen ( const std::string &  control_name) const
overridevirtual

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_nameThe name of the signal.
Returns
Function returning string content to be written to sysfs file.

Implements geopm::SysfsDriver.

◆ domain_type()

int geopm::UncoreFreqSysfsDriver::domain_type ( const std::string &  name) const
overridevirtual

Get the PlatformTopo domain type for an named attribute.

Parameters
[in]nameThe name of the signal or control
Returns
geopm_domain_e domain type

Implements geopm::SysfsDriver.

◆ driver()

std::string geopm::UncoreFreqSysfsDriver::driver ( void  ) const
overridevirtual

Name of the Linux kernel device driver

Returns
Name of device driver

Implements geopm::SysfsDriver.

◆ make_plugin()

std::unique_ptr< IOGroup > geopm::UncoreFreqSysfsDriver::make_plugin ( void  )
static

◆ plugin_name()

std::string geopm::UncoreFreqSysfsDriver::plugin_name ( void  )
static

◆ properties()

std::map< std::string, SysfsDriver::properties_s > geopm::UncoreFreqSysfsDriver::properties ( void  ) const
overridevirtual

Query the meta data about a signal or control.

Implements geopm::SysfsDriver.

◆ signal_parse()

std::function< double(const std::string &)> geopm::UncoreFreqSysfsDriver::signal_parse ( const std::string &  signal_name) const
overridevirtual

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_idThe unique identifier of the signal.
[in]contentThe string content read from the sysfs file.
Returns
The parsed signal value in SI units.

Implements geopm::SysfsDriver.


The documentation for this class was generated from the following files: