brendangregg / FlameGraph

Stack trace visualizer
http://www.brendangregg.com/flamegraphs.html
17.46k stars 1.97k forks source link

Remove line number from stackcollapse-wcp output #331

Open iTrooz opened 9 months ago

iTrooz commented 9 months ago

Right now stackcollapse-wcp.pl keeps the file and line numbers as part of the function name (so a function is named main (at main.cpp:50 for example)

This causes functions to be registered multiple times (see screenshots)

I'm not 100% sure, but I'd say that this is not how flame graphs work, and not a wanted behavior ?

Without patch: without_patch

With patch with_patch

iTrooz commented 9 months ago

Actually, I noticed that line numbers can sometimes be useful to know what function a frame actually corresponds to (for example, Vec#contains() in Rust is not shown well), or when a given functions calls another functions several times (e.g. multiple push() made in the same function) so I added a --lines options (off by default) to separate by line