summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2012-02-06 12:22:18 +0000
committerDuncan Coutts <duncan@well-typed.com>2012-04-04 19:10:44 +0100
commit65aaa9b2715c5245838123f3a0fa5d92e0a66bce (patch)
treec590a78588274f19285965d7b5cbd3b051a9329a /rts/sm
parentcd930da1145a0d6094e5b5380034e80d002d5b9a (diff)
downloadhaskell-65aaa9b2715c5245838123f3a0fa5d92e0a66bce.tar.gz
Add new eventlog events for various heap and GC statistics
They cover much the same info as is available via the GHC.Stats module or via the '+RTS -s' textual output, but via the eventlog and with a better sampling frequency. We have three new generic heap info events and two very GHC-specific ones. (The hope is the general ones are usable by other implementations that use the same eventlog system, or indeed not so sensitive to changes in GHC itself.) The general ones are: * total heap mem allocated since prog start, on a per-HEC basis * current size of the heap (MBlocks reserved from OS for the heap) * current size of live data in the heap Currently these are all emitted by GHC at GC time (live data only at major GC). The GHC specific ones are: * an event giving various static heap paramaters: * number of generations (usually 2) * max size if any * nursary size * MBlock and block sizes * a event emitted on each GC containing: * GC generation (usually just 0,1) * total bytes copied * bytes lost to heap slop and fragmentation * the number of threads in the parallel GC (1 for serial) * the maximum number of bytes copied by any par GC thread * the total number of bytes copied by all par GC threads (these last three can be used to calculate an estimate of the work balance in parallel GCs)
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/GC.c6
-rw-r--r--rts/sm/Storage.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 8201a24e5b..055a1363ed 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -738,9 +738,9 @@ GarbageCollect (rtsBool force_major_gc,
#endif
// ok, GC over: tell the stats department what happened.
- stat_endGC(gct, allocated, live_words,
- copied, N, par_max_copied, par_tot_copied,
- live_blocks * BLOCK_SIZE_W - live_words /* slop */);
+ stat_endGC(cap, gct, allocated, live_words, copied,
+ live_blocks * BLOCK_SIZE_W - live_words /* slop */,
+ N, n_gc_threads, par_max_copied, par_tot_copied);
// Guess which generation we'll collect *next* time
initialise_N(force_major_gc);
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 59ad231f34..4cd1bc99c9 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -186,6 +186,13 @@ initStorage (void)
IF_DEBUG(gc, statDescribeGens());
RELEASE_SM_LOCK;
+
+ traceEventHeapInfo(CAPSET_HEAP_DEFAULT,
+ RtsFlags.GcFlags.generations,
+ RtsFlags.GcFlags.maxHeapSize * BLOCK_SIZE_W * sizeof(W_),
+ RtsFlags.GcFlags.minAllocAreaSize * BLOCK_SIZE_W * sizeof(W_),
+ MBLOCK_SIZE_W * sizeof(W_),
+ BLOCK_SIZE_W * sizeof(W_));
}
void storageAddCapabilities (nat from, nat to)