Closed
Bug 1301167
Opened 8 years ago
Closed 8 years ago
Profiler needs a Wake API
Categories
(Core :: Gecko Profiler, defect)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
5.64 KB,
patch
|
bugzilla
:
review+
|
Details | Diff | Splinter Review |
Bug 1273635 makes it possible for the Windows wait functions to be interrupted by Asynchronous Procedure Calls (APCs). These essentially work like signals.
This impacts the profiler because there is a GeckoProfilerSleepRAII on the stack, thus the profiler will ignore anything that executes in these APCs.
I'd like to add a GeckoProfilerWakeRAII that can be instantiated in the APC so that the profiler is woken up as necessary.
Note that this bug is important in order to be able to profile a11y code under Windows e10s.
Comment 1•8 years ago
|
||
This seems reasonable. Thanks Aaron.
Assignee | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Comment on attachment 8789019 [details] [diff] [review]
Add GeckoProfilerWakeRAII
Review of attachment 8789019 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with a few small suggestions to improve the patch.
::: tools/profiler/public/GeckoProfiler.h
@@ +271,5 @@
> profiler_sleep_end();
> }
> };
>
> +class GeckoProfilerWakeRAII {
Let's add a block comment here. At first glance it seems like this RAII should be used when the profiler is awake in the global state but it's only meant for a special temporary wake ups. Perhaps something like:
/**
* Temporarily wake up the profiler while servicing events such as
* Asynchronous Procedure Calls (APCs).
*/
Feel free to adjust.
@@ +272,5 @@
> }
> };
>
> +class GeckoProfilerWakeRAII {
> +public:
Also this class should be MOZ_RAII. Which the other classes don't do properly either. IIRC MOZ_RAII will prevent you accidentally making your RAII a temporary and therefore useless.
@@ +282,5 @@
> + }
> + }
> + ~GeckoProfilerWakeRAII() {
> + if (mIssuedWake) {
> + profiler_sleep_start();
MOZ_ASSERT(!profiler_is_sleeping()) before line 286. Let's just make sure we're not in an unexpected state.
Attachment #8789019 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Addressed comments. Carrying forward r+.
Attachment #8789019 -
Attachment is obsolete: true
Attachment #8789027 -
Flags: review+
Assignee | ||
Comment 5•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/218a0249ee4fb13af3b620ec83fcf04e02bdf14c
Bug 1301167: Add a GeckoProfilerWakeRAII interface to the profiler; r=BenWa
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/218a0249ee4f
Add a GeckoProfilerWakeRAII interface to the profiler; r=BenWa
Comment 7•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•