aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/installed_allocators.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/allocators/installed_allocators.py')
-rw-r--r--src/allocators/installed_allocators.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/allocators/installed_allocators.py b/src/allocators/installed_allocators.py
index d45755a..5e3c78d 100644
--- a/src/allocators/installed_allocators.py
+++ b/src/allocators/installed_allocators.py
@@ -14,7 +14,6 @@
#
# You should have received a copy of the GNU General Public License
# along with allocbench.
-
"""Collect allocators using installed system libraries"""
import subprocess
@@ -22,23 +21,30 @@ import subprocess
# TODO: add more allocators
MAYBE_ALLOCATORS = ["tcmalloc", "jemalloc", "hoard"]
-allocators = {"libc": {"cmd_prefix": "",
- "binary_suffix": "",
- "LD_PRELOAD": "",
- "LD_LIBRARY_PATH": "",
- "color": "C1"}}
+allocators = {
+ "libc": {
+ "cmd_prefix": "",
+ "binary_suffix": "",
+ "LD_PRELOAD": "",
+ "LD_LIBRARY_PATH": "",
+ "color": "C1"
+ }
+}
for i, t in enumerate(MAYBE_ALLOCATORS):
try:
path = subprocess.run('whereis lib{} | cut -d":" -f2'.format(t),
- shell=True, stdout=subprocess.PIPE,
+ shell=True,
+ stdout=subprocess.PIPE,
universal_newlines=True).stdout.strip()
except:
continue
if path != "":
- allocators[t] = {"cmd_prefix": "",
- "binary_suffix": "",
- "LD_PRELOAD": path,
- "LD_LIBRARY_PATH": "",
- "color": "C"+str(i+2)}
+ allocators[t] = {
+ "cmd_prefix": "",
+ "binary_suffix": "",
+ "LD_PRELOAD": path,
+ "LD_LIBRARY_PATH": "",
+ "color": "C" + str(i + 2)
+ }