Closed Bug 1301167 Opened 8 years ago Closed 8 years ago

Profiler needs a Wake API

Categories

(Core :: Gecko Profiler, defect)

defect
Not set
normal

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)

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.
This seems reasonable. Thanks Aaron.
Attached patch Add GeckoProfilerWakeRAII (obsolete) — Splinter Review
Assignee: nobody → aklotz
Status: NEW → ASSIGNED
Attachment #8789019 - Flags: review?(bgirard)
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+
Addressed comments. Carrying forward r+.
Attachment #8789019 - Attachment is obsolete: true
Attachment #8789027 - Flags: review+
Pushed by aklotz@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/218a0249ee4f Add a GeckoProfilerWakeRAII interface to the profiler; r=BenWa
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.

Attachment

General

Created:
Updated:
Size: