llogiq / flame

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

Close spans before plotting output. #26

Open LuisAyuso opened 7 years ago

LuisAyuso commented 7 years ago

I am currently profiling some graphics code and I saw that currently open spans are not plotted in the output and this produces misleading stack plots.

I wrote a counter for a short number of frames and after that, I plot the flamegraph (html) and I shout down the application. This call happens inside of the function that renders the current frame and therefore is being profiled. the span is not present in the plot, although the nested ones (already finished) are.

I know that this is not the most pretty coding style, but since it can be written: flame should do the right job here... the question is how.

Anyhow, great job here. It is a very nice tool, especially when used with flamer.