Optionally discover unregistered threads, and profile them if possible
Categories
(Core :: Gecko Profiler, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
(Blocks 4 open bugs)
Details
Attachments
(4 files)
Some threads are not registered, either because the author forgot to add AUTO_PROFILER_REGISTER_THREAD
(or it may be difficult in some cases), or they're third-party threads (e.g., launched by libraries we don't control).
This bug will attempt to find these unregistered threads, using the same techniques as in about:processes (i.e., using GetProcInfo
directly or indirectly).
This bug and/or follow-ups will also capture as much information as possible, including profiling data like CPU utilization and stacks.
Assignee | ||
Comment 1•3 years ago
|
||
The work happening in bug 1742472 will help reduce the amount of (duplicated) code that's needed for this bug here, so I'll wait for it to land first.
Thanks Florian! 😄
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 3•3 years ago
|
||
The profiler uses GetProcInfo to discover unregistered threads.
On Windows, because this work takes much longer than the usual sampling interval, it is done on its own thread.
Depends on D132212
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D132212
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
When constructing the SamplerThread object, individual features were extracted from the feature set (a uint32_t), and passed as bools. This could be error-prone, wasteful, and a maintenance burden when more features are needed in some/all platform implementations (like the next patch adding a new feature with a Windows-specific impact).
So now the full feature set is given to the SamplerThread, which can then extract the features it requires on each platform.
Depends on D132317
Assignee | ||
Comment 6•3 years ago
|
||
I've looked at trying to collect stacks from unregistered threads, but the way the profiler's stack-collecting code is currently working is geared towards self-registered threads with special platform-specific data, so I'll leave that more complex feature to a future bug...
Comment 8•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7ae841376a63
https://hg.mozilla.org/mozilla-central/rev/6ad3ac6d47fd
https://hg.mozilla.org/mozilla-central/rev/8dd880bb625b
https://hg.mozilla.org/mozilla-central/rev/33a5f03babea
Description
•