plugin_cpu: do not show error if cpupower or x86_energy_perf_policy are missing
Now only warning is displayed similarly to the hdparm behavior. Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
bd0a87af0f
commit
90e9a93c73
1 changed files with 5 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ from tuned.utils.commands import commands
|
|||
|
||||
import os
|
||||
import struct
|
||||
import errno
|
||||
|
||||
log = tuned.logs.get()
|
||||
|
||||
|
|
@ -52,19 +53,19 @@ class CPULatencyPlugin(base.Plugin):
|
|||
}
|
||||
|
||||
def _check_cpupower(self):
|
||||
if self._cmd.execute(["cpupower", "frequency-info"])[0] == 0:
|
||||
if self._cmd.execute(["cpupower", "frequency-info"], no_errors = [errno.ENOENT])[0] == 0:
|
||||
self._has_cpupower = True
|
||||
else:
|
||||
self._has_cpupower = False
|
||||
log.warning("using sysfs fallback, is cpupower installed?")
|
||||
log.warning("unable to run cpupower tool, using sysfs fallback, is cpupower installed?")
|
||||
|
||||
def _check_energy_perf_bias(self):
|
||||
self._has_energy_perf_bias = False
|
||||
retcode = self._cmd.execute(["x86_energy_perf_policy", "-r"])[0]
|
||||
retcode = self._cmd.execute(["x86_energy_perf_policy", "-r"], no_errors = [errno.ENOENT])[0]
|
||||
if retcode == 0:
|
||||
self._has_energy_perf_bias = True
|
||||
elif retcode == -1:
|
||||
log.warning("error executing x86_energy_perf_policy tool, ignoring CPU energy performance bias, is the tool installed?")
|
||||
log.warning("unable to run x86_energy_perf_policy tool, ignoring CPU energy performance bias, is the tool installed?")
|
||||
else:
|
||||
log.warning("your CPU doesn't support MSR_IA32_ENERGY_PERF_BIAS, ignoring CPU energy performance bias")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue