Skip to content

Instantly share code, notes, and snippets.

@brendangregg
Created January 27, 2016 01:23
Show Gist options
  • Save brendangregg/11edb042712329c1c9c7 to your computer and use it in GitHub Desktop.
Save brendangregg/11edb042712329c1c9c7 to your computer and use it in GitHub Desktop.
flamegraph.pl OCaml color diff
--- flamegraph.pl 2015-12-08 10:30:59.000000000 -0800
+++ flamegraph-ocaml.pl 2016-01-26 17:20:46.000000000 -0800
@@ -342,6 +342,18 @@
}
# fall-through to color palettes
}
+ if (defined $type and $type eq "ocaml") {
+ if ($name =~ /::/) { # C++
+ $type = "yellow";
+ } elsif ($name =~ /^caml/) { # OCaml
+ $type = "green"
+ } elsif ($name =~ m:_\[k\]:) { # kernel
+ $type = "orange"
+ } else { # system
+ $type = "red";
+ }
+ # fall-through to color palettes
+ }
if (defined $type and $type eq "perl") {
if ($name =~ /::/) { # C++
$type = "yellow";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment