From d6d502c22d7d0438b3151fd32d7eb6f83b73711f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 22 Feb 2019 17:47:07 +0100 Subject: use global perf_allowed --- src/benchmark.py | 8 +++++--- 1 file 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 -- cgit v1.2.3