summaryrefslogtreecommitdiff
path: root/rts/Trace.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-07-08 17:36:16 +0200
committerDuncan Coutts <duncan@well-typed.com>2011-07-18 16:31:15 +0100
commita5192d48e61a8ece69cddc43cc12625fcdcc56ec (patch)
tree162cfa9cb99b7afd75ea13a59f7058e0146aabec /rts/Trace.c
parent5cc2670c58909b237249e96823b1bf8a236e1b53 (diff)
downloadhaskell-a5192d48e61a8ece69cddc43cc12625fcdcc56ec.tar.gz
add a new trace class for spark events
Diffstat (limited to 'rts/Trace.c')
-rw-r--r--rts/Trace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/rts/Trace.c b/rts/Trace.c
index 0c32737e1b..7d856d6dd7 100644
--- a/rts/Trace.c
+++ b/rts/Trace.c
@@ -47,6 +47,7 @@ int DEBUG_sparks;
// events
int TRACE_sched;
+int TRACE_spark;
#ifdef THREADED_RTS
static Mutex trace_utx;
@@ -90,8 +91,17 @@ void initTracing (void)
RtsFlags.TraceFlags.scheduler ||
RtsFlags.DebugFlags.scheduler;
+ // -Dr turns on spark tracing
+ TRACE_spark =
+ RtsFlags.TraceFlags.sparks ||
+ RtsFlags.DebugFlags.sparks;
+
eventlog_enabled = RtsFlags.TraceFlags.tracing == TRACE_EVENTLOG;
+ /* Note: we can have TRACE_sched or TRACE_spark turned on even when
+ eventlog_enabled is off. In the DEBUG way we may be tracing to stderr.
+ */
+
if (eventlog_enabled) {
initEventLogging();
}