summaryrefslogtreecommitdiff
path: root/rts/eventlog
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-04-15 16:42:56 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-22 12:17:00 -0400
commit6f1731812331d4ddb4326fdfcefa095b867547e9 (patch)
treebc1fb4a5d0b41b98e50e38dcfea0c20748439ce6 /rts/eventlog
parent0d31819ed27f6763f5d253df0c1226d4c844e802 (diff)
downloadhaskell-6f1731812331d4ddb4326fdfcefa095b867547e9.tar.gz
NonmovingCensus: Emit samples to eventlogwip/gc/instrumentation
Diffstat (limited to 'rts/eventlog')
-rw-r--r--rts/eventlog/EventLog.c19
-rw-r--r--rts/eventlog/EventLog.h3
2 files changed, 21 insertions, 1 deletions
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index a9bb603523..8683ad9972 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -114,7 +114,8 @@ char *EventDesc[] = {
[EVENT_CONC_SYNC_END] = "End concurrent GC synchronisation",
[EVENT_CONC_SWEEP_BEGIN] = "Begin concurrent sweep",
[EVENT_CONC_SWEEP_END] = "End concurrent sweep",
- [EVENT_CONC_UPD_REM_SET_FLUSH] = "Update remembered set flushed"
+ [EVENT_CONC_UPD_REM_SET_FLUSH] = "Update remembered set flushed",
+ [EVENT_NONMOVING_HEAP_CENSUS] = "Nonmoving heap census"
};
// Event type.
@@ -470,6 +471,10 @@ init_event_types(void)
sizeof(EventCapNo);
break;
+ case EVENT_NONMOVING_HEAP_CENSUS: // (cap, blk_size, active_segs, filled_segs, live_blks)
+ eventTypes[t].size = 13;
+ break;
+
default:
continue; /* ignore deprecated events */
}
@@ -1182,6 +1187,18 @@ void postConcMarkEnd(StgWord32 marked_obj_count)
RELEASE_LOCK(&eventBufMutex);
}
+void postNonmovingHeapCensus(int log_blk_size,
+ const struct NonmovingAllocCensus *census)
+{
+ ACQUIRE_LOCK(&eventBufMutex);
+ postEventHeader(&eventBuf, EVENT_NONMOVING_HEAP_CENSUS);
+ postWord8(&eventBuf, log_blk_size);
+ postWord32(&eventBuf, census->n_active_segs);
+ postWord32(&eventBuf, census->n_filled_segs);
+ postWord32(&eventBuf, census->n_live_blocks);
+ RELEASE_LOCK(&eventBufMutex);
+}
+
void closeBlockMarker (EventsBuf *ebuf)
{
if (ebuf->marker)
diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h
index 16c7670cb3..0d439b836a 100644
--- a/rts/eventlog/EventLog.h
+++ b/rts/eventlog/EventLog.h
@@ -11,6 +11,7 @@
#include "rts/EventLogFormat.h"
#include "rts/EventLogWriter.h"
#include "Capability.h"
+#include "sm/NonMovingCensus.h"
#include "BeginPrivate.h"
@@ -162,6 +163,8 @@ void postHeapProfSampleCostCentre(StgWord8 profile_id,
void postConcUpdRemSetFlush(Capability *cap);
void postConcMarkEnd(StgWord32 marked_obj_count);
+void postNonmovingHeapCensus(int log_blk_size,
+ const struct NonmovingAllocCensus *census);
#else /* !TRACING */