mammut::cpufreq::Domain Class Referenceabstract

#include <cpufreq.hpp>

Public Member Functions

std::vector
< topology::VirtualCore * > 
getVirtualCores () const
 
std::vector
< topology::VirtualCoreId > 
getVirtualCoresIdentifiers () const
 
bool contains (const topology::VirtualCore *virtualCore) const
 
DomainId getId () const
 
RollbackPoint getRollbackPoint () const
 
void rollback (const RollbackPoint &rollbackPoint) const
 
virtual std::vector< Frequency > getAvailableFrequencies () const =0
 
virtual std::vector< Governor > getAvailableGovernors () const =0
 
bool isGovernorAvailable (Governor governor) const
 
virtual Frequency getCurrentFrequency () const =0
 
virtual Frequency getCurrentFrequencyUserspace () const =0
 
virtual bool setFrequencyUserspace (Frequency frequency) const =0
 
bool setHighestFrequencyUserspace () const
 
bool setLowestFrequencyUserspace () const
 
virtual Governor getCurrentGovernor () const =0
 
virtual bool setGovernor (Governor governor) const =0
 
virtual void getHardwareFrequencyBounds (Frequency &lowerBound, Frequency &upperBound) const =0
 
virtual bool getCurrentGovernorBounds (Frequency &lowerBound, Frequency &upperBound) const =0
 
virtual bool setGovernorBounds (Frequency lowerBound, Frequency upperBound) const =0
 
virtual int getTransitionLatency () const =0
 
virtual Voltage getCurrentVoltage () const =0
 
virtual VoltageTable getVoltageTable (bool onlyPhysicalCores=true) const =0
 
virtual VoltageTable getVoltageTable (uint numVirtualCores, bool onlyPhysicalCores) const =0
 

Protected Member Functions

 Domain (DomainId domainIdentifier, std::vector< topology::VirtualCore * > virtualCores)
 

Protected Attributes

const std::vector
< topology::VirtualCore * > 
_virtualCores
 

Detailed Description

Represents a set of virtual cores related between each other. When the frequency/governor changes for one core in the domain, it changes for the other cores in the same domain too.

Member Function Documentation

bool mammut::cpufreq::Domain::contains ( const topology::VirtualCore virtualCore) const

Checks if this domain contains a specific virtual core.

Parameters
virtualCoreThe virtual core.
Returns
true if this domain contains the virtual core, false otherwise.
virtual std::vector<Frequency> mammut::cpufreq::Domain::getAvailableFrequencies ( ) const
pure virtual

Gets the frequency steps (in KHz) available (sorted from lowest to highest).

Returns
The frequency steps (in KHz) available (sorted from lowest to highest).
virtual std::vector<Governor> mammut::cpufreq::Domain::getAvailableGovernors ( ) const
pure virtual

Gets the governors available.

Returns
The governors available.
virtual Frequency mammut::cpufreq::Domain::getCurrentFrequency ( ) const
pure virtual

Gets the current frequency.

Returns
The current frequency.
virtual Frequency mammut::cpufreq::Domain::getCurrentFrequencyUserspace ( ) const
pure virtual

Gets the current frequency set by userspace governor.

Returns
The current frequency if the current governor is userspace, a meaningless value otherwise.
virtual Governor mammut::cpufreq::Domain::getCurrentGovernor ( ) const
pure virtual

Gets the current governor.

Returns
The current governor.
virtual bool mammut::cpufreq::Domain::getCurrentGovernorBounds ( Frequency &  lowerBound,
Frequency &  upperBound 
) const
pure virtual

Gets the current frequency bounds for the governor.

Parameters
lowerBoundThe current frequency lower bound (specified in kHZ).
upperBoundThe current frequency upper bound (specified in kHZ).
Returns
true if the governor is not userspace, false otherwise.
virtual Voltage mammut::cpufreq::Domain::getCurrentVoltage ( ) const
pure virtual

Returns the current voltage of this domain.

Returns
The current voltage of this domain. It returns 0 if is not possible to read the current voltage on this domain.
virtual void mammut::cpufreq::Domain::getHardwareFrequencyBounds ( Frequency &  lowerBound,
Frequency &  upperBound 
) const
pure virtual

Gets the hardware frequency bounds.

Parameters
lowerBoundThe hardware frequency lower bound (specified in kHZ).
upperBoundThe hardware frequency upper bound (specified in kHZ).
DomainId mammut::cpufreq::Domain::getId ( ) const

Returns the identifier of the domain.

Returns
The identifier of the domain.
RollbackPoint mammut::cpufreq::Domain::getRollbackPoint ( ) const

Returns a rollback point. It can be used to bring the domain back to the point when this function is called.

Returns
A rollback point.
virtual int mammut::cpufreq::Domain::getTransitionLatency ( ) const
pure virtual

Returns the frequency transition latency (nanoseconds).

Returns
The frequency transition latency (nanoseconds). -1 will be returned if the latency is unknown.
std::vector<topology::VirtualCore*> mammut::cpufreq::Domain::getVirtualCores ( ) const

Returns the virtual cores inside the domain.

Returns
The virtual cores inside the domain.
std::vector<topology::VirtualCoreId> mammut::cpufreq::Domain::getVirtualCoresIdentifiers ( ) const

Returns the identifiers of the virtual cores inside the domain.

Returns
The identifiers of the virtual cores inside the domain.
virtual VoltageTable mammut::cpufreq::Domain::getVoltageTable ( bool  onlyPhysicalCores = true) const
pure virtual

Returns the voltage table of this domain. The voltage table is a map where for each pair <N, F> is associated a voltage V. N is the number of virtual cores running at frequency F at 100% of load. NOTE: This call may block the caller for some seconds/minutes.

Parameters
onlyPhysicalCoresIf true, only physical cores will be considered.
Returns
The voltage table of this domain. If voltages cannot be read, the table will be empty.
virtual VoltageTable mammut::cpufreq::Domain::getVoltageTable ( uint  numVirtualCores,
bool  onlyPhysicalCores 
) const
pure virtual

Returns the voltage table of this domain. For a specific number of virtual cores N. The voltage table is a map where for each pair <N, F> is associated a voltage V. N is the number of virtual cores running at frequency F at 100% of load. NOTE: This call may block the caller for some seconds/minutes.

Parameters
numVirtualCoresThe number of virtual cores.
onlyPhysicalCoresIf true, only physical cores will be considered.
Returns
The voltage table of this domain. If voltages cannot be read, the table will be empty.
bool mammut::cpufreq::Domain::isGovernorAvailable ( Governor  governor) const

Checks the availability of a specific governor.

Parameters
governorThe governor.
Returns
True if the governor is available, false otherwise.
void mammut::cpufreq::Domain::rollback ( const RollbackPoint rollbackPoint) const

Bring the domain to a rollback point.

Parameters
rollbackPointA rollback point.
virtual bool mammut::cpufreq::Domain::setFrequencyUserspace ( Frequency  frequency) const
pure virtual

Change the running frequency.

Parameters
frequencyThe frequency to be set (specified in kHZ).
Returns
true if the frequency is valid and the governor is userspace, false otherwise.
virtual bool mammut::cpufreq::Domain::setGovernor ( Governor  governor) const
pure virtual

Changes the governor.

Parameters
governorThe identifier of the governor.
Returns
true if the governor is valid, false otherwise.
virtual bool mammut::cpufreq::Domain::setGovernorBounds ( Frequency  lowerBound,
Frequency  upperBound 
) const
pure virtual

Change the frequency bounds of the governor.

Parameters
lowerBoundThe new frequency lower bound (specified in kHZ).
upperBoundThe new frequency upper bound (specified in kHZ).
Returns
true if the bounds are valid and the governor is not userspace, false otherwise.
bool mammut::cpufreq::Domain::setHighestFrequencyUserspace ( ) const

Sets the highest userspace frequency for this domain.

Returns
false if the current governor is not userspace.
bool mammut::cpufreq::Domain::setLowestFrequencyUserspace ( ) const

Sets the lowest userspace frequency for this domain.

Returns
false if the current governor is not userspace.

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