flamegraph

Fork of flamegraph without J***S*****.
git clone git://git.laack.co/flamegraph.git
Log | Files | Refs | README

commit 4c94df1ed686801347dadde06c37d057731b20aa
parent a6e13e2d2c8b1401883508c2cd43aaa693c663c0
Author: Brendan Gregg <brendan.gregg@joyent.com>
Date:   Sat,  2 Nov 2013 23:11:24 -0700

io palette of cool colors for sleeping, I/O, or off-CPU Time Flame Graphs

Diffstat:
Mflamegraph.pl | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/flamegraph.pl b/flamegraph.pl @@ -105,7 +105,7 @@ USAGE: $0 [options] infile > outfile.svg\n --fontsize # font size (default 12) --countname # count type label (default "samples") --nametype # name type label (default "Function:") - --colors # "hot" or "mem" palette (default "hot") + --colors # "hot", "mem", "io" palette (default "hot") eg, $0 --title="Flame Graph: malloc()" trace.txt > graph.svg USAGE_END @@ -130,10 +130,8 @@ if ($nameattrfile) { } } -if ($colors eq "mem") { - $bgcolor1 = "#eeeeee"; - $bgcolor2 = "#e0e0ff"; -} +if ($colors eq "mem") { $bgcolor1 = "#eeeeee"; $bgcolor2 = "#e0e0ff"; } +if ($colors eq "io") { $bgcolor1 = "#f8f8f8"; $bgcolor2 = "#e8e8e8"; } # SVG functions { package SVG; @@ -229,6 +227,12 @@ sub color { my $b = 0 + int(rand(230)); return "rgb($r,$g,$b)"; } + if (defined $type and $type eq "io") { + my $r = 80 + int(rand(60)); + my $g = $r; + my $b = 190 + int(rand(55)); + return "rgb($r,$g,$b)"; + } return "rgb(0,0,0)"; }