Commit 00a4cdf7 authored by Simon Marlow's avatar Simon Marlow

Only reset the event log if logging is turned on (addendum to #4512)

parent a201afd3
......@@ -1566,11 +1566,11 @@ forkProcess(HsStablePtr *entry
initMutex(&cap->running_task->lock);
#endif
#if defined(TRACING)
abortEventLogging(); // abort eventlog inherited from parent
initEventLogging(); // child starts its own eventlog
#ifdef TRACING
resetTracing();
#endif
// Now, all OS threads except the thread that forked are
// Now, all OS threads except the thread that forked are
// stopped. We need to stop all Haskell threads, including
// those involved in foreign calls. Also we need to delete
// all Tasks, because they correspond to OS threads that are
......
......@@ -106,6 +106,14 @@ void freeTracing (void)
}
}
void resetTracing (void)
{
if (eventlog_enabled) {
abortEventLogging(); // abort eventlog inherited from parent
initEventLogging(); // child starts its own eventlog
}
}
/* ---------------------------------------------------------------------------
Emitting trace messages/events
--------------------------------------------------------------------------- */
......
......@@ -27,6 +27,7 @@
void initTracing (void);
void endTracing (void);
void freeTracing (void);
void resetTracing (void);
#endif /* TRACING */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment