aboutsummaryrefslogtreecommitdiff
path: root/crosperf/suite_runner.py
diff options
context:
space:
mode:
authorDenis Nikitin <denik@google.com>2019-07-02 09:59:17 -0700
committerDenis Nikitin <denik@chromium.org>2019-07-10 14:24:20 +0000
commiteb306fa89c054c1d78eafdbd0d6d4f2be493afe9 (patch)
tree84897acd62d2256de0c35f45345dde9edce4dde8 /crosperf/suite_runner.py
parentf6d9f4fdcc43f17bdc21420e4bbdf194be420f35 (diff)
downloadtoolchain-utils-eb306fa89c054c1d78eafdbd0d6d4f2be493afe9.tar.gz
crosperf: Recover intel_pstate performance setup
Revert back performance governor intel_pstate setup. Change the order of no_turbo setup which should follow the intel_pstate governor setup. BUG=chromium:966514 TEST=verified on samus, eve, rammus, kefka. Change-Id: I40e6930bc62151cafe1a95f7f9d05c138e6d7663 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1687384 Tested-by: Denis Nikitin <denik@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Diffstat (limited to 'crosperf/suite_runner.py')
-rw-r--r--crosperf/suite_runner.py49
1 files changed, 30 insertions, 19 deletions
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index b195d2cc..ba1c3fa7 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -103,26 +103,32 @@ class SuiteRunner(object):
disable_aslr, machine=machine_name, chromeos_root=chromeos_root)
def PinGovernorExecutionFrequencies(self, machine_name, chromeos_root):
- """Manages the cpu governor and other performance settings.
- Includes support for setting cpu frequency to a static value.
+ """Setup Intel CPU frequency.
+
+ Manages the cpu governor and other performance settings.
+ Includes support for setting cpu frequency to a static value.
"""
# pyformat: disable
set_cpu_freq = (
- # Disable Turbo in Intel pstate driver
- 'if [[ -e /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then '
- ' if grep -q 0 /sys/devices/system/cpu/intel_pstate/no_turbo; then '
- ' echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo; '
- ' fi; '
- 'fi; '
- # Uncomment the following lines to set governor to powersave for each
- # cpu. Also uncomment the 'done' at end.
- # 'for f in /sys/devices/system/cpu/cpu*/cpufreq; do '
+ # Disable Intel Opportunistic Processor
+ # Commented out because wrmsr requires kernel change
+ # to enable white-listed write access to msr 0x199.
+ # See Intel 64 and IA-32 Archtectures
+ # Software Developer's Manual, 14.3.2.2.
+ #'awk \'$1 ~ /^processor/ { print $NF }\' /proc/cpuinfo '
+ #' | while read c; do '
+ # 'iotools wrmsr $c 0x199 $(printf "0x%x\n" $(( (1 << 32) '
+ # ' | $(iotools rdmsr $c 0x199) )));'
+ #'done;'
+ # Set up intel_pstate governor to performance if enabled.
+ 'for f in `ls -d /sys/devices/system/cpu/cpu*/cpufreq 2>/dev/null`; do '
# Skip writing scaling_governor if cpu is not online.
- # '[[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} '
- # '&& continue; '
+ ' [[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} '
+ ' && continue; '
# The cpu is online, can update.
- # 'cd $f; '
- # 'echo powersave > scaling_governor; '
+ ' cd $f; '
+ ' if [[ -e scaling_governor ]]; then '
+ ' echo performance > scaling_governor; fi; '
#
# Uncomment rest of lines to enable setting frequency by crosperf.
# It sets the cpu to the second highest supported frequency.
@@ -139,10 +145,15 @@ class SuiteRunner(object):
#'fi ;'
#'echo $highest > scaling_max_freq; '
#'echo $highest > scaling_min_freq; '
- #
- # Uncomment to enable the loop for CPU governor settings.
- # 'done'
- )
+ 'done; '
+ # Disable Turbo in Intel pstate driver
+ # no_turbo should follow governor setup.
+ # Otherwise it can be overwritten.
+ 'if [[ -e /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then '
+ ' if grep -q 0 /sys/devices/system/cpu/intel_pstate/no_turbo; then '
+ ' echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo; '
+ ' fi; '
+ 'fi; ')
# pyformat: enable
if self.log_level == 'average':
self.logger.LogOutput(