Skip to content

Commit 4cffd13

Browse files
committed
Merge pull request brendangregg#72 from rhysh/master
Support function names including '('
2 parents 4d7e64e + 0076f12 commit 4cffd13

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

flamegraph.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ sub flow {
672672
var r = find_child(e, "rect");
673673
var t = find_child(e, "text");
674674
var w = parseFloat(r.attributes["width"].value) -3;
675-
var txt = find_child(e, "title").textContent.replace(/\\([^(]*\\)/,"");
675+
var txt = find_child(e, "title").textContent.replace(/\\([^(]*\\)\$/,"");
676676
t.attributes["x"].value = parseFloat(r.attributes["x"].value) +3;
677677
678678
// Smaller than this size won't fit anything

stackcollapse-perf.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,12 @@ sub inline {
214214
if ($tidy_generic) {
215215
$func =~ s/;/:/g;
216216
$func =~ tr/<>//d;
217-
$func =~ s/\(.*//;
217+
if ($func !~ m/\.\(.*\)\./) {
218+
# This doesn't look like a Go method name (such as
219+
# "net/http.(*Client).Do"), so everything after the first open
220+
# paren is just noise.
221+
$func =~ s/\(.*//;
222+
}
218223
# now tidy this horrible thing:
219224
# 13a80b608e0a RegExp:[&<>\"\'] (/tmp/perf-7539.map)
220225
$func =~ tr/"\'//d;

0 commit comments

Comments
 (0)