diff options
author | Duncan Coutts <duncan@well-typed.com> | 2011-07-08 17:36:16 +0200 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2011-07-18 16:31:15 +0100 |
commit | a5192d48e61a8ece69cddc43cc12625fcdcc56ec (patch) | |
tree | 162cfa9cb99b7afd75ea13a59f7058e0146aabec /rts/Trace.h | |
parent | 5cc2670c58909b237249e96823b1bf8a236e1b53 (diff) | |
download | haskell-a5192d48e61a8ece69cddc43cc12625fcdcc56ec.tar.gz |
add a new trace class for spark events
Diffstat (limited to 'rts/Trace.h')
-rw-r--r-- | rts/Trace.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/rts/Trace.h b/rts/Trace.h index 910afbdaf8..b29df5250b 100644 --- a/rts/Trace.h +++ b/rts/Trace.h @@ -62,6 +62,7 @@ extern int DEBUG_sparks; // events extern int TRACE_sched; +extern int TRACE_spark; // ----------------------------------------------------------------------------- // Posting events @@ -93,6 +94,11 @@ void traceEnd (void); traceSchedEvent_(cap, tag, tso, info1, info2); \ } +#define traceSparkEvent(cap, tag, tso, other) \ + if (RTS_UNLIKELY(TRACE_spark)) { \ + traceSchedEvent_(cap, tag, tso, other, 0); \ + } + void traceSchedEvent_ (Capability *cap, EventTypeNum tag, StgTSO *tso, StgWord info1, StgWord info2); @@ -192,6 +198,7 @@ void traceSparkCounters_ (Capability *cap, #define traceSchedEvent(cap, tag, tso, other) /* nothing */ #define traceSchedEvent2(cap, tag, tso, other, info) /* nothing */ +#define traceSparkEvent(cap, tag, tso, other) /* nothing */ #define traceEvent(cap, tag) /* nothing */ #define traceCap(class, cap, msg, ...) /* nothing */ #define trace(class, msg, ...) /* nothing */ @@ -402,7 +409,7 @@ INLINE_HEADER void traceEventRequestParGc(Capability *cap STG_UNUSED) INLINE_HEADER void traceEventRunSpark(Capability *cap STG_UNUSED, StgTSO *tso STG_UNUSED) { - traceSchedEvent(cap, EVENT_RUN_SPARK, tso, 0); + traceSparkEvent(cap, EVENT_RUN_SPARK, tso, 0); dtraceRunSpark((EventCapNo)cap->no, (EventThreadID)tso->id); } @@ -410,7 +417,7 @@ INLINE_HEADER void traceEventStealSpark(Capability *cap STG_UNUSED, StgTSO *tso STG_UNUSED, nat victim_cap STG_UNUSED) { - traceSchedEvent(cap, EVENT_STEAL_SPARK, tso, victim_cap); + traceSparkEvent(cap, EVENT_STEAL_SPARK, tso, victim_cap); dtraceStealSpark((EventCapNo)cap->no, (EventThreadID)tso->id, (EventCapNo)victim_cap); } @@ -418,7 +425,7 @@ INLINE_HEADER void traceEventStealSpark(Capability *cap STG_UNUSED, INLINE_HEADER void traceEventCreateSparkThread(Capability *cap STG_UNUSED, StgThreadID spark_tid STG_UNUSED) { - traceSchedEvent(cap, EVENT_CREATE_SPARK_THREAD, 0, spark_tid); + traceSparkEvent(cap, EVENT_CREATE_SPARK_THREAD, 0, spark_tid); dtraceCreateSparkThread((EventCapNo)cap->no, (EventThreadID)spark_tid); } |