aboutsummaryrefslogtreecommitdiff
path: root/crosperf
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-03-05 15:41:42 -0800
committerZhizhou Yang <zhizhouy@google.com>2019-03-07 18:13:31 +0000
commite3be45d3782df2e2025fcc6d17458ad5e8faa719 (patch)
tree27bdcddcd406b3a9f935b993708cb89dd1d8329c /crosperf
parentd8beb17b6028fbe0a9594462a6173cc16be884c5 (diff)
downloadtoolchain-utils-e3be45d3782df2e2025fcc6d17458ad5e8faa719.tar.gz
crosperf: do not put key 'samples' in result.keyval when test failed
This patch fixed two issues: 1) When determining how many iterations pass/fail, we originally check if samples exists or not in result.keyval. So it always comes up with "all pass" even if test fails and samples equals to 0. 2) Stddev will become large when we include 0s in samples. After this change, the value in failed cell with be 'None', and not be calculated in stddev and avg. BUG=chromium:938582 TEST=Tested with runs with failures, for cwp and general mode. Passed all unittests. Change-Id: If14eff40631be1080f6713f2bfb631843cb2ab62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1504632 Reviewed-by: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
Diffstat (limited to 'crosperf')
-rw-r--r--crosperf/results_cache.py4
-rwxr-xr-x[-rw-r--r--]crosperf/results_cache_unittest.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index ed9b68c5..419c41eb 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -381,11 +381,11 @@ class Result(object):
print('\n ** WARNING **: Had to use deprecated output-method to '
'collect results.\n')
self.keyvals = self.GetKeyvals()
+ self.keyvals['retval'] = self.retval
# If we are in CWP approximation mode, we want to collect DSO samples
# for each perf.data file
- if self.cwp_dso:
+ if self.cwp_dso and self.retval == 0:
self.keyvals['samples'] = self.GetSamples()
- self.keyvals['retval'] = self.retval
# Generate report from all perf.data files.
# Now parse all perf report files and include them in keyvals.
self.GatherPerfResults()
diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py
index 17fba8d9..fcf2872d 100644..100755
--- a/crosperf/results_cache_unittest.py
+++ b/crosperf/results_cache_unittest.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be