#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
-
virtualCore The virtual core.
- Returns
- true if this domain contains the virtual core, false otherwise.
|
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).
|
pure virtual |
Gets the governors available.
- Returns
- The governors available.
|
pure virtual |
Gets the current frequency.
- Returns
- The current frequency.
|
pure virtual |
Gets the current frequency set by userspace governor.
- Returns
- The current frequency if the current governor is userspace, a meaningless value otherwise.
|
pure virtual |
Gets the current governor.
- Returns
- The current governor.
|
pure virtual |
Gets the current frequency bounds for the governor.
- Parameters
-
lowerBound The current frequency lower bound (specified in kHZ). upperBound The current frequency upper bound (specified in kHZ).
- Returns
- true if the governor is not userspace, false otherwise.
|
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.
|
pure virtual |
Gets the hardware frequency bounds.
- Parameters
-
lowerBound The hardware frequency lower bound (specified in kHZ). upperBound The 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.
|
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.
|
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
-
onlyPhysicalCores If true, only physical cores will be considered.
- Returns
- The voltage table of this domain. If voltages cannot be read, the table will be empty.
|
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
-
numVirtualCores The number of virtual cores. onlyPhysicalCores If 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
-
governor The 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
-
rollbackPoint A rollback point.
|
pure virtual |
Change the running frequency.
- Parameters
-
frequency The frequency to be set (specified in kHZ).
- Returns
- true if the frequency is valid and the governor is userspace, false otherwise.
|
pure virtual |
Changes the governor.
- Parameters
-
governor The identifier of the governor.
- Returns
- true if the governor is valid, false otherwise.
|
pure virtual |
Change the frequency bounds of the governor.
- Parameters
-
lowerBound The new frequency lower bound (specified in kHZ). upperBound The 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:
- /home/daniele/Code/Mammut/mammut/cpufreq/cpufreq.hpp