aboutsummaryrefslogtreecommitdiff
path: root/common_targets.py
blob: 847536eee02689cc2706b741ceaff6d08e2b1511 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import subprocess

glibc_path = "/home/cip/2014/aj46ezos/BA/glibc/glibc-install/lib"
glibc_path_notc = "/home/cip/2014/aj46ezos/BA/glibc/glibc-install-notc/lib"

library_path = ""
p = subprocess.run(["ldconfig", "-v"], stdout=subprocess.PIPE,
                                        stderr=subprocess.PIPE,
                                        universal_newlines=True)

for l in p.stdout.splitlines():
    if not l.startswith('\t'):
        library_path += l

common_targets = {"klmalloc" : {
                                "cmd_prefix"    : "",
                                "binary_suffix" : "",
                                "LD_PRELOAD"    : "targets/libklmalloc.so",
                                "color"         : "C0"
                               },
                  "glibc" :    {
                                "cmd_prefix"    : "",
                                "binary_suffix" : "",
                                "LD_PRELOAD"    : "",
                                "color"         : "C1"
                               },
                  "tcmalloc" : {
                                "cmd_prefix"    : "",
                                "binary_suffix" : "",
                                "LD_PRELOAD"    : "targets/libtcmalloc.so",
                                "color"         : "C2"
                               },
                  "jemalloc" : {
                                "cmd_prefix"    : "",
                                "binary_suffix" : "",
                                "LD_PRELOAD"    : "targets/libjemalloc.so",
                                "color"         : "C3"
                               },
                  "hoard"    : {
                                "cmd_prefix"    : "",
                                "binary_suffix" : "",
                                "LD_PRELOAD"    : "targets/libhoard.so",
                                "color"         : "C4"
                               },
                  "glibc-notc" :    {
                                "cmd_prefix"    : glibc_path+"/ld-2.28.9000.so "
                                                    + "--library-path "
                                                    + glibc_path + ":"
                                                    + library_path,
                                "binary_suffix" : "-glibc-notc",
                                "LD_PRELOAD"    : "/usr/lib/libstdc++.so /usr/lib/libgcc_s.so.1",
                                "color"         : "C5"
                               },
                  }

analyse_targets = {"chattymalloc" : {"cmd_prefix"    : "",
                                     "binary_suffix" : "",
                                     "LD_PRELOAD"    : "build/chattymalloc.so"
                                    }
                  }