Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle demangled C++ functions better

  • Loading branch information...
commit 65000d791c7873a2de2a5977926d8afdd3a6a7ef 1 parent d03cc99
@davepacheco authored
Showing with 5 additions and 0 deletions.
  1. +3 −0  flamegraph.pl
  2. +2 −0  stackcollapse.pl
View
3  flamegraph.pl
@@ -240,6 +240,9 @@ sub flow {
$info = "all samples ($samples samples, 100%)";
} else {
my $pct = sprintf "%.2f", ((100 * $samples) / $timemax);
+ $func =~ s/&/&/g;
+ $func =~ s/</&lt;/g;
+ $func =~ s/>/&gt;/g;
$info = "$func ($samples samples, $pct%)";
}
$im->filledRectangle($x1, $y1, $x2, $y2, color("hot"), 'rx="2" ry="2" onmouseover="s(' . "'$info'" . ')" onmouseout="c()"');
View
2  stackcollapse.pl
@@ -76,6 +76,8 @@ sub remember_stack {
my $frame = $_;
$frame =~ s/^\s*//;
$frame =~ s/\+.*$//;
+ # Remove arguments from C++ function names.
+ $frame =~ s/(..)[(<].*/$1/;
$frame = "-" if $frame eq "";
unshift @stack, $frame;
}
Please sign in to comment.
Something went wrong with that request. Please try again.