Closed
Bug 1193838
Opened 9 years ago
Closed 9 years ago
Make it possible to gather profiles from processes that have exited
Categories
(Core :: Gecko Profiler, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: mconley, Assigned: mconley)
References
(Blocks 1 open bug)
Details
Attachments
(4 files, 4 obsolete files)
While profiling, when a subprocess exits before the parent process requests the profiles, we lose the profile data from that subprocess.
The subprocess should cough up its performance profile data before it exists if it detects that the parent is currently profiling.
Updated•9 years ago
|
Assignee | ||
Comment 1•9 years ago
|
||
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Assignee | ||
Comment 2•9 years ago
|
||
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler. r?BenWa
Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Assignee | ||
Updated•9 years ago
|
Attachment #8648745 -
Attachment description: MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler. r?BenWa → MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa
We need to let ContentParent and PluginModuleParent get a reference to the ProfileGatherer
during the window of time that we're profiling so that if they start to die (the actor is
starting to go away), they have a gatherer they can send their last profile data to.
Assignee | ||
Comment 5•9 years ago
|
||
Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r?BenWa
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa
We need to let ContentParent and PluginModuleParent get a reference to the ProfileGatherer
during the window of time that we're profiling so that if they start to die (the actor is
starting to go away), they have a gatherer they can send their last profile data to.
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r?BenWa
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa
We need to let ContentParent and PluginModuleParent get a reference to the ProfileGatherer
during the window of time that we're profiling so that if they start to die (the actor is
starting to go away), they have a gatherer they can send their last profile data to.
Assignee | ||
Comment 11•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r?BenWa
Assignee | ||
Comment 13•9 years ago
|
||
Bug 1103094 - Add accessor for nsIProfilerStartParams to nsIProfiler. r?BenWa
Assignee | ||
Comment 14•9 years ago
|
||
Bug 1103094 - Start profiling subprocesses if the parent process is already profiling. r?BenWa
Assignee | ||
Comment 15•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Assignee | ||
Comment 16•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa
We need to let ContentParent and PluginModuleParent get a reference to the ProfileGatherer
during the window of time that we're profiling so that if they start to die (the actor is
starting to go away), they have a gatherer they can send their last profile data to.
Assignee | ||
Comment 17•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r?BenWa
Assignee | ||
Comment 18•9 years ago
|
||
Add some instrumentation and logging
Assignee | ||
Comment 19•9 years ago
|
||
Make talos use async profile dumping stuff
Assignee | ||
Comment 20•9 years ago
|
||
kats - I've rebased this patch off of central in case any of this WIP is useful to you.
Comment 21•9 years ago
|
||
Thanks! I'll do a push to try and hope it works :)
Assignee | ||
Comment 22•9 years ago
|
||
Comment on attachment 8669892 [details]
MozReview Request: Bug 1103094 - Add accessor for nsIProfilerStartParams to nsIProfiler. r?BenWa
Bug 1103094 - Add accessor for nsIProfilerStartParams to nsIProfiler. r?BenWa
Assignee | ||
Comment 23•9 years ago
|
||
Comment on attachment 8669893 [details]
MozReview Request: Bug 1103094 - Start profiling subprocesses if the parent process is already profiling. r?BenWa
Bug 1103094 - Start profiling subprocesses if the parent process is already profiling. r?BenWa
Assignee | ||
Comment 24•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Assignee | ||
Comment 25•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa
We need to let ContentParent and PluginModuleParent get a reference to the ProfileGatherer
during the window of time that we're profiling so that if they start to die (the actor is
starting to go away), they have a gatherer they can send their last profile data to.
Assignee | ||
Comment 26•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r?BenWa
Assignee | ||
Comment 27•9 years ago
|
||
Comment on attachment 8669894 [details]
MozReview Request: Add some instrumentation and logging
Add some instrumentation and logging
Assignee | ||
Comment 28•9 years ago
|
||
Comment on attachment 8669895 [details]
MozReview Request: Make talos use async profile dumping stuff
Make talos use async profile dumping stuff
Updated•9 years ago
|
Priority: -- → P1
Assignee | ||
Updated•9 years ago
|
Attachment #8648744 -
Flags: review?(bgirard)
Assignee | ||
Comment 29•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/16277/diff/6-7/
Assignee | ||
Updated•9 years ago
|
Attachment #8648745 -
Flags: review?(bgirard)
Assignee | ||
Comment 30•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/16279/diff/6-7/
Assignee | ||
Updated•9 years ago
|
Attachment #8649513 -
Flags: review?(bgirard)
Assignee | ||
Comment 31•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/16417/diff/5-6/
Assignee | ||
Updated•9 years ago
|
Attachment #8669892 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8669893 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8669894 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8669895 -
Attachment is obsolete: true
Updated•9 years ago
|
Attachment #8648744 -
Flags: review?(bgirard)
Comment 32•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
https://reviewboard.mozilla.org/r/16277/#review23801
::: tools/profiler/core/GeckoSampler.cpp:251
(Diff revision 7)
> + mGatherer = new mozilla::ProfileGatherer(this);
This grabs a pointer to this non-reference counted and the ProfileGatherer can live longer than the GeckoSampler.
We've talked about a few solutions to this in person. We should fix this before landing this patch.
Comment 33•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
https://reviewboard.mozilla.org/r/16417/#review23803
::: tools/profiler/gecko/ProfileGatherer.cpp:146
(Diff revision 6)
> + if (mExitProfiles.Length() >= 5) {
We're keeping up to 5 child process profiles? I'm not sure how I feel about this magic number but it doesn't seem like it's useless either. Perhaps we should explictly document what the intension of this is.
::: tools/profiler/gecko/ProfileGatherer.cpp:150
(Diff revision 6)
> + profileEntry = aProfile;
Can't we just mExistProfiles.AppendElement(aProfile) here?
Attachment #8649513 -
Flags: review?(bgirard) → review+
Comment 34•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
https://reviewboard.mozilla.org/r/16279/#review23807
Looks good once the lifetime issue is resolved.
Attachment #8648745 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 35•9 years ago
|
||
(In reply to Benoit Girard (:BenWa) from comment #32)
> Comment on attachment 8648744 [details]
> MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the
> lifetime of a GeckoSampler. r?BenWa
>
> https://reviewboard.mozilla.org/r/16277/#review23801
>
> ::: tools/profiler/core/GeckoSampler.cpp:251
> (Diff revision 7)
> > + mGatherer = new mozilla::ProfileGatherer(this);
>
> This grabs a pointer to this non-reference counted and the ProfileGatherer
> can live longer than the GeckoSampler.
Yeah, this is a problem. Good catch!
>
> We've talked about a few solutions to this in person. We should fix this
> before landing this patch.
Okay, here's the solution I've been thinking about:
1. Combine GeckoSampler and ProfileGatherer
2. Have GeckoSampler+ProfileGatherer be refcounted
3. Continue to offer the ProfileGatherer interface to PluginModuleParent and ContentParent, which will inc the refcount on GeckoSampler+ProfileGatherer.
4. On stopping the profiler, instead of directly deleting the GeckoSampler, have platform.cpp just drop the reference to it.
5. If an async profile gathering is still in progress, have PluginModuleParent and ContentParent ignore any profile start/stop/gather observer notifications from the profiler.
6. Once an async profile gathering is complete, have the PluginModuleParent and ContentParent check whether or not we're still profiling. If not, stop and drop the old reference to the gatherer. If still profiling, get a reference to the current GeckoSampler+ProfileGatherer and overwrite mGatherer with it (this might be the same reference, but if we've stopped and restarted the sampler while waiting for the profile to be gathered, it won't).
The consequence of this is that subprocesses that are still in the midst of sending up their profiles to the parent will not hear or obey stop/start/gather commands until the profile has finished gathering.
Does that sound like an acceptable plan?
Flags: needinfo?(bgirard)
Comment 36•9 years ago
|
||
I think it's fine like I said over lunch. It's not ideal but if it's the easiest way forward then it's worth the issues with ignoring/delaying stop/start/gather while we're gathering a profile.
Maybe we should just reject the promise if this happens? It would require a large internal change and it should still be very rare that it would happen.
Flags: needinfo?(bgirard)
Assignee | ||
Comment 37•9 years ago
|
||
(In reply to Benoit Girard (:BenWa) from comment #36)
> I think it's fine like I said over lunch. It's not ideal but if it's the
> easiest way forward then it's worth the issues with ignoring/delaying
> stop/start/gather while we're gathering a profile.
>
> Maybe we should just reject the promise if this happens? It would require a
> large internal change and it should still be very rare that it would happen.
Yeah, we could do the work I'm suggesting in comment 35 in a follow-up, and just reject for now.
Assignee | ||
Comment 38•9 years ago
|
||
https://reviewboard.mozilla.org/r/16277/#review23801
> This grabs a pointer to this non-reference counted and the ProfileGatherer can live longer than the GeckoSampler.
>
> We've talked about a few solutions to this in person. We should fix this before landing this patch.
The GeckoSampler now called Cancel on the ProfileGatherer which will reject the Promise and drop the reference to the GeckoSampler.
Assignee | ||
Comment 39•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/16277/diff/7-8/
Attachment #8648744 -
Flags: review?(bgirard)
Assignee | ||
Comment 40•9 years ago
|
||
Comment on attachment 8648745 [details]
MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/16279/diff/7-8/
Attachment #8648745 -
Attachment description: MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r?BenWa → MozReview Request: Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
Assignee | ||
Comment 41•9 years ago
|
||
Comment on attachment 8649513 [details]
MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/16417/diff/6-7/
Attachment #8649513 -
Attachment description: MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r?BenWa → MozReview Request: Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Assignee | ||
Comment 42•9 years ago
|
||
Also filed bug 1229441 to do the work described in comment 35.
Comment 43•9 years ago
|
||
Comment on attachment 8648744 [details]
MozReview Request: Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r?BenWa
https://reviewboard.mozilla.org/r/16277/#review24371
Attachment #8648744 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 44•9 years ago
|
||
Assignee | ||
Comment 45•9 years ago
|
||
Assignee | ||
Comment 46•9 years ago
|
||
Assignee | ||
Comment 47•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e2dd0eb33623301166c1eeb6e5c0113456af467c
Bug 1193838 - Make ProfileGatherer exist during the lifetime of a GeckoSampler. r=BenWa
https://hg.mozilla.org/integration/mozilla-inbound/rev/76da1f09f4ee8597d96565270c0e4cf6bcdd48d2
Bug 1193838 - Expose ProfileGatherer as an nsISupports through nsIProfiler for process parent actors. r=BenWa
https://hg.mozilla.org/integration/mozilla-inbound/rev/479e586e1a7fb017fcc2522a8b33ad386582762c
Bug 1193838 - Allow ProfileGatherer to gather profiles from exiting processes. r=BenWa
Comment 48•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e2dd0eb33623
https://hg.mozilla.org/mozilla-central/rev/76da1f09f4ee
https://hg.mozilla.org/mozilla-central/rev/479e586e1a7f
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Assignee | ||
Comment 49•8 years ago
|
||
bugnotes |
You need to log in
before you can comment on or make changes to this bug.
Description
•