From ad8b237f62b9464dbff9a163647ebe6b721d6b35 Mon Sep 17 00:00:00 2001 From: Zhizhou Yang Date: Fri, 21 Dec 2018 13:07:00 -0800 Subject: crosperf: Fix bugs and nit in report generation Fixed two parts in source code to make unit test pass: 1) Without unit, cpu cycles still should multiply by weight 2) Do not try to access cwp_dso from experiment in BenchmarkResult object, because there is method to generate report without running experiment. One nit to change the name of TableGenerator used for CPU cycle report. TEST=passed all unit tests in crosperf BUG=chromium:902785 CQ-DEPEND=CL:1376571 Change-Id: I8308b0287d60e77542ac60f5ecd5734907e51e01 Reviewed-on: https://chromium-review.googlesource.com/1389035 Commit-Ready: Zhizhou Yang Tested-by: Zhizhou Yang Reviewed-by: Luis Lozano --- cros_utils/tabulator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cros_utils/tabulator.py') diff --git a/cros_utils/tabulator.py b/cros_utils/tabulator.py index 687ffeb8..cbc261b0 100644 --- a/cros_utils/tabulator.py +++ b/cros_utils/tabulator.py @@ -207,7 +207,7 @@ class TableGenerator(object): return table -class CPUTableGenerator(TableGenerator): +class CPUCyclesTableGenerator(TableGenerator): """Creates a table with only cpu cycles from the results The main public function is called GetTable(). @@ -231,7 +231,7 @@ class CPUTableGenerator(TableGenerator): 3) updated benchmark_results iter_count with composite benchmark The dict of list of list of dicts is passed into the constructor of - CPUTableGenerator. + CPUCyclesTableGenerator. This method converts that into a canonical list of lists which represents a table of values. @@ -291,7 +291,7 @@ class CPUTableGenerator(TableGenerator): val = run['cpu_cycles'][0] * self._weights[k] unit = run['cpu_cycles'][1] else: - val = run['cpu_cycles'] + val = run['cpu_cycles'] * self._weights[k] v.append(val) run_pass += 1 else: @@ -386,7 +386,7 @@ class CPUTableGenerator(TableGenerator): self._runs[k] = v self._iter_counts[k] = iterations - + return (table, self._runs, self._iter_counts) -- cgit v1.2.3