Bug 895019 - Tracelogger: Add logger for minor gc, r=jandem
authorHannes Verschore <hv1989@gmail.com>
Fri, 19 Jul 2013 10:41:32 -0700
changeset 151566 5bdc21ebbc1981fec83bef0e2fbc7e466eed151a
parent 151565 b817406485f8c5ee866ce16fa020fd5433b238e1
child 151567 6c6b968a895a5a3e74f438c44803503b239dd4e1
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs895019
milestone25.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 895019 - Tracelogger: Add logger for minor gc, r=jandem
js/src/TraceLogging.cpp
js/src/TraceLogging.h
js/src/jsgc.cpp
--- a/js/src/TraceLogging.cpp
+++ b/js/src/TraceLogging.cpp
@@ -65,16 +65,18 @@ const char* const TraceLogging::type_nam
     "start,script",
     "stop,script",
     "start,ion_compile",
     "stop,ion_compile",
     "start,yarr_jit_execute",
     "stop,yarr_jit_execute",
     "start,gc",
     "stop,gc",
+    "start,minor_gc",
+    "stop,minor_gc",
     "info,engine,interpreter",
     "info,engine,baseline",
     "info,engine,ionmonkey"
 };
 TraceLogging* TraceLogging::_defaultLogger = NULL;
 
 TraceLogging::TraceLogging()
   : loggingTime(0),
--- a/js/src/TraceLogging.h
+++ b/js/src/TraceLogging.h
@@ -18,16 +18,18 @@ class TraceLogging
         SCRIPT_START,
         SCRIPT_STOP,
         ION_COMPILE_START,
         ION_COMPILE_STOP,
         YARR_JIT_START,
         YARR_JIT_STOP,
         GC_START,
         GC_STOP,
+        MINOR_GC_START,
+        MINOR_GC_STOP,
         INFO_ENGINE_INTERPRETER,
         INFO_ENGINE_BASELINE,
         INFO_ENGINE_IONMONKEY,
         INFO
     };
 
   private:
     struct Entry {
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -4672,16 +4672,21 @@ JS::ShrinkGCBuffers(JSRuntime *rt)
     else
         rt->gcHelperThread.startBackgroundShrink();
 }
 
 void
 js::MinorGC(JSRuntime *rt, JS::gcreason::Reason reason)
 {
 #ifdef JSGC_GENERATIONAL
+#if JS_TRACE_LOGGING
+    AutoTraceLog logger(TraceLogging::defaultLogger(),
+                        TraceLogging::MINOR_GC_START,
+                        TraceLogging::MINOR_GC_STOP);
+#endif
     rt->gcNursery.collect(rt, reason);
 #endif
 }
 
 void
 js::gc::FinishBackgroundFinalize(JSRuntime *rt)
 {
     rt->gcHelperThread.waitBackgroundSweepEnd();