diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-02-08 13:31:11 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-02-08 13:31:11 +0100 |
| commit | f2327ada5590f40137416f301762cd3c11ab36b6 (patch) | |
| tree | 7e49bfbb189ce34c84384a444aed13125bc6c8ff /src/allocators.py | |
| parent | 9240e149758e6e3923151687a7830e8940567ddc (diff) | |
| download | allocbench-f2327ada5590f40137416f301762cd3c11ab36b6.tar.gz allocbench-f2327ada5590f40137416f301762cd3c11ab36b6.zip | |
s/target/allocator/ and remove analyse feature
Use systemwide installed allocators by default
Diffstat (limited to 'src/allocators.py')
| -rw-r--r-- | src/allocators.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/allocators.py b/src/allocators.py new file mode 100644 index 0000000..dbf26d1 --- /dev/null +++ b/src/allocators.py @@ -0,0 +1,22 @@ +"""Default allocators using system libraries""" + +import os +import subprocess + +maybe_allocators = ["tcmalloc", "jemalloc", "hoard"] + +allocators = {"libc": {"cmd_prefix" : "", + "binary_suffix" : "", + "LD_PRELOAD" : "", + "color" : "C1"}} + +for i, t in enumerate(maybe_allocators): + try: + path = subprocess.check_output('whereis lib{} | cut -d":" -f2'.format(t), + shell=True, text=True).strip() + + if path != "": + allocators[t] = {"cmd_prefix": "", "binary_suffix": "", + "LD_PRELOAD": path, "color": "C"+str(i+2)} + except: + pass |
