From 3b904d13c4717474855c971cbc90b130ad51a6de Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 27 Feb 2019 14:46:02 +0100 Subject: fix perf checks --- src/benchmark.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/benchmark.py') diff --git a/src/benchmark.py b/src/benchmark.py index b766e9b..af0fd8e 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -137,7 +137,9 @@ class Benchmark (object): # check if perf is allowed on this system if self.measure_cmd == self.defaults["measure_cmd"]: - if self.perf_allowed == None: + if Benchmark.perf_allowed == None: + if verbose: + print("Check if you are allowed to use perf ...") res = subprocess.run(["perf", "stat", "ls"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -145,9 +147,11 @@ class Benchmark (object): if res.returncode != 0: print("Test perf run failed with:") print(res.stderr) - perf_allowed = False + Benchmark.perf_allowed = False + else: + Benchmark.perf_allowed = True - if not self.perf_allowed: + if not Benchmark.perf_allowed: print("Skipping", self.name, "because you don't have the", "needed permissions to use perf") return False -- cgit v1.2.3