aboutsummaryrefslogtreecommitdiff
path: root/crosperf
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2019-05-23 11:07:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-24 05:57:39 -0700
commit885d08a929b803d9245d71fc6fdb776b31e349f6 (patch)
tree2a9bbed0b248693d49b8fdad8e09483182b4c982 /crosperf
parent05ab5dd36afb2f21b6acd9aff5b48cfe815d32c2 (diff)
downloadtoolchain-utils-885d08a929b803d9245d71fc6fdb776b31e349f6.tar.gz
crosperf: Set governor to powersave.
This is to improve stability in performance data. BUG=chromium:966514 TEST=powersave governor works. Change-Id: I0bb0f8349c69437f154bcdac29fa64d2664fb6ef Reviewed-on: https://chromium-review.googlesource.com/1627301 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'crosperf')
-rw-r--r--crosperf/suite_runner.py11
-rwxr-xr-xcrosperf/suite_runner_unittest.py4
2 files changed, 9 insertions, 6 deletions
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index 342e9541..46610f01 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -103,7 +103,9 @@ class SuiteRunner(object):
disable_aslr, machine=machine_name, chromeos_root=chromeos_root)
def PinGovernorExecutionFrequencies(self, machine_name, chromeos_root):
- """Set min and max frequencies to max static frequency."""
+ """Manages the cpu governor and other performance settings.
+ Includes support for setting cpu frequency to a static value.
+ """
# pyformat: disable
set_cpu_freq = (
'set -e && '
@@ -113,15 +115,16 @@ class SuiteRunner(object):
' echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo; '
' fi; '
'fi; '
- # Set governor to performance for each cpu
+ # Set governor to powersave 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
+ 'echo powersave > scaling_governor; '
+ # Uncomment rest of lines to enable setting frequency by crosperf.
+ # It sets the cpu to the second highest supported frequency.
#'val=0; '
#'if [[ -e scaling_available_frequencies ]]; then '
# pylint: disable=line-too-long
diff --git a/crosperf/suite_runner_unittest.py b/crosperf/suite_runner_unittest.py
index 0c8d17d4..59cc8976 100755
--- a/crosperf/suite_runner_unittest.py
+++ b/crosperf/suite_runner_unittest.py
@@ -204,14 +204,14 @@ class SuiteRunnerTest(unittest.TestCase):
' echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo; '
' fi; '
'fi; '
- # Set governor to performance for each cpu
+ # Set governor to ppowersave 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; '
# This cpu is online, can update.
'cd $f; '
- 'echo performance > scaling_governor; '
+ 'echo powersave > scaling_governor; '
'done')
# pyformat: enable
self.assertEqual(cmd, (set_cpu_cmd,))