From 862074c1a1d397e1abbbb7e22f1ca0ab7688b148 Mon Sep 17 00:00:00 2001 From: Brendan Gregg Date: Mon, 16 Jan 2017 16:40:56 -0800 Subject: [PATCH] change whole stack delimiter to be -- and user/kernel delimeter to be - --- flamegraph.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/flamegraph.pl b/flamegraph.pl index 3a4c6231..e551d355 100755 --- a/flamegraph.pl +++ b/flamegraph.pl @@ -573,16 +573,16 @@ sub flow { # for chain graphs, annotate waker frames with "_[w]", for later # coloring. This is a hack, but has a precedent ("_[k]" from perf). if ($colors eq "chain") { - my @parts = split ";-;", $stack; + my @parts = split ";--;", $stack; my @newparts = (); $stack = shift @parts; - $stack .= ";-;"; + $stack .= ";--;"; foreach my $part (@parts) { $part =~ s/;/_[w];/g; $part .= "_[w]"; push @newparts, $part; } - $stack .= join ";-;", @parts; + $stack .= join ";--;", @parts; } # merge frames and populate %Node: @@ -968,11 +968,12 @@ sub flow { INC $im->include($inc); $im->filledRectangle(0, 0, $imagewidth, $imageheight, 'url(#background)'); -my ($white, $black, $vvdgrey, $vdgrey) = ( +my ($white, $black, $vvdgrey, $vdgrey, $dgrey) = ( $im->colorAllocate(255, 255, 255), $im->colorAllocate(0, 0, 0), $im->colorAllocate(40, 40, 40), $im->colorAllocate(160, 160, 160), + $im->colorAllocate(200, 200, 200), ); $im->stringTTF($black, $fonttype, $fontsize + 5, 0.0, int($imagewidth / 2), $fontsize * 2, $titletext, "middle"); $im->stringTTF($black, $fonttype, $fontsize, 0.0, $xpad, $imageheight - ($ypad2 / 2), " ", "", 'id="details"'); @@ -1040,8 +1041,10 @@ sub flow { $im->group_start($nameattr); my $color; - if ($func eq "-") { + if ($func eq "--") { $color = $vdgrey; + } elsif ($func eq "-") { + $color = $dgrey; } elsif (defined $delta) { $color = color_scale($delta, $maxdelta); } elsif ($palette) {