profiler
profiler copied to clipboard
"Traced running time" is incorrect and meaningless on merged threads
Profile: https://share.firefox.dev/3ptwJzF
In this merged thread, for CFRunLoopRunSpecific the sidebar shows "Traced running time: 138ms" and "Running samples: 2677".
This does not make much sense.
My guess is that the interleaved samples are causing this issue.
How would you compute this value in threads with interleaved samples?
I guess you would need to add another array for the TID of the sample in the merged thread.
Thread { ..., tid?: TID[] }
Then in the for loop computing traced timing, look up the last call node index for that given thread, and accumulate that thread's timing.
Oh, interesting.
I believe this is related to https://github.com/firefox-devtools/profiler/issues/2783
Well, somewhat - with a tid you could draw separate stack charts, maybe split the stack chart vertically into N horizontal bands, one band for each thread. The tid would also let us draw a more accurate CPU usage graph on a merged thread.
It might be worth to break out these tid ideas into separate issues, as they all seem pretty useful to me.