diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-07-02 10:38:13 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-17 19:21:10 -0400 |
commit | ae4415b9487d24942aa0e91052d4b897a3cf2f2e (patch) | |
tree | 7114c5e3418cf480339f69313f8960adeb12e05a /rts/eventlog | |
parent | 7915afc6bb9539a4534db99aeb6616a6d145918a (diff) | |
download | haskell-ae4415b9487d24942aa0e91052d4b897a3cf2f2e.tar.gz |
eventlog: Add biographical and retainer profiling traces
This patch adds a new eventlog event which indicates the start of
a biographical profiler sample. These are different to normal events as
they also include the timestamp of when the census took place. This is
because the LDV profiler only emits samples at the end of the run.
Now all the different profiling modes emit consumable events to the
eventlog.
Diffstat (limited to 'rts/eventlog')
-rw-r--r-- | rts/eventlog/EventLog.c | 16 | ||||
-rw-r--r-- | rts/eventlog/EventLog.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c index 0651de268c..5c6a1ca48a 100644 --- a/rts/eventlog/EventLog.c +++ b/rts/eventlog/EventLog.c @@ -103,6 +103,7 @@ char *EventDesc[] = { [EVENT_HEAP_PROF_BEGIN] = "Start of heap profile", [EVENT_HEAP_PROF_COST_CENTRE] = "Cost center definition", [EVENT_HEAP_PROF_SAMPLE_BEGIN] = "Start of heap profile sample", + [EVENT_HEAP_BIO_PROF_SAMPLE_BEGIN] = "Start of heap profile (biographical) sample", [EVENT_HEAP_PROF_SAMPLE_END] = "End of heap profile sample", [EVENT_HEAP_PROF_SAMPLE_STRING] = "Heap profile string sample", [EVENT_HEAP_PROF_SAMPLE_COST_CENTRE] = "Heap profile cost-centre sample", @@ -425,6 +426,10 @@ init_event_types(void) eventTypes[t].size = 8; break; + case EVENT_HEAP_BIO_PROF_SAMPLE_BEGIN: + eventTypes[t].size = 16; + break; + case EVENT_HEAP_PROF_SAMPLE_END: eventTypes[t].size = 8; break; @@ -1224,6 +1229,17 @@ void postHeapProfSampleBegin(StgInt era) RELEASE_LOCK(&eventBufMutex); } + +void postHeapBioProfSampleBegin(StgInt era, StgWord64 time) +{ + ACQUIRE_LOCK(&eventBufMutex); + ensureRoomForEvent(&eventBuf, EVENT_HEAP_BIO_PROF_SAMPLE_BEGIN); + postEventHeader(&eventBuf, EVENT_HEAP_BIO_PROF_SAMPLE_BEGIN); + postWord64(&eventBuf, era); + postWord64(&eventBuf, time); + RELEASE_LOCK(&eventBufMutex); +} + void postHeapProfSampleEnd(StgInt era) { ACQUIRE_LOCK(&eventBufMutex); diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h index 8935e61985..d8a614b45c 100644 --- a/rts/eventlog/EventLog.h +++ b/rts/eventlog/EventLog.h @@ -140,6 +140,7 @@ void postTaskDeleteEvent (EventTaskId taskId); void postHeapProfBegin(StgWord8 profile_id); void postHeapProfSampleBegin(StgInt era); +void postHeapBioProfSampleBegin(StgInt era, StgWord64 time_ns); void postHeapProfSampleEnd(StgInt era); void postHeapProfSampleString(StgWord8 profile_id, |