aboutsummaryrefslogtreecommitdiff
path: root/crosperf/suite_runner.py
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2016-11-01 12:56:25 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-11-01 15:50:24 -0700
commitc39917fe61858e884d06656122cf88a8c66fd825 (patch)
tree4281d50331476710319707d3d15d613690cea646 /crosperf/suite_runner.py
parentd768dc1c6dbd2cdc8f2503574e88ad88316e24f2 (diff)
downloadtoolchain-utils-c39917fe61858e884d06656122cf88a8c66fd825.tar.gz
Update formatting of files before committing changes for autotest. No functional change.
BUG: chromium:647429 TEST: crosperf unit tests Change-Id: I827f9ec4d00a0d8c1ae8a9930d7832289e694dc8 Reviewed-on: https://chrome-internal-review.googlesource.com/301457 Commit-Ready: Manoj Gupta <manojgupta@google.com> Tested-by: Manoj Gupta <manojgupta@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'crosperf/suite_runner.py')
-rw-r--r--crosperf/suite_runner.py69
1 files changed, 33 insertions, 36 deletions
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index df81ff2d..9824a085 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -53,8 +53,7 @@ class SuiteRunner(object):
self._logger = logger_to_use
self.log_level = log_level
self._ce = cmd_exec or command_executer.GetCommandExecuter(
- self._logger,
- log_level=self.log_level)
+ self._logger, log_level=self.log_level)
self._ct = cmd_term or command_executer.CommandTerminator()
def Run(self, machine, label, benchmark, test_args, profiler_args):
@@ -91,9 +90,7 @@ class SuiteRunner(object):
' cat scaling_max_freq ; '
'fi')
ret, freqs_str, _ = self._ce.CrosRunCommandWOutput(
- get_avail_freqs,
- machine=machine_name,
- chromeos_root=chromeos_root)
+ get_avail_freqs, 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()
@@ -116,45 +113,44 @@ class SuiteRunner(object):
highest_freq = self.GetHighestStaticFrequency(machine_name, chromeos_root)
BASH_FOR = 'for f in {list}; do {body}; done'
CPUFREQ_DIRS = '/sys/devices/system/cpu/cpu*/cpufreq/'
- change_max_freq = BASH_FOR.format(list=CPUFREQ_DIRS + 'scaling_max_freq',
- body='echo %s > $f' % highest_freq)
- change_min_freq = BASH_FOR.format(list=CPUFREQ_DIRS + 'scaling_min_freq',
- body='echo %s > $f' % highest_freq)
- change_perf_gov = BASH_FOR.format(list=CPUFREQ_DIRS + 'scaling_governor',
- body='echo performance > $f')
+ change_max_freq = BASH_FOR.format(
+ list=CPUFREQ_DIRS + 'scaling_max_freq',
+ body='echo %s > $f' % highest_freq)
+ change_min_freq = BASH_FOR.format(
+ list=CPUFREQ_DIRS + 'scaling_min_freq',
+ body='echo %s > $f' % highest_freq)
+ change_perf_gov = BASH_FOR.format(
+ list=CPUFREQ_DIRS + 'scaling_governor', body='echo performance > $f')
if self.log_level == 'average':
self._logger.LogOutput('Pinning governor execution frequencies for %s' %
machine_name)
- ret = self._ce.CrosRunCommand(' && '.join((
- 'set -e ', change_max_freq, change_min_freq, change_perf_gov)),
- machine=machine_name,
- chromeos_root=chromeos_root)
+ ret = self._ce.CrosRunCommand(
+ ' && '.join(('set -e ', change_max_freq, change_min_freq,
+ change_perf_gov)),
+ machine=machine_name,
+ chromeos_root=chromeos_root)
self._logger.LogFatalIf(ret, 'Could not pin frequencies on machine: %s' %
machine_name)
def DecreaseWaitTime(self, machine_name, chromeos_root):
"""Change the ten seconds wait time for pagecycler to two seconds."""
FILE = '/usr/local/telemetry/src/tools/perf/page_sets/page_cycler_story.py'
- ret = self._ce.CrosRunCommand('ls ' + FILE,
- machine=machine_name,
- chromeos_root=chromeos_root)
+ ret = self._ce.CrosRunCommand(
+ 'ls ' + FILE, machine=machine_name, chromeos_root=chromeos_root)
self._logger.LogFatalIf(ret, 'Could not find {} on machine: {}'.format(
FILE, machine_name))
if not ret:
sed_command = 'sed -i "s/_TTI_WAIT_TIME = 10/_TTI_WAIT_TIME = 2/g" '
- ret = self._ce.CrosRunCommand(sed_command + FILE,
- machine=machine_name,
- chromeos_root=chromeos_root)
+ ret = self._ce.CrosRunCommand(
+ sed_command + FILE, machine=machine_name, chromeos_root=chromeos_root)
self._logger.LogFatalIf(ret, 'Could not modify {} on machine: {}'.format(
FILE, machine_name))
-
def RebootMachine(self, machine_name, chromeos_root):
command = 'reboot && exit'
- self._ce.CrosRunCommand(command,
- machine=machine_name,
- chromeos_root=chromeos_root)
+ self._ce.CrosRunCommand(
+ command, machine=machine_name, chromeos_root=chromeos_root)
time.sleep(60)
# Whenever we reboot the machine, we need to restore the governor settings.
self.PinGovernorExecutionFrequencies(machine_name, chromeos_root)
@@ -169,9 +165,8 @@ class SuiteRunner(object):
if profiler_args:
self._logger.LogFatal('test_that does not support profiler.')
command = 'rm -rf /usr/local/autotest/results/*'
- self._ce.CrosRunCommand(command,
- machine=machine,
- chromeos_root=label.chromeos_root)
+ self._ce.CrosRunCommand(
+ command, machine=machine, chromeos_root=label.chromeos_root)
# We do this because some tests leave the machine in weird states.
# Rebooting between iterations has proven to help with this.
@@ -186,10 +181,11 @@ class SuiteRunner(object):
# Use --no-ns-pid so that cros_sdk does not create a different
# process namespace and we can kill process created easily by
# their process group.
- return self._ce.ChrootRunCommandWOutput(label.chromeos_root,
- command,
- command_terminator=self._ct,
- cros_sdk_options='--no-ns-pid')
+ return self._ce.ChrootRunCommandWOutput(
+ label.chromeos_root,
+ command,
+ command_terminator=self._ct,
+ cros_sdk_options='--no-ns-pid')
def RemoveTelemetryTempFile(self, machine, chromeos_root):
filename = 'telemetry@%s' % machine
@@ -227,10 +223,11 @@ class SuiteRunner(object):
args_string = "test_args='%s'" % test_args
cmd = ('{} {} {} --board={} --args="{} run_local={} test={} '
- '{}" {} telemetry_Crosperf'.format(
- TEST_THAT_PATH, autotest_dir_arg, fast_arg, label.board,
- args_string, benchmark.run_local, benchmark.test_name,
- profiler_args, machine))
+ '{}" {} telemetry_Crosperf'.format(TEST_THAT_PATH, autotest_dir_arg,
+ fast_arg, label.board,
+ args_string, benchmark.run_local,
+ benchmark.test_name,
+ profiler_args, machine))
# Use --no-ns-pid so that cros_sdk does not create a different
# process namespace and we can kill process created easily by their