aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-02-22 17:47:07 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-02-22 17:47:07 +0100
commitd6d502c22d7d0438b3151fd32d7eb6f83b73711f (patch)
treec8a3885f5fdc1cd999f3dd195299111c3c3f3238 /src
parente7f5fb2bc7bc124bd2da0c21bc7f9ce6de034ff2 (diff)
downloadallocbench-d6d502c22d7d0438b3151fd32d7eb6f83b73711f.tar.gz
allocbench-d6d502c22d7d0438b3151fd32d7eb6f83b73711f.zip
use global perf_allowed
Diffstat (limited to 'src')
-rw-r--r--src/benchmark.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/benchmark.py b/src/benchmark.py
index 4658e01..9e32160 100644
--- a/src/benchmark.py
+++ b/src/benchmark.py
@@ -11,9 +11,11 @@ import subprocess
from src.allocators import allocators
+perf_allowed = None
+
+
class Benchmark (object):
- perf_allowed = None
defaults = {
"name": "default_benchmark",
@@ -137,7 +139,7 @@ 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 perf_allowed == None:
res = subprocess.run(["perf", "stat", "ls"],
stdout=None, stderr=subprocess.PIPE,
universal_newlines=True)
@@ -146,7 +148,7 @@ class Benchmark (object):
print(res.stderr)
perf_allowed = False
- if not self.perf_allowed:
+ if not perf_allowed:
print("Skipping", self.name, "because you don't have the",
"needed permissions to use perf")
return False