brendangregg / FlameGraph

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

Not aggregating stacks for threads #339

Open mux opened 2 months ago

mux commented 2 months ago

I have an application with multiple worker threads that share the same entry point. If the threads have different names, I can see traces for individual threads. If they share the same name, they are aggregated. Is there a way to get non-aggregated flamegraphs even when the threads have the same name?

randomstuff commented 2 months ago

It depends on the tool you are using. For example when using stackcollapse-jstack.pl, the --include-tid can be used to include a thread ID.

mux commented 2 months ago

I am using perf, and haven't seen any such option in the stackcollapse-perf.pl utility.

randomstuff commented 2 months ago

I guess, the --tid flag should do the trick:

https://github.com/brendangregg/FlameGraph/blob/57589a4edd210d2297664137ed5bd6cb88d73d65/stackcollapse-perf.pl#L106