Bug 1300834. GC slice logging should say what process the slice is for. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 07 Sep 2016 14:21:36 -0400
changeset 313032 ff96cb069ef2ca380d679b9b9a7dd2f7d4919d2e
parent 313031 ebe49166a751e564fc75a080fc25c4433266c52e
child 313033 8edc64f3a6e40c5f8aa67ed2255c49a4a1a2a386
push id81524
push userbzbarsky@mozilla.com
push dateWed, 07 Sep 2016 18:21:59 +0000
treeherdermozilla-inbound@8edc64f3a6e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1300834
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1300834. GC slice logging should say what process the slice is for. r=smaug
dom/base/nsJSEnvironment.cpp
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2181,21 +2181,25 @@ DOMGCSliceCallback(JSContext* aCx, JS::G
                                                       "InterSliceGCTimerFired");
       }
 
       if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
         nsCycleCollector_dispatchDeferredDeletion();
       }
 
       if (sPostGCEventsToConsole) {
-        nsString gcstats;
+        NS_NAMED_LITERAL_STRING(kFmt, "[%s] ");
+        nsString prefix, gcstats;
         gcstats.Adopt(aDesc.formatSliceMessage(aCx));
+        prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(),
+                                               ProcessNameForCollectorLog()));
+        nsString msg = prefix + gcstats;
         nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
         if (cs) {
-          cs->LogStringMessage(gcstats.get());
+          cs->LogStringMessage(msg.get());
         }
       }
 
       break;
 
     default:
       MOZ_CRASH("Unexpected GCProgress value");
   }