commit 4cffd13c447b8350c4887e8fc27c45762ff4b8df
parent 4d7e64e4a0bcaa4bde9f91af52596d79e8d58a3c
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Sun, 31 Jan 2016 14:43:59 -0800
Merge pull request #72 from rhysh/master
Support function names including '('
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/flamegraph.pl b/flamegraph.pl
@@ -672,7 +672,7 @@ my $inc = <<INC;
var r = find_child(e, "rect");
var t = find_child(e, "text");
var w = parseFloat(r.attributes["width"].value) -3;
- var txt = find_child(e, "title").textContent.replace(/\\([^(]*\\)/,"");
+ var txt = find_child(e, "title").textContent.replace(/\\([^(]*\\)\$/,"");
t.attributes["x"].value = parseFloat(r.attributes["x"].value) +3;
// Smaller than this size won't fit anything
diff --git a/stackcollapse-perf.pl b/stackcollapse-perf.pl
@@ -214,7 +214,12 @@ while (defined($_ = <>)) {
if ($tidy_generic) {
$func =~ s/;/:/g;
$func =~ tr/<>//d;
- $func =~ s/\(.*//;
+ if ($func !~ m/\.\(.*\)\./) {
+ # This doesn't look like a Go method name (such as
+ # "net/http.(*Client).Do"), so everything after the first open
+ # paren is just noise.
+ $func =~ s/\(.*//;
+ }
# now tidy this horrible thing:
# 13a80b608e0a RegExp:[&<>\"\'] (/tmp/perf-7539.map)
$func =~ tr/"\'//d;