summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-03-05 11:20:39 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-08 18:25:19 -0500
commitbfa862503a9f8b2e8a61b9499d2cc3be789779fd (patch)
tree1d56c9d0165c49a65f33d62f66543b4d5163b7e2 /rts/RtsStartup.c
parent47d6acd3be1fadc0c59b7b4d4e105242c0ae0b90 (diff)
downloadhaskell-bfa862503a9f8b2e8a61b9499d2cc3be789779fd.tar.gz
eventlog: Repost initialisation events when eventlog restarts
If startEventlog is called after the program has already started running then quite a few useful events are missing from the eventlog because they are only posted when the program starts. This patch adds a mechanism to declare that an event should be reposted everytime the startEventlog function is called. Now in EventLog.c there is a global list of functions called `eventlog_header_funcs` which stores a list of functions which should be called everytime the eventlog starts. When calling `postInitEvent`, the event will not only be immediately posted to the eventlog but also added to the global list. When startEventLog is called, the list is traversed and the events reposted.
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 5cad851b80..371c96d08c 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -300,8 +300,8 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
initScheduler();
/* Trace some basic information about the process */
- traceWallClockTime();
- traceOSProcessInfo();
+ traceInitEvent(traceWallClockTime);
+ traceInitEvent(traceOSProcessInfo);
flushTrace();
/* initialize the storage manager */
@@ -370,7 +370,7 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
#if defined(PROFILING)
initProfiling();
#endif
- dumpIPEToEventLog();
+ traceInitEvent(dumpIPEToEventLog);
initHeapProfiling();
/* start the virtual timer 'subsystem'. */