Capture process priority in the profiler / add markers for priority changes
Categories
(Core :: Gecko Profiler, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: mstange, Assigned: mozbugz)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
We should capture process priority in the profiler, so that it's easier to find out why some processes don't get many samples. See bug 1646472.
Assignee | ||
Comment 1•4 years ago
|
||
I think that this should be fairly easy to capture:
I believe the priority is set in ProcessPriorityManager::SetProcessPriority()
, we'll need to store that somewhere.
The main difficulty is that it can change, in particular during shutdown, I'm not sure how to store that so the priority is known at every point in the profiling session window, and then how to display it in the front-end. 🤔
Possible back-end solution: When the priority is set, record a marker with the previous and current priorities; also store the current priority and output it somewhere when finally capturing the profile. This should be enough information to reconstruct the priority at any time, even when priority markers have fallen off the buffer.
It is also possible to change the priority of individual threads so we should probably capture that as well, right?
As an aside, I'm currently working on capturing CPU measurements (bug 1329600), so hopefully soon we'll know how much processes&threads have spent on the CPU, and on some system we can know the system idle time as well, and that may help a bit for profiles like those shared in bug 1646472.
Comment 2•3 years ago
|
||
hal::SetProcessPriority() is the actual method call that is used to set the priority. ParticularProcessPriorityManager::mPriority caches the current priority of each process. Also, the priority manager only deals with the main process and PContent processes, so other things like RDD won't be affected.
Assignee | ||
Comment 3•3 years ago
|
||
In the parent process, all sub-process priority changes are recorded, with the stack.
In child processes, the new priority is recorded when notified.
Also record priorities during profiler state changes. This is to ensure that we always have at least one record of the priority at the end of the profile, when old priority changes may have already been discarded.
Depends on D118128
Updated•3 years ago
|
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9b2ffc8e8505 Record priority change markers - r=canaltinova
Comment 5•3 years ago
|
||
bugherder |
Description
•