llogiq / flame

An intrusive flamegraph profiling tool for rust.
Apache License 2.0
694 stars 30 forks source link

Implement Stack Merging #19

Closed behnam closed 7 years ago

behnam commented 7 years ago

As noted on http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#description

The x-axis spans the sample population. It does not show the passing of time from left to right, as most graphs do. The left to right ordering has no meaning (it's sorted alphabetically to maximize frame merging).

Looks like rust flame is not doing any merging, which results in:

behnam commented 7 years ago

Example, from unicode-bidi: flame-udhr-graph.html.zip

TyOverby commented 7 years ago

This is because flame is a timeline flame graph, not an execution-percentage flame graph.

Instead of comparing flame to http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#description, compare it to something like the Chrome profiler.

TyOverby commented 7 years ago

Right now the flame API is such that you can request all this data yourself and do stack merging yourself.

If I added an API that would allow you to export that data, would this be helpful?

behnam commented 7 years ago

Right. Yeah, on top level, I think would be great to have an export-to-html method that also merges the stacks.

TyOverby commented 7 years ago

Stack merging is a non-goal, but I'll add an API for dumping custom frames.

TyOverby commented 7 years ago

Issue filed here: https://github.com/TyOverby/flame/issues/20