Closed ogrisel closed 3 years ago
Related, if speedscope ever supports multitracks rendering, one would expect one track per process with subtracks per threads, or althernatively one track per threads but tracks belonging to the same process grouped together, with the parent process at the top.
https://github.com/jlfwong/speedscope/issues/117#issuecomment-901167139
Thanks for pointing this out! I've fixed in #440 - it will now display both the process id and thread id in the profile names.
I have also caught another issue with speedscope format when profiling with subprocesses when fixing this: the profiles were being keyed by the pthread id - which isn't unique across processes. This caused profiles from different processes to be merged together for me, and made the 'time order' view confusing.
Nice, I also suspected a bug related in the handling of multiprocess/multithreaded traces but wasn't sure. Thanks for confirming and for the fix!
Fix is in v0.3.9
At the moment, when profiling a multiprocess Python program many threads are named
MainThread
when--subprocess
is passed topy-spy record
. This makes it hard to browse to navigate the speedscope report:One possible solution would be to prefix the thread name with the pid of the process. This would make it easier to understand how threads are grouped.