Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rysto32/FlameGraph
base: 2672d89c26
...
head fork: rysto32/FlameGraph
compare: 93f5b1911b
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 14, 2012
Ryan Stone Use a semicolon to separate frames
Use a semicolon instead of a comma to separate frames in the
flamegraph input.  Commas can appear in demangled C++ function
names (e.g. foo(int, int) ) so using commas to separate frames
can confuse the parser.
02b07ad
Ryan Stone Escape strings after they have been truncated.
Don't truncate strings after they have been escaped.  If you do,
there is a chance you will happen to truncate half-way through
an escape sequence, causing malformed output.
93f5b19
View
16 flamegraph.pl
@@ -135,8 +135,8 @@ sub color {
sub flow {
my ($a, $b, $v) = @_;
- my @A = split ",", $a;
- my @B = split ",", $b;
+ my @A = split ";", $a;
+ my @B = split ";", $b;
my $len_a = $#A;
my $len_b = $#B;
@@ -240,10 +240,11 @@ 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%)";
+ my $escaped_func = $func;
+ $escaped_func =~ s/&/&amp;/g;
+ $escaped_func =~ s/</&lt;/g;
+ $escaped_func =~ s/>/&gt;/g;
+ $info = "$escaped_func ($samples samples, $pct%)";
}
$im->filledRectangle($x1, $y1, $x2, $y2, color("hot"), 'rx="2" ry="2" onmouseover="s(' . "'$info'" . ')" onmouseout="c()"');
@@ -251,6 +252,9 @@ sub flow {
my $chars = int($width / (0.7 * $fontsize));
my $text = substr $func, 0, $chars;
$text .= ".." if $chars < length $func;
+ $text =~ s/&/&amp;/g;
+ $text =~ s/</&lt;/g;
+ $text =~ s/>/&gt;/g;
$im->stringTTF($black, $fonttype, $fontsize, 0.0, $x1 + 3, 3 + ($y1 + $y2) / 2, $text, "",
'onmouseover="s(' . "'$info'" . ')" onmouseout="c()"');
}
View
2  stackcollapse-perf.pl
@@ -68,7 +68,7 @@ sub remember_stack {
chomp;
if (m/^$/) {
- remember_stack(join(",", @stack), 1) if @stack;
+ remember_stack(join(";", @stack), 1) if @stack;
undef @stack;
next;
}
View
2  stackcollapse-stap.pl
@@ -64,7 +64,7 @@ sub remember_stack {
chomp;
if (m/^\s*(\d+)+$/) {
- remember_stack(join(",", @stack), $1);
+ remember_stack(join(";", @stack), $1);
@stack = ();
next;
}
View
2  stackcollapse.pl
@@ -66,7 +66,7 @@ sub remember_stack {
chomp;
if (m/^\s*(\d+)+$/) {
- remember_stack(join(",", @stack), $1);
+ remember_stack(join(";", @stack), $1);
@stack = ();
next;
}

No commit comments for this range

Something went wrong with that request. Please try again.