rts: Flush eventlog in hs_init_ghc (fixes #15440)
authorMitsutoshi Aoe <maoe@foldr.in>
Thu, 26 Jul 2018 05:50:51 +0000 (14:50 +0900)
committerBen Gamari <ben@smart-cactus.org>
Mon, 30 Jul 2018 21:46:45 +0000 (17:46 -0400)
commit50e4e48bb0d63aaa4c62f5ca0f01d5fb7587ec84
tree27d95ef6a8a84301125a5efd758b313403e92764
parent72dc7989a25ed6ec4ab9d3adfeefc15425acbf57
rts: Flush eventlog in hs_init_ghc (fixes #15440)

Without this change RTS typically doesn't flush some important
events until the process terminates or it doesn't write them at
all in case it terminates abnormally.

Here is a list of such events:

* EVENT_WALL_CLOCK_TIME
* EVENT_OS_PROCESS_PID
* EVENT_OS_PROCESS_PPID
* EVENT_RTS_IDENTIFIER
* EVENT_PROGRAM_ARGS
* EVENT_PROGRAM_ENV

(cherry picked from commit 7a3e1b25ff9a570851a59c4cf3600daa49867b9b)
rts/RtsStartup.c
rts/Trace.c
rts/Trace.h