Skip to content
Browse files

Avoid problems with "--" in func names by using ";" as internal delim…

…eter

We know ";" is safe because it's the primary input delimiter.
  • Loading branch information...
1 parent 19eac63 commit f7c817024539dab6561fc91affa1c9e5a4342b63 @timbunce timbunce committed Mar 26, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 flamegraph.pl
View
10 flamegraph.pl
@@ -211,15 +211,15 @@ sub flow {
$len_same = $i;
for ($i = $len_a; $i >= $len_same; $i--) {
- my $k = "$last->[$i]--$i";
- # a unique ID is constructed from func--depth--etime;
+ my $k = "$last->[$i];$i";
+ # a unique ID is constructed from "func;depth;etime";
# func-depth isn't unique, it may be repeated later.
- $Node{"$k--$v"}->{stime} = delete $Tmp{$k}->{stime};
+ $Node{"$k;$v"}->{stime} = delete $Tmp{$k}->{stime};
delete $Tmp{$k};
}
for ($i = $len_same; $i <= $len_b; $i++) {
- my $k = "$this->[$i]--$i";
+ my $k = "$this->[$i];$i";
$Tmp{$k}->{stime} = $v;
}
@@ -289,7 +289,7 @@ sub flow {
# Draw frames
foreach my $id (keys %Node) {
- my ($func, $depth, $etime) = split "--", $id;
+ my ($func, $depth, $etime) = split ";", $id;
die "missing start for $id" if !defined $Node{$id}->{stime};
my $stime = $Node{$id}->{stime};

0 comments on commit f7c8170

Please sign in to comment.
Something went wrong with that request. Please try again.