Add CPU time usage to profiler
Categories
(Core :: Gecko Profiler, enhancement, P3)
Tracking
()
People
(Reporter: sinker, Assigned: mozbugz)
References
(Blocks 5 open bugs)
Details
Attachments
(4 files)
Updated•8 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
In bug 1621407, :snorp wrote:
AFAIK we currently only record real time with each sample. If we also recorded the CPU time (CLOCK_THREAD_CPUTIME_ID on Linux), we would know how long the thread was scheduled by the OS. This may help developers to spot thread or process priority problems.
And coincidentally I've been thinking about this recently, and also for Windows (with e.g., https://docs.microsoft.com/en-au/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreadtimes ), so I'm reviving this bug here, I'm hoping I'll have time later this year -- patches always welcome before that, of course!
Updated•5 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
The RunningTimes
class stores CPU measurements. It may seem overkill for only one value, but in the future more measurements will be added.
During sampling, CPU measurements are collected by platform-specific code. This patch doesn't produce anything yet, see later patches.
These are stored with the samples.
Note that for duplicated samples (when a thread is known to be "asleep"), we still need to collect new measurements, because there could potentially be some activity happening, e.g. in system calls.
Finally the measurements are output as extra "samples" values.
Units for these values may platform-specific, so they are stored in the top-level JSON "meta" object.
We don't collect running times in the Base Profiler (yet), but we still need to add the appropriate field names in the samples' "schema", as expected by profiler.firefox.com.
Depends on D99054
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D99413
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D99414
Assignee | ||
Comment 6•4 years ago
|
||
ThreadCPUCycles are in nanoseconds, ThreadKernel/UserTimes in milliseconds with 10ms precision only.
Depends on D99415
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b9ff676042a8
https://hg.mozilla.org/mozilla-central/rev/6fc163c0f438
https://hg.mozilla.org/mozilla-central/rev/86a42eeb5d85
https://hg.mozilla.org/mozilla-central/rev/c7e440ee02f8
Updated•4 years ago
|
Description
•