public abstract class GovernorCommonBase extends Governor
This governor class cannot be instantiated.
Modifier and Type | Field and Description |
---|---|
static long |
MAX_SAMPLING_RATE
Maximum sampling rate: 4294967295L microseconds.
|
governorType, handler, PATH_GOVERNOR_SETTINGS
Modifier and Type | Method and Description |
---|---|
void |
disableIgnoreNiceLoad()
Enables the ignore nice load parameter.
|
void |
enableIgnoreNiceLoad()
Disables the ignore nice load parameter.
|
boolean |
getIgnoreNiceLoad()
Gets whether the ignore nice load parameter is enabled or disabled.
|
long |
getMinSamplingRate()
Returns the minimum sampling rate in uS.
|
int |
getSamplingDownFactor()
Gets the sampling down factor.
|
protected abstract int |
getSamplingDownFactorMaxValue()
Returns the maximum limit for the sampling down factor.
|
long |
getSamplingRate()
Returns the sampling rate in uS.
|
int |
getUpThreshold()
Gets the up threshold percentage.
|
protected abstract int |
getUpThresholdMinValue()
Returns the minimum limit for the up threshold percentage.
|
void |
setSamplingDownFactor(int factor)
Sets the sampling down factor.
|
void |
setSamplingRate(long rate)
Sets the sampling rate in uS.
|
void |
setUpThreshold(int threshold)
Sets the up threshold percentage.
|
getGovernorType, getSettingPath, getTag, readFile, writeFile
public static final long MAX_SAMPLING_RATE
public void setSamplingRate(long rate) throws CPUException
rate
- The sampling rate in uS (10^-6 seconds)java.lang.IllegalArgumentException
- If rate < getMinSamplingRate()
or
if rate > MAX_SAMPLING_RATE
.CPUException
- If there is an error during the configuration
process.MAX_SAMPLING_RATE
,
getMinSamplingRate()
,
getSamplingRate()
public long getSamplingRate() throws CPUException
CPUException
- If there is an error during the configuration
process.getMinSamplingRate()
,
setSamplingRate(long)
public long getMinSamplingRate() throws CPUException
The sampling rate is limited by the HW transition latency:
Or by kernel restrictions:
The highest value of kernel and HW latency restrictions is shown and used as the minimum sampling rate.
CPUException
- If there is an error during the configuration
process.getSamplingRate()
,
setSamplingRate(long)
public void setUpThreshold(int threshold) throws CPUException
For example when it is set to its default value of '95' it means that between the checking intervals the CPU needs to be on average more than 95% in use to then decide that the CPU frequency needs to be increased.
threshold
- The up threshold percentage.CPUException
- If there is an error during the configuration
process.java.lang.IllegalArgumentException
- If threshold < getUpThresholdMinValue()
or
if threshold > 100
.getUpThreshold()
,
getUpThresholdMinValue()
public int getUpThreshold() throws CPUException
CPUException
- If there is an error during the configuration
process.setUpThreshold(int)
public void enableIgnoreNiceLoad() throws CPUException
CPUException
- If there is an error during the configuration
process.disableIgnoreNiceLoad()
,
getIgnoreNiceLoad()
public void disableIgnoreNiceLoad() throws CPUException
CPUException
- If there is an error during the configuration
process.enableIgnoreNiceLoad()
,
getIgnoreNiceLoad()
public boolean getIgnoreNiceLoad() throws CPUException
true
if processes that are running with a 'nice' value
are ignored, false
otherwise.CPUException
- If there is an error during the configuration
process.enableIgnoreNiceLoad()
,
disableIgnoreNiceLoad()
public void setSamplingDownFactor(int factor) throws CPUException
factor
- The new sampling down factor.CPUException
- If there is an error during the configuration
process.java.lang.IllegalArgumentException
- If factor < 1
or
if factor > getSamplingDownFactorMaxValue()
.getSamplingDownFactor()
,
getSamplingDownFactorMaxValue()
public int getSamplingDownFactor() throws CPUException
CPUException
- If there is an error during the configuration
process.setSamplingDownFactor(int)
protected abstract int getSamplingDownFactorMaxValue()
protected abstract int getUpThresholdMinValue() throws CPUException
CPUException
- If there is an error while calculating the minimum
limit.