aboutsummaryrefslogtreecommitdiff
path: root/scripts/print_facts.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-07-13 15:53:33 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-07-13 15:53:33 +0200
commit228101e7ea2b5a2c068e5c6d24e8a486b9ec980e (patch)
tree22e14f39821f13a931c580d721cd04256f15e3b0 /scripts/print_facts.py
parentbbd008e2b0df0dc03db6d8671ed5041c1cdb04de (diff)
downloadallocbench-228101e7ea2b5a2c068e5c6d24e8a486b9ec980e.tar.gz
allocbench-228101e7ea2b5a2c068e5c6d24e8a486b9ec980e.zip
[print_facts.py] update way of retrieving benchmark objects
Diffstat (limited to 'scripts/print_facts.py')
-rwxr-xr-xscripts/print_facts.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/scripts/print_facts.py b/scripts/print_facts.py
index 6099b6f..dfb07a6 100755
--- a/scripts/print_facts.py
+++ b/scripts/print_facts.py
@@ -19,7 +19,6 @@
"""Print facts about an allocbench result directory"""
import argparse
-import importlib
import os
import sys
@@ -27,10 +26,9 @@ CURRENTDIR = os.path.dirname(os.path.abspath(__file__))
PARENTDIR = os.path.dirname(CURRENTDIR)
sys.path.insert(0, PARENTDIR)
-from allocbench.benchmark import AVAIL_BENCHMARKS
+from allocbench.benchmark import AVAIL_BENCHMARKS, get_benchmark_object
import allocbench.facter as facter
from allocbench.plots import print_facts, print_common_facts
-from allocbench.util import print_error
def main():
@@ -48,14 +46,7 @@ def main():
os.chdir(args.results)
for benchmark in AVAIL_BENCHMARKS:
- bench_module = importlib.import_module(
- f"allocbench.benchmarks.{benchmark}")
-
- if not hasattr(bench_module, benchmark):
- print_error(f"{benchmark} has no member {benchmark}")
- print_error(f"Skipping {benchmark}.")
-
- bench = getattr(bench_module, benchmark)
+ bench = get_benchmark_object(benchmark)
try:
bench.load()