summaryrefslogtreecommitdiff
path: root/rts/Stats.c
diff options
context:
space:
mode:
authorMikolaj <mikolaj.konarski@gmail.com>2012-03-09 20:51:30 +0100
committerDuncan Coutts <duncan@well-typed.com>2012-04-04 19:10:45 +0100
commitc294d95dc04950ab4c5380bf6ce8651f621f8591 (patch)
treef7af5643c634205fa9fc390c0dd4db7558b7f7e2 /rts/Stats.c
parent598109eb0cc2271c33e23b4ddb12123991273f61 (diff)
downloadhaskell-c294d95dc04950ab4c5380bf6ce8651f621f8591.tar.gz
Add the GC_GLOBAL_SYNC event marking that all caps are stopped for GC
Quoting design rationale by dcoutts: The event indicates that we're doing a stop-the-world GC and all other HECs should be between their GC_START and GC_END events at that moment. We don't want to use GC_STATS_GHC for that, because GC_STATS_GHC is for extra GHC-specific info, not something we have to rely on to be able to match the GC pauses across HECs to a particular global GC.
Diffstat (limited to 'rts/Stats.c')
-rw-r--r--rts/Stats.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rts/Stats.c b/rts/Stats.c
index ddc9bb96ae..cebb75343f 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -349,6 +349,13 @@ stat_endGC (Capability *cap, gc_thread *gct,
{
Time cpu, elapsed, gc_cpu, gc_elapsed;
+ // Has to be emitted while all caps stopped for GC, but before GC_END.
+ // See trac.haskell.org/ThreadScope/wiki/RTSsummaryEvents
+ // for a detailed design rationale of the current setup
+ // of GC eventlog events.
+ traceEventGcGlobalSync(cap);
+
+ // Emitted before GC_END on all caps, which simplifies tools code.
traceEventGcStats(cap,
CAPSET_HEAP_DEFAULT,
gen,
@@ -360,7 +367,7 @@ stat_endGC (Capability *cap, gc_thread *gct,
par_n_threads,
par_max_copied * sizeof(W_),
par_tot_copied * sizeof(W_));
-
+
getProcessTimes(&cpu, &elapsed);
// Post EVENT_GC_END with the same timestamp as used for stats