NonmovingCensus: Emit samples to eventlog
[ghc.git] / rts / Trace.c
index 5dc428f..c7af521 100644 (file)
@@ -30,6 +30,7 @@
 // events
 int TRACE_sched;
 int TRACE_gc;
+int TRACE_nonmoving_gc;
 int TRACE_spark_sampled;
 int TRACE_spark_full;
 int TRACE_user;
@@ -72,6 +73,9 @@ void initTracing (void)
         RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS;
     }
 
+    TRACE_nonmoving_gc =
+        RtsFlags.TraceFlags.nonmoving_gc;
+
     TRACE_spark_sampled =
         RtsFlags.TraceFlags.sparks_sampled;
 
@@ -838,6 +842,12 @@ void traceConcUpdRemSetFlush(Capability *cap)
         postConcUpdRemSetFlush(cap);
 }
 
+void traceNonmovingHeapCensus(uint32_t log_blk_size,
+                              const struct NonmovingAllocCensus *census)
+{
+    if (eventlog_enabled && TRACE_nonmoving_gc)
+        postNonmovingHeapCensus(log_blk_size, census);
+}
 
 void traceThreadStatus_ (StgTSO *tso USED_IF_DEBUG)
 {