Name all threads in Firefox
Categories
(Core :: XPCOM, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: tarek, Assigned: tarek)
Details
Attachments
(1 file)
Some threads are started without a name (which is technically fine, the thread takes the process command name), but it makes it hard in GetProcInfo() to interpret thread activity.
Since it's just a label, let's see if we can track all unnamed threads and set meaningful names.
Assignee | ||
Comment 1•6 years ago
|
||
One first step is tom make sure that NS_SetCurrentThreadName() is call for every PR_CreateThread() call we own,
These are not set:
https://searchfox.org/mozilla-central/source/dom/media/GraphRunner.cpp#32
https://searchfox.org/mozilla-central/source/toolkit/recordreplay/ipc/ParentForwarding.cpp#397
https://searchfox.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#4270
https://searchfox.org/mozilla-central/source/widget/windows/AudioSession.cpp#260
https://searchfox.org/mozilla-central/source/security/nss/lib/ssl/sslsnce.c#1516
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/misc/prtpool.c#253
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/misc/prtpool.c#652
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/misc/prtpool.c#663
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/misc/prtpool.c#672
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/misc/pralarm.c#159
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/md/unix/uxproces.c#742
https://searchfox.org/mozilla-central/source/nsprpub/pr/src/cplus/rcthread.cpp#42
Assignee | ||
Comment 2•6 years ago
|
||
We should look in JS also, if some js::Thread are created without js::Thread::SetName() calls
Assignee | ||
Comment 3•6 years ago
|
||
Like here -> https://searchfox.org/mozilla-central/source/js/src/shell/js.cpp#4161
WorkerMain does not SetName
Assignee | ||
Comment 4•6 years ago
|
||
Do we want to add AUTO_PROFILER_REGISTER_THREAD calls everywhere as well? I am not sure.. asking the experts :)
Updated•6 years ago
|
Assignee | ||
Comment 5•6 years ago
|
||
We also need to track pthread_create() calls.
(In reply to Tarek Ziadé (:tarek) from comment #4)
Do we want to add AUTO_PROFILER_REGISTER_THREAD calls everywhere as well? I am not sure.. asking the experts :)
My first not-yet-expert reaction would be "yes please", so we can see them in profiles (if the user picks them by name, only a limited set is enabled by default, so the impact will remain small in most cases).
Ideally whoever coded these thread creations would be best placed to pick a name, and decide if a thread should not be profiled for some reason; I guess the appropriate reviewers will be able to make that call.
Assignee | ||
Comment 7•6 years ago
|
||
Thanks for the feedback Gerald. I guess I'll add for now the SetCurrentThreadName() calls and poke people around to see if we want to profile them
Assignee | ||
Comment 8•6 years ago
|
||
This patch adds thread names where they are missing
Assignee | ||
Comment 9•6 years ago
|
||
This first patch fixes most threads I see in GetProcInfo() via GDB/LLDB so we can interpret the numbers. I will do a separate patch into the NSPR project
Assignee | ||
Comment 10•6 years ago
•
|
||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
bugherder |
Description
•