jonhoo / inferno

A Rust port of FlameGraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not require collapsing

That3Percent opened this issue · comments

I just started a new low-overhead intrusive profiler called firestorm . It exists because the dominant intrusive profiler flame has too much overhead within calls to start and end to be effective in Tree-Buf and seems abandoned.

firestorm currently uses inferno to output the flames, but as compared to flame the output collapses all stack frames. This may be desirable, but often it loses important information, like how many times a function has been called or whether time in a parent function is before or after another call.

It makes sense to collapse for a sampling profiler, but not so much for an intrusive one which knows for sure that two "samples" are always exactly two different calls. Ideally, I'd like for a toggle in the svg that switches between a collapsed rendering and an uncollapsed one, but if that's difficult an option should suffice.

Hopefully, this can go hand-in-hand with #164 since more API surface area may be needed to express the spans

Hmm, I'm not quite sure I follow. inferno (well, inferno-flamegraph specifically) doesn't really require collapsing; as long as the lines are formatted appropriately, there can be duplicates. It does sort the inputs (though you can work around that with --no-sort). It may not yield the output you wish though. Instead, it sounds like what you want may be "flamechart mode" as described in #23?

I may be a bit confused by the terminology. There is folding, collapsing, merging, and sorting but I'm not sure what is what. I think you are right that it's probably the "flamechart mode" that I'm looking for to replicate what flame does.

I took some snapshots to compare the two: flame vs firestorm via inferno. You can see that in flame there is a lot more going on, because multiple instances of the same callstack are not merged into a single bar, but can be multiple bars.

Yup, I think flamechart mode is exactly what you're after — it does not combine stacks "across time". Inferno doesn't support it at the moment, though from memory it should be fairly easy to add (#23 has some instructions), if you have some spare cycles?

Someone tried to add this already in #125. I'd like to see what happens to that PR before contributing.

Ah, wow, yes, I had completely forgotten about that PR. Good point. I've followed up there.

Closing as duplicate.