aboutsummaryrefslogtreecommitdiff
path: root/crosperf/suite_runner.py
diff options
context:
space:
mode:
authorTiancong Wang <tcwang@google.com>2019-05-17 12:10:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-22 15:40:06 -0700
commit05ab5dd36afb2f21b6acd9aff5b48cfe815d32c2 (patch)
treed3d41ff0a1cf01ff80b14b35336836a414223e9f /crosperf/suite_runner.py
parent3f06bf5fa1c53aa42959d351accc8888eb329343 (diff)
downloadtoolchain-utils-05ab5dd36afb2f21b6acd9aff5b48cfe815d32c2.tar.gz
crosperf: Add check core online in PinGovernerFrequency().
Due to Hyper-Threading is disabled, not all cpus in /sys/devices/system/cpu/cpu* are online on the x86 DUTs. Our PinGovernerFrequency() functions need to write performance to scaling_governor and it fails if the cpu is offline. This patches adds checks before writing to make sure the core is not offline. BUG=None TEST=Local tests. Change-Id: I5dee6851848c18ff9caac0fb5bf5a6a18741a3c8 Reviewed-on: https://chromium-review.googlesource.com/1618095 Commit-Ready: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'crosperf/suite_runner.py')
-rw-r--r--crosperf/suite_runner.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index 0318db19..342e9541 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -115,6 +115,10 @@ class SuiteRunner(object):
'fi; '
# Set governor to performance for each cpu
'for f in /sys/devices/system/cpu/cpu*/cpufreq; do '
+ # Skip writing scaling_governor if cpu is not online.
+ '[[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} '
+ '&& continue; '
+ # The cpu is online, can update.
'cd $f; '
'echo performance > scaling_governor; '
# Uncomment rest of lines to enable setting frequency by crosperf