nonmoving: Trace GC preparation steps
authorBen Gamari <ben@smart-cactus.org>
Thu, 1 Aug 2019 01:05:11 +0000 (21:05 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 22 Oct 2019 22:57:27 +0000 (18:57 -0400)
rts/sm/NonMoving.c

index 9a6db9b..518b06b 100644 (file)
@@ -819,6 +819,7 @@ void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads)
     }
 #endif
 
+    trace(TRACE_nonmoving_gc, "Starting nonmoving GC preparation");
     resizeGenerations();
 
     nonmovingPrepareMark();
@@ -834,6 +835,7 @@ void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads)
     current_mark_queue = mark_queue;
 
     // Mark roots
+    trace(TRACE_nonmoving_gc, "Marking roots for nonmoving GC");
     markCAFs((evac_fn)markQueueAddRoot, mark_queue);
     for (unsigned int n = 0; n < n_capabilities; ++n) {
         markCapability((evac_fn)markQueueAddRoot, mark_queue,
@@ -847,6 +849,7 @@ void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads)
     for (StgTSO *tso = *resurrected_threads; tso != END_TSO_QUEUE; tso = tso->global_link) {
         markQueuePushClosure_(mark_queue, (StgClosure*)tso);
     }
+    trace(TRACE_nonmoving_gc, "Finished marking roots for nonmoving GC");
 
     // Roots marked, mark threads and weak pointers
 
@@ -869,6 +872,7 @@ void nonmovingCollect(StgWeak **dead_weaks, StgTSO **resurrected_threads)
     ASSERT(nonmoving_old_weak_ptr_list == NULL);
     nonmoving_old_weak_ptr_list = oldest_gen->weak_ptr_list;
     oldest_gen->weak_ptr_list = NULL;
+    trace(TRACE_nonmoving_gc, "Finished nonmoving GC preparation");
 
     // We are now safe to start concurrent marking