Added alternative flamegraph implementation that can show callers.
Add an experimental flame-graph implementation. It can be selected in pprof's web interface using the new "Flame (experimental)" menu entry. At some point this new implementation may become the default.
The new view is similar to flame-graph view. But it can show caller information as well. This should allow it to satisfy many users of Graph and Peek views as well.
Let's illustrate with an example. Suppose we have profile data that consists of the following stacks:
1000 main -> foo -> malloc
2000 main -> bar -> malloc
When main is selected, both the old and new views show:
[-------------------3000 main---------------------]
[---1000 foo-----] [----------2000 bar------------]
[---1000 malloc--] [----------2000 malloc---------]
But suppose now the user selects the right-most malloc slot. The old view will show just the path leading to that malloc:
[----------2000 main-----------]
[----------2000 bar------------]
[----------2000 malloc---------]
The new view will however show a flame-graph view that grows upwards that displays the call stacks leading to malloc:
[---1000 main----] [----------2000 main-----------]
[---1000 foo-----] [----------2000 bar------------]
[-------------------3000 malloc-------------------]
This caller display is useful when trying to determine expensive callers of function.
A list of important differences between the new view and flame graphs:
New view pros:
- Callers are shown, e.g., all paths leading to malloc.
- Shows self-cost clearly with a different saturation.
- Font size is adjusted to fit more text into boxes.
- Highlighting on hover shows other occurrences of a function.
- Search works more like other views.
- Pivot changes are reflected in browser history (so back and forward buttons can be used to navigate between different selections).
- Allows eventual removal of the D3 dependency, which may make integrations into various environments easier.
- Colors provide higher contrast between foreground and background.
New view cons:
- There are small differences in how things look and feel.
- Color-scheme is very different.
- Change triggered by selecting a new entry is not animated.