Permalink
Browse files

Merge pull request #16 from timbunce/flowdelim2

Avoid problems with "--" in func names by using ";" as internal delimeter
  • Loading branch information...
2 parents f048d80 + f7c8170 commit cd7c0f0eabb1cee461985a61d078aec947228b37 @brendangregg committed Mar 27, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 flamegraph.pl
View
@@ -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 cd7c0f0

Please sign in to comment.