summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-15 17:49:34 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-08 13:19:39 -0400
commit6a52c83f7be44c7ff01b3180bb2dba20fc2b987e (patch)
tree38a12417b85cd935ac836350dd5a94741e2509e0
parent1afb499583f741a95cceb3207c5455c8ec6f5b87 (diff)
downloadhaskell-wip/init-event-types.tar.gz
rts: Separate population of eventTypes from initial event generationwip/init-event-types
Previously these two orthogonal concerns were both implemented in postHeaderEvents which made it difficult to send header events after RTS initialization.
-rw-r--r--rts/eventlog/EventLog.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index c853492f09..0651de268c 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -267,15 +267,9 @@ flushEventLog(void)
}
static void
-postHeaderEvents(void)
+init_event_types(void)
{
- // Write in buffer: the header begin marker.
- postInt32(&eventBuf, EVENT_HEADER_BEGIN);
-
- // Mark beginning of event types in the header.
- postInt32(&eventBuf, EVENT_HET_BEGIN);
for (int t = 0; t < NUM_GHC_EVENT_TAGS; ++t) {
-
eventTypes[t].etNum = t;
eventTypes[t].desc = EventDesc[t];
@@ -450,9 +444,22 @@ postHeaderEvents(void)
default:
continue; /* ignore deprecated events */
}
+ }
+}
+
+static void
+postHeaderEvents(void)
+{
+ // Write in buffer: the header begin marker.
+ postInt32(&eventBuf, EVENT_HEADER_BEGIN);
+ // Mark beginning of event types in the header.
+ postInt32(&eventBuf, EVENT_HET_BEGIN);
+
+ for (int t = 0; t < NUM_GHC_EVENT_TAGS; ++t) {
// Write in buffer: the start event type.
- postEventType(&eventBuf, &eventTypes[t]);
+ if (eventTypes[t].desc)
+ postEventType(&eventBuf, &eventTypes[t]);
}
// Mark end of event types in the header.
@@ -470,6 +477,8 @@ initEventLogging(const EventLogWriter *ev_writer)
{
uint32_t n_caps;
+ init_event_types();
+
event_log_writer = ev_writer;
initEventLogWriter();