Closed Bug 1431179 Opened 7 years ago Closed 7 years ago

Remove the limit of "exit profiles" that we hold on to

Categories

(Core :: Gecko Profiler, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

When a content process shuts down during profiling, we grab a profile from it and put into a list of "exit profiles". If somebody later grabs a profile on the parent process, those exit profiles are included among the subprocess profiles. The list of exit profiles is currently limited to a length of 5. We should remove that limit. But we should also make sure we discard old profiles as the leave the time range that's currently in the buffer for the parent process.
Attachment #8943378 - Flags: review?(mconley) → review?(nika)
Comment on attachment 8943378 [details] Bug 1431179 - Add profiler_get_buffer_start_time. https://reviewboard.mozilla.org/r/213704/#review219480 ::: tools/profiler/core/platform.cpp:2634 (Diff revision 1) > + Maybe<double> firstSampleTime = > + ActivePS::Buffer(lock).GetTimeOfFirstSampleInBuffer(); > + > + if (firstSampleTime) { > + return CorePS::ProcessStartTime() + > + TimeDuration::FromMilliseconds(*firstSampleTime); > + } TIL about Maybe<T>. Very nice!
Attachment #8943378 - Flags: review+
Attachment #8943378 - Flags: review?(nika) → review+
Comment on attachment 8943379 [details] Bug 1431179 - Keep all exit profiles that overlap with the parent process's buffer time range. https://reviewboard.mozilla.org/r/213706/#review219488 Looks good! Thanks!
Attachment #8943379 - Flags: review?(mconley) → review+
I've thought about this again and have come to the conclusion that I could achieve the same behavior without any TimeStamps, by looking at the buffer's read and write pos and its generation instead. I'll try that out tomorrow.
Attachment #8943378 - Attachment is obsolete: true
The new patches that I've attached here depend on the work in bug 1348959.
Depends on: 1348959
Comment on attachment 8945922 [details] Bug 1431179 - When storing an exit profile, remember the current write position of the parent process's profiler buffer, instead of a TimeStamp. https://reviewboard.mozilla.org/r/216004/#review222110 ::: tools/profiler/gecko/nsProfiler.cpp:553 (Diff revision 1) > void > nsProfiler::ReceiveShutdownProfile(const nsCString& aProfile) > { > MOZ_RELEASE_ASSERT(NS_IsMainThread()); > > - if (!profiler_is_active()) { > + Maybe<ProfilerBufferInfo> bufferInfo = profiler_get_buffer_info(); Ah, now I see why you made that method return a `Maybe<T>` ^.^ - scratch that earlier comment.
Attachment #8945922 - Flags: review?(nika) → review+
Comment on attachment 8945923 [details] Bug 1431179 - Remove the API to obtain the time of the first sample during profile streaming. https://reviewboard.mozilla.org/r/216006/#review222112 Yay deleting code~
Attachment #8945923 - Flags: review?(nika) → review+
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/255a28ff7195 When storing an exit profile, remember the current write position of the parent process's profiler buffer, instead of a TimeStamp. r=mystor https://hg.mozilla.org/integration/autoland/rev/ec0b493bf1bf Remove the API to obtain the time of the first sample during profile streaming. r=mystor https://hg.mozilla.org/integration/autoland/rev/8e6d2f2f7f30 Keep all exit profiles that overlap with the parent process's buffer time range. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: