aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-02-27 14:46:02 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-02-27 14:46:02 +0100
commit3b904d13c4717474855c971cbc90b130ad51a6de (patch)
tree23baeca95995e677b18c8f4aef8bd716aaa64e01 /src
parent9dd2a85f0c68f80a7691d7f8ee286e5303a9884b (diff)
downloadallocbench-3b904d13c4717474855c971cbc90b130ad51a6de.tar.gz
allocbench-3b904d13c4717474855c971cbc90b130ad51a6de.zip
fix perf checks
Diffstat (limited to 'src')
-rw-r--r--src/benchmark.py10
1 files changed, 7 insertions, 3 deletions
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