Permalink
Browse files

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

…aphs
  • Loading branch information...
1 parent a6e13e2 commit 4c94df1ed686801347dadde06c37d057731b20aa Brendan Gregg committed Nov 3, 2013
Showing with 9 additions and 5 deletions.
  1. +9 −5 flamegraph.pl
View
14 flamegraph.pl
@@ -105,7 +105,7 @@
--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 ($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)";
}

0 comments on commit 4c94df1

Please sign in to comment.