summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-22 14:21:01 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-03 04:41:33 -0400
commit7bfe9ac514e18c0b0e24ff55230fe98ec9db894c (patch)
tree1f0245a45d7146f9f95cae9e616a0923a8b2e988
parentfd7ea0fee92a60f9658254cc4fe3abdb4ff299b1 (diff)
downloadhaskell-7bfe9ac514e18c0b0e24ff55230fe98ec9db894c.tar.gz
rts: Enable tracing of nonmoving heap census with -ln
Previously this was not easily available to the user. Fix this. Non-moving collection lifecycle events are now reported with -lg.
-rw-r--r--docs/users_guide/runtime_control.rst4
-rw-r--r--rts/RtsFlags.c1
-rw-r--r--rts/sm/NonMoving.c4
3 files changed, 9 insertions, 0 deletions
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index f94c584690..2cf277176d 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -1161,6 +1161,10 @@ When the program is linked with the :ghc-flag:`-eventlog` option
- ``g`` — GC events, including GC start/stop. Enabled by default.
+ - ``n`` — non-moving garbage collector (see :rts-flag:`--nonmoving-gc`)
+ events including start and end of the concurrent mark and census
+ information to characterise heap fragmentation. Disabled by default.
+
- ``p`` — parallel sparks (sampled). Enabled by default.
- ``f`` — parallel sparks (fully accurate). Disabled by default.
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 5b594c915d..6180f42e39 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -382,6 +382,7 @@ usage_text[] = {
" where [flags] can contain:",
" s scheduler events",
" g GC and heap events",
+" n non-moving GC heap census events",
" p par spark events (sampled)",
" f par spark events (full detail)",
" u user events (emitted from Haskell code)",
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c
index a39b889c92..d230117b27 100644
--- a/rts/sm/NonMoving.c
+++ b/rts/sm/NonMoving.c
@@ -1125,6 +1125,10 @@ static void nonmovingMark_(MarkQueue *mark_queue, StgWeak **dead_weaks, StgTSO *
if (RtsFlags.DebugFlags.nonmoving_gc)
nonmovingPrintAllocatorCensus();
#endif
+#if defined(TRACING)
+ if (RtsFlags.TraceFlags.nonmoving_gc)
+ nonmovingTraceAllocatorCensus();
+#endif
// TODO: Remainder of things done by GarbageCollect (update stats)