summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2015-09-03 19:27:21 +0300
committerMartin Peres <martin.peres@linux.intel.com>2015-09-03 19:27:21 +0300
commitec21b499ec0545cdfd0dc75caa9c6980bdf1e453 (patch)
treee118a676ef58f0870bb4b1a3462f051495c152f4
parentb3a3253027c5e921e64eae7f195106c77bdd506e (diff)
utils/perf_bisect: detect errors from ezbench and abort
-rwxr-xr-xutils/perf_bisect.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/perf_bisect.py b/utils/perf_bisect.py
index a02c39b..c2559cb 100755
--- a/utils/perf_bisect.py
+++ b/utils/perf_bisect.py
@@ -20,15 +20,18 @@ def check_commit_perf(ezbench_base_cmd, commit, logs_dir):
cmd.append(commit)
# Call ezbench
- with open(os.devnull, "w") as f:
- call(cmd, stdout=f, stderr=f)
+ try:
+ check_output(cmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ print("\n\nERROR: The following command '{}' failed with the error code {}. Here is its output:\n\n'{}'".format(" ".join(cmd), e.returncode, e.output.decode()))
+ sys.exit(1)
# parse the logs, read the perf of the last entry!
r = genPerformanceReport(logs_dir, True, True)
if len(r.benchmarks) != 1:
print ("Error: Expected one benchmark result for commit {} but got !".format(commit, len(r.benchmarks)))
- os.exit(1)
+ sys.exit(1)
# read the perf report of the last entry!
return getPerformanceResultsCommitBenchmark(r.commits[-1], r.benchmarks[0], True).mean()