1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 04:21:17 +00:00

cpufreq: handle non-integer output in get_available_frequencies

This commit is contained in:
Sergei Trofimov 2015-09-14 11:03:54 +01:00
parent 3247b63cb9
commit 3d8c384bb7

View File

@ -164,7 +164,13 @@ class CpufreqModule(Module):
try:
cmd = 'cat /sys/devices/system/cpu/{}/cpufreq/scaling_available_frequencies'.format(cpu)
output = self.device.execute(cmd)
available_frequencies = map(int, output.strip().split()) # pylint: disable=E1103
#available_frequencies = map(int, output.strip().split()) # pylint: disable=E1103
available_frequencies = []
for f in output.strip().split():
try:
available_frequencies.append(int(f))
except ValueError:
pass
except DeviceError:
# On some devices scaling_available_frequencies is not generated.
# http://adrynalyne-teachtofish.blogspot.co.uk/2011/11/how-to-enable-scalingavailablefrequenci.html