aboutsummaryrefslogtreecommitdiff
path: root/crosperf
diff options
context:
space:
mode:
authorBob Haarman <inglorion@chromium.org>2020-09-19 00:00:06 +0000
committerBob Haarman <inglorion@chromium.org>2020-09-25 21:42:42 +0000
commit8223d16e040748ad6a91a87f3ce1cfc13db37f4b (patch)
treeb58dc769d183b3af7c76e6a6cec2800343d4e4f9 /crosperf
parent4f7eb71f9fa78f8710e1deb57d441f51fa74af3b (diff)
downloadtoolchain-utils-8223d16e040748ad6a91a87f3ce1cfc13db37f4b.tar.gz
fix formatting/lint issues pointed out by repohooks
Previous changes resulted in some complaints about formatting and Python 3 compatibility from the repo hooks. This change fixes those. BUG=None TEST=repo upload --cbr . # check that it no longer complains Change-Id: I99cc51dcb8d499d59b7b47817f4cef8fa6ba5059 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2419831 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: Manoj Gupta (OoO) <manojgupta@chromium.org>
Diffstat (limited to 'crosperf')
-rw-r--r--crosperf/experiment_runner.py34
-rw-r--r--crosperf/results_report.py9
2 files changed, 22 insertions, 21 deletions
diff --git a/crosperf/experiment_runner.py b/crosperf/experiment_runner.py
index 6a46adfc..8ba85a4c 100644
--- a/crosperf/experiment_runner.py
+++ b/crosperf/experiment_runner.py
@@ -35,8 +35,8 @@ def _WriteJSONReportToFile(experiment, results_dir, json_report):
compiler_string = 'llvm' if has_llvm else 'gcc'
board = experiment.labels[0].board
filename = 'report_%s_%s_%s.%s.json' % (board, json_report.date,
- json_report.time.replace(':', '.'),
- compiler_string)
+ json_report.time.replace(
+ ':', '.'), compiler_string)
fullname = os.path.join(results_dir, filename)
report_text = json_report.GetReport()
with open(fullname, 'w') as out_file:
@@ -157,13 +157,13 @@ class ExperimentRunner(object):
def _ClearCacheEntries(self, experiment):
for br in experiment.benchmark_runs:
cache = ResultsCache()
- cache.Init(
- br.label.chromeos_image, br.label.chromeos_root,
- br.benchmark.test_name, br.iteration, br.test_args, br.profiler_args,
- br.machine_manager, br.machine, br.label.board, br.cache_conditions,
- br.logger(), br.log_level, br.label, br.share_cache,
- br.benchmark.suite, br.benchmark.show_all_results,
- br.benchmark.run_local, br.benchmark.cwp_dso)
+ cache.Init(br.label.chromeos_image, br.label.chromeos_root,
+ br.benchmark.test_name, br.iteration, br.test_args,
+ br.profiler_args, br.machine_manager, br.machine,
+ br.label.board, br.cache_conditions, br.logger(), br.log_level,
+ br.label, br.share_cache, br.benchmark.suite,
+ br.benchmark.show_all_results, br.benchmark.run_local,
+ br.benchmark.cwp_dso)
cache_dir = cache.GetCacheDirForWrite()
if os.path.exists(cache_dir):
self.l.LogOutput('Removing cache dir: %s' % cache_dir)
@@ -246,8 +246,8 @@ class ExperimentRunner(object):
subject = '%s: %s' % (experiment.name, ' vs. '.join(label_names))
text_report = TextResultsReport.FromExperiment(experiment, True).GetReport()
- text_report += (
- '\nResults are stored in %s.\n' % experiment.results_directory)
+ text_report += ('\nResults are stored in %s.\n' %
+ experiment.results_directory)
text_report = "<pre style='font-size: 13px'>%s</pre>" % text_report
html_report = HTMLResultsReport.FromExperiment(experiment).GetReport()
attachment = EmailSender.Attachment('report.html', html_report)
@@ -275,8 +275,8 @@ class ExperimentRunner(object):
all_failed = True
topstats_file = os.path.join(results_directory, 'topstats.log')
- self.l.LogOutput(
- 'Storing top statistics of each benchmark run into %s.' % topstats_file)
+ self.l.LogOutput('Storing top statistics of each benchmark run into %s.' %
+ topstats_file)
with open(topstats_file, 'w') as top_fd:
for benchmark_run in experiment.benchmark_runs:
if benchmark_run.result:
@@ -322,8 +322,8 @@ class ExperimentRunner(object):
self.l.LogOutput('Storing email message body in %s.' % results_directory)
msg_file_path = os.path.join(results_directory, 'msg_body.html')
text_report = TextResultsReport.FromExperiment(experiment, True).GetReport()
- text_report += (
- '\nResults are stored in %s.\n' % experiment.results_directory)
+ text_report += ('\nResults are stored in %s.\n' %
+ experiment.results_directory)
msg_body = "<pre style='font-size: 13px'>%s</pre>" % text_report
FileUtils().WriteFile(msg_file_path, msg_body)
@@ -348,8 +348,8 @@ class MockExperimentRunner(ExperimentRunner):
super(MockExperimentRunner, self).__init__(experiment, json_report)
def _Run(self, experiment):
- self.l.LogOutput(
- "Would run the following experiment: '%s'." % experiment.name)
+ self.l.LogOutput("Would run the following experiment: '%s'." %
+ experiment.name)
def _PrintTable(self, experiment):
self.l.LogOutput('Would print the experiment table.')
diff --git a/crosperf/results_report.py b/crosperf/results_report.py
index ff8c119d..dc80b53b 100644
--- a/crosperf/results_report.py
+++ b/crosperf/results_report.py
@@ -418,8 +418,8 @@ class TextResultsReport(ResultsReport):
cpu_info = experiment.machine_manager.GetAllCPUInfo(experiment.labels)
sections.append(self._MakeSection('CPUInfo', cpu_info))
- totaltime = (
- time.time() - experiment.start_time) if experiment.start_time else 0
+ totaltime = (time.time() -
+ experiment.start_time) if experiment.start_time else 0
totaltime_str = 'Total experiment time:\n%d min' % (totaltime // 60)
cooldown_waittime_list = ['Cooldown wait time:']
# When running experiment on multiple DUTs cooldown wait time may vary
@@ -430,8 +430,9 @@ class TextResultsReport(ResultsReport):
cooldown_waittime_list.append('DUT %s: %d min' % (dut, waittime // 60))
cooldown_waittime_str = '\n'.join(cooldown_waittime_list)
sections.append(
- self._MakeSection('Duration', '\n\n'.join(
- [totaltime_str, cooldown_waittime_str])))
+ self._MakeSection('Duration',
+ '\n\n'.join([totaltime_str,
+ cooldown_waittime_str])))
return '\n'.join(sections)