jonhoo / inferno

A Rust port of FlameGraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consistent coloring, without input files?

saethlin opened this issue · comments

It seems like the only way to get consistently-colored flamegraphs is for every user to maintain a little database file of functions and their colors. This is inconvenient and makes coordinating work tricky; these mappings become another resource that needs to be version-controlled which is rather at odd with how explorative profiling tends to be.

Why isn't the coloring of a flamegraph deterministic by default? I have changes in my fork ready to go if anyone is interested.

Inferno uses the same default as the original Perl implementation uses. Whether that's a good default I'm not sure, but I think it's valuable to stick decently closely to the original. You can opt into deterministic coloring by using the hash argument — does that work for you?

Unfortunately not at all. For the codebases I care about, --hash picks almost exactly the same color for the whole flamegraph, because nearly all the functions are from the same crate.

I'm tempted to advocate for a new flag to produce the behavior that I want, but I really don't know what to call it because --hash already exists and deliberately does not do what I want.

You could use consistent or deterministic?

Implementation: #190

Closed by #190