Commit b0a51443 authored by niteria's avatar niteria

Add mblocks_allocated to GC stats API

This exposes mblocks_allocated in the GCStats struct.

Test Plan: it builds

Reviewers: bgamari, simonmar, austin, hvr, erikd

Reviewed By: erikd

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2429
parent 8f63ba30
......@@ -237,6 +237,7 @@ typedef struct _GCStats {
StgWord64 current_bytes_slop;
StgWord64 max_bytes_slop;
StgWord64 peak_megabytes_allocated;
StgWord64 mblocks_allocated;
StgWord64 par_tot_bytes_copied;
StgWord64 par_max_bytes_copied;
StgDouble mutator_cpu_seconds;
......
......@@ -72,6 +72,7 @@ data GCStats = GCStats
, peakMegabytesAllocated :: !Int64
-- | CPU time spent running mutator threads. This does not include
-- any profiling overhead or initialization.
, mblocksAllocated :: !Int64 -- ^ Number of allocated megablocks
, mutatorCpuSeconds :: !Double
-- | Wall clock time spent running mutator threads. This does not
......@@ -131,6 +132,7 @@ getGCStats = do
currentBytesSlop <- (# peek GCStats, current_bytes_slop) p
maxBytesSlop <- (# peek GCStats, max_bytes_slop) p
peakMegabytesAllocated <- (# peek GCStats, peak_megabytes_allocated ) p
mblocksAllocated <- (# peek GCStats, mblocks_allocated) p
{-
initCpuSeconds <- (# peek GCStats, init_cpu_seconds) p
initWallSeconds <- (# peek GCStats, init_wall_seconds) p
......
......@@ -883,6 +883,7 @@ extern void getGCStats( GCStats *s )
s->max_bytes_used = max_residency*sizeof(W_);
s->cumulative_bytes_used = cumulative_residency*(StgWord64)sizeof(W_);
s->peak_megabytes_allocated = (StgWord64)(peak_mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L));
s->mblocks_allocated = (StgWord64)mblocks_allocated;
s->bytes_copied = GC_tot_copied*(StgWord64)sizeof(W_);
s->max_bytes_slop = max_slop*(StgWord64)sizeof(W_);
s->current_bytes_used = current_residency*(StgWord64)sizeof(W_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment