Closed
Bug 1240786
Opened 9 years ago
Closed 3 years ago
The BHR should be able to inject Timeline events
Categories
(Core :: Gecko Profiler, defect)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
People
(Reporter: Yoric, Unassigned)
References
Details
Attachments
(2 files)
We are attempting to find out whether BHR is behaving correctly (with strong suspicion that it's not). It would be useful if BHR was able to inject Timeline markers at the start/end of each period of suspected hang. This would help us investigate these periods using the profiler.
Reporter | ||
Comment 1•9 years ago
|
||
If I read TimelineMarker.h correctly, I think that this should not be too difficult, assuming that we don't need a stack.
Reporter | ||
Comment 2•9 years ago
|
||
Well, it looks like the main difficulty will be porting the code from PRIntervalTime to TimeStamp. Might take a little finesse.
Reporter | ||
Comment 3•9 years ago
|
||
BenWa, what's the best way to inject a profiler Timeline event from xpcom/? Something like that? https://dxr.mozilla.org/mozilla-central/source/xpcom/base/nsCycleCollector.cpp#2839
Flags: needinfo?(bgirard)
Comment 4•9 years ago
|
||
Call 'PROFILER_MARKER' form the thread that owns the timeline you want to post it on.
Flags: needinfo?(bgirard)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → dteller
Reporter | ||
Comment 5•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/31917/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31917/
Attachment #8710935 -
Flags: review?(ehsan)
Reporter | ||
Comment 6•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/31919/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/31919/
Attachment #8710936 -
Flags: review?(bgirard)
Reporter | ||
Comment 7•9 years ago
|
||
Comment on attachment 8710935 [details]
MozReview Request: Bug 1240786 - Converting BHR to TimeStamp/TimeDuration;r?ehsan
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/31917/diff/1-2/
Reporter | ||
Comment 8•9 years ago
|
||
Comment on attachment 8710936 [details]
MozReview Request: Bug 1240786 - Letting BHR inject timeline events;r?benwa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/31919/diff/1-2/
Reporter | ||
Comment 9•9 years ago
|
||
Comment on attachment 8710936 [details]
MozReview Request: Bug 1240786 - Letting BHR inject timeline events;r?benwa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/31919/diff/2-3/
Comment 10•9 years ago
|
||
Comment on attachment 8710936 [details]
MozReview Request: Bug 1240786 - Letting BHR inject timeline events;r?benwa
https://reviewboard.mozilla.org/r/31919/#review28745
r+ with the following super minor stuff fixed.
::: xpcom/threads/BackgroundHangMonitor.cpp:76
(Diff revision 3)
> + if (profiler_is_active()) {
You don't need profiler_is_active again here. If it's inactive the marker will just be free'ed.
::: xpcom/threads/BackgroundHangMonitor.cpp:455
(Diff revision 3)
> +#ifdef MOZ_ENABLE_PROFILER_SPS
You don't need an ifdef here. It's not saving a lot of work and with the stub implementation of the profiler you'll be fine.
the if() branch here is fine cause it will save a non trivial ammount of work when the profiler is inactive.
Attachment #8710936 -
Flags: review?(bgirard) → review+
Comment 11•9 years ago
|
||
TimelineMarker.h is used by the devtools performance/timeline.
PROFILER_MARKER calls add markers to the Gecko profiler add-on.
Yoric, which one exactly do you want to use?
Comment 12•9 years ago
|
||
Reporter | ||
Comment 13•9 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #11)
> TimelineMarker.h is used by the devtools performance/timeline.
>
> PROFILER_MARKER calls add markers to the Gecko profiler add-on.
>
> Yoric, which one exactly do you want to use?
Gecko Profiler.
Reporter | ||
Comment 14•9 years ago
|
||
BenWa, with these patches, I don't see my markers in Cleopatra, even though I have checked that the code is executed and the timestamps are correct. Am I forgetting something, either in code or in Cleopatra?
Flags: needinfo?(bgirard)
Comment 15•9 years ago
|
||
Comment on attachment 8710935 [details]
MozReview Request: Bug 1240786 - Converting BHR to TimeStamp/TimeDuration;r?ehsan
https://reviewboard.mozilla.org/r/31917/#review28773
Attachment #8710935 -
Flags: review?(ehsan) → review+
Comment 16•9 years ago
|
||
IRC: I think custom events might be filtered by default
IRC: most of them have their own custom presentation code in cleopatra
If you just want text marker then remove the payload. If you care about denoting the start/end point then you'll need to modify the cleopatra DOM to display the start/end in some way.
Flags: needinfo?(bgirard)
Reporter | ||
Comment 17•9 years ago
|
||
(In reply to Benoit Girard (:BenWa) from comment #16)
> If you just want text marker then remove the payload. If you care about
> denoting the start/end point then you'll need to modify the cleopatra DOM to
> display the start/end in some way.
I can't find a good entry point for this in Cleopatra. Who could give me a hand?
Flags: needinfo?(bgirard)
Reporter | ||
Comment 18•9 years ago
|
||
Comment on attachment 8710936 [details]
MozReview Request: Bug 1240786 - Letting BHR inject timeline events;r?benwa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/31919/diff/3-4/
Comment 19•9 years ago
|
||
Already answered this in: https://github.com/bgirard/Gecko-Profiler-Addon/issues/107#issuecomment-174421331
Flags: needinfo?(bgirard)
Reporter | ||
Comment 20•9 years ago
|
||
Too many communication channels involved here, we are losing messages.
As mentioned in https://github.com/bgirard/cleopatra/issues/66, it looks like my markers never actually make it to Cleopatra. Moreover, the C++ json serialization code in this patch is never triggered, which is weird. What am I missing?
Flags: needinfo?(bgirard)
Comment 21•9 years ago
|
||
I'm not sure? Make sure the marker is still in the circular buffer when you're saving the data.
Flags: needinfo?(bgirard)
Comment 23•9 years ago
|
||
set profiler.interval to 100
Then cause something to insert the marker and save the profile immediately.
Flags: needinfo?(bgirard)
Updated•4 years ago
|
Assignee: dteller → nobody
The profiler marker API has changed a lot since 2016, and I believe should work from almost anywhere, including BHR, if that's still needed now.
Please reopen/file if you do have issues.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•