Bug 1322758 - Stop decrementing ProfileGatherer counter when receiving an exit profile. r?mstange draft
authorMike Conley <mconley@mozilla.com>
Fri, 09 Dec 2016 18:05:45 -0500
changeset 448335 1768d586874c92ea80f7cc818f9f5d6bd56fe1e5
parent 446527 3853c539a1b7c803f1075d2c3ecefbdd314af1d8
child 539272 b87876424669c0862d1713d1e538fd180d196fb7
push id38324
push usermconley@mozilla.com
push dateFri, 09 Dec 2016 23:09:48 +0000
reviewersmstange
bugs1322758
milestone53.0a1
Bug 1322758 - Stop decrementing ProfileGatherer counter when receiving an exit profile. r?mstange For some reason, we were decrementing the ProfileGatherer's mPendingProfiles when receiving an "exit profile". An exit profile is handed over by a subprocess parent actor, but in order to have that exit profile, the content process _must_ have sent it up to the parent already, and that means that the counter had alreay been decremented on its receipt. This means that if the subprocess parent actor exited, it'd decrement the counter twice, which means that we open ourselves up for missing out on profiles that haven't yet reached the parent. I can't think of a good reason why we'd want to decrement the counter when storing an exit profile, so I've just removed that bit. MozReview-Commit-ID: 8jSqtpYbXh0
tools/profiler/gecko/ProfileGatherer.cpp
--- a/tools/profiler/gecko/ProfileGatherer.cpp
+++ b/tools/profiler/gecko/ProfileGatherer.cpp
@@ -230,22 +230,16 @@ ProfileGatherer::Cancel()
 
 void
 ProfileGatherer::OOPExitProfile(const nsCString& aProfile)
 {
   if (mExitProfiles.Length() >= MAX_SUBPROCESS_EXIT_PROFILES) {
     mExitProfiles.RemoveElementAt(0);
   }
   mExitProfiles.AppendElement(aProfile);
-
-  // If a process exited while gathering, we need to make
-  // sure we decrement the counter.
-  if (mGathering) {
-    GatheredOOPProfile();
-  }
 }
 
 NS_IMETHODIMP
 ProfileGatherer::Observe(nsISupports* aSubject,
                          const char* aTopic,
                          const char16_t *someData)
 {
   if (!strcmp(aTopic, "profiler-subprocess")) {