Use 'scaling_max_freq' when 'scaling_available_frequencies' is not available.
In recently arm images, there is no such
'scaling_available_frequencies' file, which leads failure of
crosperf. Fixed this by choosing 'scaling_max_freq'.
TEST=tested on daisy
BUG=None
Change-Id: I433e161495421c57854234fd0e7f7e54406bb9e8
Reviewed-on: https://chrome-internal-review.googlesource.com/154579
Reviewed-by: Caroline Tice <cmtice@google.com>
Commit-Queue: Han Shen <shenhan@google.com>
Tested-by: Han Shen <shenhan@google.com>
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index 89f06ff..087f64d 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -65,14 +65,22 @@
def GetHighestStaticFrequency(self, machine_name, chromeos_root):
""" Gets the highest static frequency for the specified machine
"""
- get_avail_freqs = ("cat /sys/devices/system/cpu/cpu0/cpufreq/"
- "scaling_available_frequencies")
+ get_avail_freqs = ("cd /sys/devices/system/cpu/cpu0/cpufreq/; "
+ "if [[ -e scaling_available_frequencies ]]; then "
+ " cat scaling_available_frequencies; "
+ "else "
+ " cat scaling_max_freq ; "
+ "fi")
ret, freqs_str, _ = self._ce.CrosRunCommand(
get_avail_freqs, return_output=True, machine=machine_name,
chromeos_root=chromeos_root)
self._logger.LogFatalIf(ret, "Could not get available frequencies "
"from machine: %s" % machine_name)
freqs = freqs_str.split()
+ ## When there is no scaling_available_frequencies file,
+ ## we have only 1 choice.
+ if len(freqs) == 1:
+ return freqs[0]
# The dynamic frequency ends with a "1000". So, ignore it if found.
if freqs[0].endswith("1000"):
return freqs[1]