diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-11 15:54:17 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-24 02:43:20 -0500 |
commit | f88f43398217a5f4c2d326555e21fb1417a21db2 (patch) | |
tree | b9d9e9d3de097959cc2463c2b21f5d3842ff6b86 /includes | |
parent | 6815603f271484766425ff2e37043b78da2d073c (diff) | |
download | haskell-f88f43398217a5f4c2d326555e21fb1417a21db2.tar.gz |
rts: Flush eventlog buffers from flushEventLog
As noted in #18043, flushTrace failed flush anything beyond the writer.
This means that a significant amount of data sitting in capability-local
event buffers may never get flushed, despite the users' pleads for us to
flush.
Fix this by making flushEventLog flush all of the event buffers before
flushing the writer.
Fixes #18043.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/RtsAPI.h | 5 | ||||
-rw-r--r-- | includes/rts/EventLogWriter.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index 36ab4d4b04..f88cd0614c 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -18,8 +18,6 @@ extern "C" { #include "HsFFI.h" #include "rts/Time.h" #include "rts/Types.h" -#include "rts/EventLogWriter.h" - /* * Running the scheduler @@ -60,6 +58,9 @@ typedef struct CapabilityPublic_ { StgRegTable r; } CapabilityPublic; +/* N.B. this needs the Capability declaration above. */ +#include "rts/EventLogWriter.h" + /* ---------------------------------------------------------------------------- RTS configuration settings, for passing to hs_init_ghc() ------------------------------------------------------------------------- */ diff --git a/includes/rts/EventLogWriter.h b/includes/rts/EventLogWriter.h index 38a0c06086..73a2aec64c 100644 --- a/includes/rts/EventLogWriter.h +++ b/includes/rts/EventLogWriter.h @@ -68,3 +68,8 @@ bool startEventLogging(const EventLogWriter *writer); * Stop event logging and destroy the current EventLogWriter. */ void endEventLogging(void); + +/* + * Flush the eventlog. cap can be NULL if one is not held. + */ +void flushEventLog(Capability **cap); |