aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-07-03 12:09:15 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-07-03 12:09:15 +0200
commita345678674f679a2ccb5a262d1362256d71a1254 (patch)
tree540c14c7be758a72b26fa21f149622744e317cea
parent27d22e487ce1967f5b387b3579ae1f9de4c8ce2b (diff)
downloadallocbench-a345678674f679a2ccb5a262d1362256d71a1254.tar.gz
allocbench-a345678674f679a2ccb5a262d1362256d71a1254.zip
[allocators] fix 'all' allocators target and exclude allocators used for analysis
-rw-r--r--allocbench/allocator.py7
-rw-r--r--allocbench/allocators/chattymalloc.py1
-rw-r--r--allocbench/allocators/malt.py3
3 files changed, 7 insertions, 4 deletions
diff --git a/allocbench/allocator.py b/allocbench/allocator.py
index 52f1321..5ba64ef 100644
--- a/allocbench/allocator.py
+++ b/allocbench/allocator.py
@@ -51,7 +51,7 @@ class Allocator:
Allocator.build will compile the allocator and produce a for allocbench usable
allocator dict"""
allowed_attributes = [
- "binary_suffix", "cmd_prefix", "ld_preload", "ld_library_path",
+ "analyze_alloc", "binary_suffix", "cmd_prefix", "ld_preload", "ld_library_path",
"color", "sources", "version", "patches", "prepare_cmds", "build_cmds"
]
@@ -65,6 +65,7 @@ class Allocator:
patches = []
prepare_cmds = []
build_cmds = []
+ analyze_alloc = False
def __init__(self, name, **kwargs):
self.class_file = Path(inspect.getfile(self.__class__))
@@ -228,7 +229,7 @@ def collect_available_allocators():
alloc_module_name = f'allocbench.allocators.{alloc_def_path.stem}'
module = importlib.import_module(alloc_module_name)
for name, obj in module.__dict__.items():
- if issubclass(obj.__class__, Allocator):
+ if issubclass(obj.__class__, Allocator) and not obj.analyze_alloc:
available_allocators[name] = obj
return available_allocators
@@ -271,7 +272,7 @@ def collect_allocators(allocators):
ret = {}
for name in allocators:
if name == "all":
- return available_allocators
+ return {a: available_allocators[a].build() for a in available_allocators}
if name == "installed":
print_status("Using system-wide installed allocators ...")
ret.update(collect_installed_allocators())
diff --git a/allocbench/allocators/chattymalloc.py b/allocbench/allocators/chattymalloc.py
index 22dc2d4..d0056d7 100644
--- a/allocbench/allocators/chattymalloc.py
+++ b/allocbench/allocators/chattymalloc.py
@@ -45,6 +45,7 @@ class Chattymalloc(Allocator):
self.ld_preload = "{dir}/libchattymalloc.so"
self.cmd_prefix = "env CHATTYMALLOC_FILE={{result_dir}}/{{perm}}.trace"
+ self.analyze_alloc = True
super().__init__(name, **kwargs)
diff --git a/allocbench/allocators/malt.py b/allocbench/allocators/malt.py
index ebe4255..64e17d7 100644
--- a/allocbench/allocators/malt.py
+++ b/allocbench/allocators/malt.py
@@ -26,4 +26,5 @@ from allocbench.allocator import Allocator
# pylint: disable=invalid-name
malt = Allocator(
"malt",
- cmd_prefix="malt -q -o output:name={{result_dir}}/malt.{{perm}}.%3")
+ cmd_prefix="malt -q -o output:name={{result_dir}}/malt.{{perm}}.%3",
+ analyze_alloc=True)