diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-03-05 11:20:39 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-08 18:25:19 -0500 |
commit | bfa862503a9f8b2e8a61b9499d2cc3be789779fd (patch) | |
tree | 1d56c9d0165c49a65f33d62f66543b4d5163b7e2 /rts/Trace.h | |
parent | 47d6acd3be1fadc0c59b7b4d4e105242c0ae0b90 (diff) | |
download | haskell-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/Trace.h')
-rw-r--r-- | rts/Trace.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/Trace.h b/rts/Trace.h index a4b4cc173b..a1817e8b17 100644 --- a/rts/Trace.h +++ b/rts/Trace.h @@ -108,6 +108,8 @@ void traceEnd (void); void traceSchedEvent_ (Capability *cap, EventTypeNum tag, StgTSO *tso, StgWord info1, StgWord info2); +#define traceInitEvent(event) postInitEvent(event) + /* * Record a GC event */ @@ -337,6 +339,7 @@ void flushTrace(void); #else /* !TRACING */ #define traceSchedEvent(cap, tag, tso, other) /* nothing */ +#define traceInitEvent(event) /* nothing */ #define traceSchedEvent2(cap, tag, tso, other, info) /* nothing */ #define traceGcEvent(cap, tag) /* nothing */ #define traceGcEventAtT(cap, ts, tag) /* nothing */ @@ -360,7 +363,7 @@ void flushTrace(void); #define traceCapEvent(cap, tag) /* nothing */ #define traceCapsetEvent(tag, capset, info) /* nothing */ #define traceWallClockTime_() /* nothing */ -#define traceOSProcessInfo_() /* nothing */ +#define traceOSProcessInfo_() /* nothing */ #define traceSparkCounters_(cap, counters, remaining) /* nothing */ #define traceTaskCreate_(taskID, cap) /* nothing */ #define traceTaskMigrate_(taskID, cap, new_cap) /* nothing */ |