aboutsummaryrefslogtreecommitdiff
path: root/crosperf
diff options
context:
space:
mode:
Diffstat (limited to 'crosperf')
-rw-r--r--crosperf/suite_runner.py20
-rwxr-xr-xcrosperf/suite_runner_unittest.py12
2 files changed, 13 insertions, 19 deletions
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index 46610f01..b195d2cc 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -108,21 +108,22 @@ class SuiteRunner(object):
"""
# pyformat: disable
set_cpu_freq = (
- 'set -e && '
# 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; '
- # Set governor to powersave for each cpu.
- 'for f in /sys/devices/system/cpu/cpu*/cpufreq; do '
+ # 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 '
# 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; '
+ # '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; '
@@ -138,7 +139,10 @@ class SuiteRunner(object):
#'fi ;'
#'echo $highest > scaling_max_freq; '
#'echo $highest > scaling_min_freq; '
- 'done')
+ #
+ # Uncomment to enable the loop for CPU governor settings.
+ # 'done'
+ )
# pyformat: enable
if self.log_level == 'average':
self.logger.LogOutput(
diff --git a/crosperf/suite_runner_unittest.py b/crosperf/suite_runner_unittest.py
index 59cc8976..783a2934 100755
--- a/crosperf/suite_runner_unittest.py
+++ b/crosperf/suite_runner_unittest.py
@@ -197,22 +197,12 @@ class SuiteRunnerTest(unittest.TestCase):
cmd = mock_cros_runcmd.call_args_list[0][0]
# pyformat: disable
set_cpu_cmd = (
- 'set -e && '
# 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; '
- # 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 powersave > scaling_governor; '
- 'done')
+ 'fi; ')
# pyformat: enable
self.assertEqual(cmd, (set_cpu_cmd,))