Add off-main thread IO Marker support to Gecko profiles
Categories
(Core :: Gecko Profiler, enhancement, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox78 | --- | fixed |
People
(Reporter: jesup, Assigned: mozbugz)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(9 files, 4 obsolete files)
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
| Reporter | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Comment 2•7 years ago
|
||
Comment 4•6 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #0)
We may also want stacks for the captures, though that's less
interesting due to most IO being proxied.
The stack is very useful for mainthread I/O. I would assume it's less relevant when the I/O is done off main thread.
Will these new IO markers replace the existing mainthreadio markers we have from https://searchfox.org/mozilla-central/source/tools/profiler/gecko/ProfilerIOInterposeObserver.cpp ?
| Reporter | ||
Comment 5•6 years ago
|
||
| Reporter | ||
Comment 6•6 years ago
|
||
| Reporter | ||
Comment 7•6 years ago
|
||
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Comment 8•6 years ago
|
||
It at least builds with the current version of those patches
| Reporter | ||
Updated•6 years ago
|
Comment 9•6 years ago
|
||
I took a stab at measuring the cost of capturing stacks. This was on a newer macbook.
The summary is:
Average: 17.17μs per stack
Median: 15.66μs per stack
Min: 10.31μs per stack
Max: 27.12μs per stack
Test runs: 73 for loops, with 1000 payloads each
Total payloads: 73000 payloads
Some raw runs looks like this:
!!! Generate 1000 markers with stack 20648μs
!!! Generate 1000 markers without stack 645μs
!!! Time per stack 20.002509μs
!!! Percentage difference 3197%
!!! Generate 1000 markers with stack 21864μs
!!! Generate 1000 markers without stack 643μs
!!! Time per stack 21.220645μs
!!! Percentage difference 3395%
!!! Generate 1000 markers with stack 22300μs
!!! Generate 1000 markers without stack 821μs
!!! Time per stack 21.479177μs
!!! Percentage difference 2715%
!!! Generate 1000 markers with stack 22821μs
!!! Generate 1000 markers without stack 656μs
!!! Time per stack 22.165099μs
!!! Percentage difference 3476%```
My methodology was to emit 1000 markers with stacks, and 1000 without for every UserTiming payload. I then visited cnn.com and observed the console spew.
https://gist.github.com/gregtatum/7b997816f7efcc7aefaf201d80d8f25a
Updated•6 years ago
|
Comment 10•6 years ago
|
||
:jesup What's the status of your existing work? Do you mind if I take this over? I'm actively working on surfacing this information in the profiler front-end right now. Specifically I'm looking at re-using the existing payloads we have, and here only surfacing the off the main thread io information.
| Reporter | ||
Comment 11•6 years ago
|
||
(In reply to Greg Tatum [:gregtatum] from comment #10)
:jesup What's the status of your existing work? Do you mind if I take this over? I'm actively working on surfacing this information in the profiler front-end right now. Specifically I'm looking at re-using the existing payloads we have, and here only surfacing the off the main thread io information.
You absolutely can take it over... however I really would want to have IO information from any captured thread - anyone doing perf work on a subsystem that does it's IO off-main-thread needs that (and we want all IO off the main thread).
If you don't mind modifying an existing payload, you could add fields to IOMarker. The FileIOMarkers I made would let you untangle what IO is for what file; how much data was read/written, etc.
Updated•6 years ago
|
Comment 12•6 years ago
|
||
I filed Bug 1527340 for the payload, this bug will focus only on surfacing non-main thread io.
Comment 13•6 years ago
|
||
I'm taking myself of assignment here, and marking as P2, since I'm not planning on actively working on it at the moment.
| Assignee | ||
Comment 14•5 years ago
|
||
3rd owner's the charm? 😅
I have started my own WIP independently from :jesup's (I had not noticed this bug then), I'll see if I can steal some ideas and/or code...
| Assignee | ||
Comment 15•5 years ago
|
||
Made StaticBaseProfilerStats a proper class, with more explicit types for measurements and printfs.
Also added the maximum duration in a set, which can be useful to see what the worst case of some code may be.
(Reminder: This code is not built by default, uncomment # define PROFILER_RUNTIME_STATS above to enable it.)
| Assignee | ||
Comment 16•5 years ago
|
||
Depends on D75758
| Assignee | ||
Comment 17•5 years ago
|
||
Some markers may be more useful when gathered into a single track, and the main thread is ideal because it's always present.
Depends on D75759
| Assignee | ||
Comment 18•5 years ago
|
||
The FileIO marker may be recorded into the main thread, so we need to keep track of the thread in which the IO really happened (which may be a thread that's not even selected for profiling).
Depends on D75760
| Assignee | ||
Comment 19•5 years ago
|
||
Depends on D75761
| Assignee | ||
Comment 20•5 years ago
|
||
Depends on D75762
| Assignee | ||
Comment 21•5 years ago
|
||
In addition to the existing "mainthreadio" feature, we now have:
- "fileio" to capture file I/O from other profiled threads.
- "fileioall" to also capture file I/O from all threads (even unregistered threads).
- "iostacks" to capture stack traces with any "io" marker.
These are off by default, except forMOZ_PROFILER_STARTUP=1profiling where they are on by default.
Depends on D75763
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 22•5 years ago
|
||
Some functions may want to examine more than one feature at once, these function return everything (if the profiler is active, and optionally unpaused) so that only one call is needed.
Depends on D75763
| Assignee | ||
Comment 23•5 years ago
|
||
This can be used while the profiler is running, to know if the current thread is registered -- regardless of whether it is actively profiled.
This will help distinguish registered but non-profiled threads from threads that are not even registered (e.g., OS-generated threads).
Depends on D76280
Comment 24•5 years ago
|
||
Comment 25•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/f863906be04e
https://hg.mozilla.org/mozilla-central/rev/339892cd9819
https://hg.mozilla.org/mozilla-central/rev/e9840189646f
https://hg.mozilla.org/mozilla-central/rev/5eea77f70d79
https://hg.mozilla.org/mozilla-central/rev/24bb053826c4
https://hg.mozilla.org/mozilla-central/rev/4951d6f0c780
https://hg.mozilla.org/mozilla-central/rev/cda20d08c55f
https://hg.mozilla.org/mozilla-central/rev/fec31ffa35bd
https://hg.mozilla.org/mozilla-central/rev/5d723af3382f
Description
•