summaryrefslogtreecommitdiff
path: root/rts/eventlog/EventLog.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-12-18 10:14:09 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-02 17:29:05 -0500
commit8188adf0f1a0482c269d1eb6350dd91dddc9ed29 (patch)
tree89d265d5212f9c5dcbf4db0ac0ab42234d1eb164 /rts/eventlog/EventLog.h
parent5d7978df2f23ba125adacbe371188f99debdbb43 (diff)
downloadhaskell-8188adf0f1a0482c269d1eb6350dd91dddc9ed29.tar.gz
eventlog: Fix various races
Previously the eventlog infrastructure had a couple of races that could pop up when using the startEventLog/endEventLog interfaces. In particular, stopping and then later restarting logging could result in data preceding the eventlog header, breaking the integrity of the stream. To fix this we rework the invariants regarding the eventlog and generally tighten up the concurrency control surrounding starting and stopping of logging. We also fix an unrelated bug, wherein log events from disabled capabilities could end up never flushed.
Diffstat (limited to 'rts/eventlog/EventLog.h')
-rw-r--r--rts/eventlog/EventLog.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h
index e78db809c7..a412b491bb 100644
--- a/rts/eventlog/EventLog.h
+++ b/rts/eventlog/EventLog.h
@@ -26,6 +26,7 @@ extern bool eventlog_enabled;
void initEventLogging(void);
void restartEventLogging(void);
+void finishCapEventLogging(void);
void freeEventLogging(void);
void abortEventLogging(void); // #4512 - after fork child needs to abort
void moreCapEventBufs (uint32_t from, uint32_t to);
@@ -182,6 +183,8 @@ void postTickyCounterSamples(StgEntCounter *p);
#else /* !TRACING */
+INLINE_HEADER void finishCapEventLogging(void) {}
+
INLINE_HEADER void flushLocalEventsBuf(Capability *cap STG_UNUSED)
{ /* nothing */ }