Skip to content

Commit f96f227

Browse files
author
Tom Quisel
committed
Make addr2line's location configurable
1 parent 7dc3b7e commit f96f227

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

bin/profile.py

100644100755
+13-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
##=======================================================================
1010

11-
ADDR2LINE = "addr2line"
1211
DOT = "dot"
1312
FILE = "file"
1413

@@ -581,7 +580,7 @@ def lookupFunctionNames (self, props):
581580

582581
for f in self._sites_by_file:
583582

584-
cmd = [ ADDR2LINE ]
583+
cmd = [ props.addr2line() ]
585584
if inln:
586585
cmd += [ "-i" ]
587586
cmd += [ "-C", "-f", "-e", f.jname () ]
@@ -846,6 +845,7 @@ def __init__ (self, argv):
846845
self._font_size = 20
847846
self._stem = "ssp"
848847
self._display_top = False
848+
self._addr2line = "addr2line"
849849

850850
self.parse (argv)
851851

@@ -901,8 +901,13 @@ def displayTop (self):
901901

902902
##----------------------------------------
903903

904+
def addr2line (self):
905+
return self._addr2line
906+
907+
##----------------------------------------
908+
904909
def parse (self, argv):
905-
short_opts = "n:e:ht:j:if:s:d"
910+
short_opts = "n:e:ht:j:if:s:da:"
906911
long_opts = [ "num-nodes=",
907912
"num-edges=",
908913
"jail=",
@@ -911,7 +916,8 @@ def parse (self, argv):
911916
"inlining",
912917
"font-size=",
913918
"stem=",
914-
"display-top" ]
919+
"display-top",
920+
"addr2line="]
915921

916922
types = []
917923
try:
@@ -967,6 +973,9 @@ def parse (self, argv):
967973
elif o in ("-d", "--display-top"):
968974
self._display_top = True
969975

976+
elif o in ("-a", "--addr2line"):
977+
self._addr2line = a
978+
970979
else:
971980
self.usage (err = "unknown argument: %s" % o)
972981

0 commit comments

Comments
 (0)