diff options
author | Duncan Coutts <duncan@well-typed.com> | 2012-02-06 12:22:18 +0000 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2012-04-04 19:10:44 +0100 |
commit | 65aaa9b2715c5245838123f3a0fa5d92e0a66bce (patch) | |
tree | c590a78588274f19285965d7b5cbd3b051a9329a /includes/rts | |
parent | cd930da1145a0d6094e5b5380034e80d002d5b9a (diff) | |
download | haskell-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 'includes/rts')
-rw-r--r-- | includes/rts/EventLogFormat.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h index afa1961a36..94f781dcb5 100644 --- a/includes/rts/EventLogFormat.h +++ b/includes/rts/EventLogFormat.h @@ -147,8 +147,18 @@ #define EVENT_CAP_DELETE 46 /* (cap) */ #define EVENT_CAP_DISABLE 47 /* (cap) */ #define EVENT_CAP_ENABLE 48 /* (cap) */ - -/* Range 49 - 59 is available for new GHC and common events */ +#define EVENT_HEAP_ALLOCATED 49 /* (heap_capset, alloc_bytes) */ +#define EVENT_HEAP_SIZE 50 /* (heap_capset, size_bytes) */ +#define EVENT_HEAP_LIVE 51 /* (heap_capset, live_bytes) */ +#define EVENT_HEAP_INFO_GHC 52 /* (heap_capset, n_generations, + max_heap_size, alloc_area_size, + mblock_size, block_size) */ +#define EVENT_GC_STATS_GHC 53 /* (heap_capset, generation, + copied_bytes, slop_bytes, frag_bytes, + par_n_threads, + par_max_copied, par_tot_copied) */ + +/* Range 54 - 59 is available for new GHC and common events */ /* Range 60 - 80 is used by eden for parallel tracing * see http://www.mathematik.uni-marburg.de/~eden/ @@ -161,7 +171,7 @@ * ranges higher than this are reserved but not currently emitted by ghc. * This must match the size of the EventDesc[] array in EventLog.c */ -#define NUM_GHC_EVENT_TAGS 49 +#define NUM_GHC_EVENT_TAGS 54 #if 0 /* DEPRECATED EVENTS: */ /* we don't actually need to record the thread, it's implicit */ |