aboutsummaryrefslogtreecommitdiff
path: root/crosperf/benchmark_run.py
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-03-04 17:25:28 -0800
committerZhizhou Yang <zhizhouy@google.com>2019-03-06 23:40:20 +0000
commitd8beb17b6028fbe0a9594462a6173cc16be884c5 (patch)
tree0224d615bcba33a1185ddbaa595a8837993d4692 /crosperf/benchmark_run.py
parenta1a431178f52d1b7b8b24ea2851b509627ddb89d (diff)
downloadtoolchain-utils-d8beb17b6028fbe0a9594462a6173cc16be884c5.tar.gz
crosperf: enabling result caching for cwp mode
This patch provides support for result caching when cwp_dso is specified. This patch introduced cwp_dso into ResultsCache class, so that cwp_dso info will be stored while caching. When populating from cache, samples will be re-calculated with the perf.data file that has been cached before. This patch also: 1) Fixed return value of GetSamples(). 2) Not need to pass weight to result. 3) Added unit tests. BUG=chromium:905854 TEST=Passed all unit tests; Tested with --rerun=True/False, both on cwp and general mode, to make sure cache works. Change-Id: I297fa0aaad781b4a665a4a29bb6fdb4bca0d790b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1501458 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> Tested-by: Zhizhou Yang <zhizhouy@google.com>
Diffstat (limited to 'crosperf/benchmark_run.py')
-rw-r--r--crosperf/benchmark_run.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/crosperf/benchmark_run.py b/crosperf/benchmark_run.py
index 4c5c75b5..4e5de05e 100644
--- a/crosperf/benchmark_run.py
+++ b/crosperf/benchmark_run.py
@@ -75,7 +75,7 @@ class BenchmarkRun(threading.Thread):
self.label.board, self.cache_conditions, self._logger,
self.log_level, self.label, self.share_cache,
self.benchmark.suite, self.benchmark.show_all_results,
- self.benchmark.run_local)
+ self.benchmark.run_local, self.benchmark.cwp_dso)
self.result = self.cache.ReadResult()
self.cache_hit = (self.result is not None)
@@ -99,7 +99,7 @@ class BenchmarkRun(threading.Thread):
self.result = Result.CreateFromRun(
self._logger, self.log_level, self.label, self.machine, output, err,
retval, self.benchmark.test_name, self.benchmark.suite,
- self.benchmark.cwp_dso, self.benchmark.weight)
+ self.benchmark.cwp_dso)
else:
self._logger.LogOutput('%s: No cache hit.' % self.name)
@@ -216,7 +216,7 @@ class BenchmarkRun(threading.Thread):
return Result.CreateFromRun(self._logger, self.log_level, self.label,
self.machine, out, err, retval,
self.benchmark.test_name, self.benchmark.suite,
- self.benchmark.cwp_dso, self.benchmark.weight)
+ self.benchmark.cwp_dso)
def SetCacheConditions(self, cache_conditions):
self.cache_conditions = cache_conditions
@@ -249,7 +249,7 @@ class MockBenchmarkRun(BenchmarkRun):
self.label.board, self.cache_conditions, self._logger,
self.log_level, self.label, self.share_cache,
self.benchmark.suite, self.benchmark.show_all_results,
- self.benchmark.run_local)
+ self.benchmark.run_local, self.benchmark.cwp_dso)
self.result = self.cache.ReadResult()
self.cache_hit = (self.result is not None)