diff options
author | Duncan Coutts <duncan@well-typed.com> | 2011-07-14 19:06:45 +0100 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2011-07-18 16:31:18 +0100 |
commit | 084b64f22717b203b8d8c2ab7c057fb747e39593 (patch) | |
tree | c44a67dcb28b288ac1ad445a83f68b75f1352c92 /rts/Sparks.c | |
parent | 46b70749971341678c3e4d5cdb2b1ab1a13d039e (diff) | |
download | haskell-084b64f22717b203b8d8c2ab7c057fb747e39593.tar.gz |
Add new fully-accurate per-spark trace/eventlog events
Replaces the existing EVENT_RUN/STEAL_SPARK events with 7 new events
covering all stages of the spark lifcycle:
create, dud, overflow, run, steal, fizzle, gc
The sampled spark events are still available. There are now two event
classes for sparks, the sampled and the fully accurate. They can be
enabled/disabled independently. By default +RTS -l includes the sampled
but not full detail spark events. Use +RTS -lf-p to enable the detailed
'f' and disable the sampled 'p' spark.
Includes work by Mikolaj <mikolaj.konarski@gmail.com>
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r-- | rts/Sparks.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c index 6ce2e68094..4241656795 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -61,13 +61,16 @@ newSpark (StgRegTable *reg, StgClosure *p) if (!fizzledSpark(p)) { if (pushWSDeque(pool,p)) { - cap->spark_stats.created++; + cap->spark_stats.created++; + traceEventSparkCreate(cap); } else { /* overflowing the spark pool */ cap->spark_stats.overflowed++; + traceEventSparkOverflow(cap); } } else { cap->spark_stats.dud++; + traceEventSparkDud(cap); } return 1; @@ -174,6 +177,7 @@ pruneSparkQueue (Capability *cap) // robustness. pruned_sparks++; cap->spark_stats.fizzled++; + traceEventSparkFizzle(cap); } else { info = spark->header.info; if (IS_FORWARDING_PTR(info)) { @@ -186,6 +190,7 @@ pruneSparkQueue (Capability *cap) } else { pruned_sparks++; // discard spark cap->spark_stats.fizzled++; + traceEventSparkFizzle(cap); } } else if (HEAP_ALLOCED(spark)) { if ((Bdescr((P_)spark)->flags & BF_EVACUATED)) { @@ -196,10 +201,12 @@ pruneSparkQueue (Capability *cap) } else { pruned_sparks++; // discard spark cap->spark_stats.fizzled++; + traceEventSparkFizzle(cap); } } else { pruned_sparks++; // discard spark cap->spark_stats.gcd++; + traceEventSparkGC(cap); } } else { if (INFO_PTR_TO_STRUCT(info)->type == THUNK_STATIC) { @@ -210,10 +217,12 @@ pruneSparkQueue (Capability *cap) } else { pruned_sparks++; // discard spark cap->spark_stats.gcd++; + traceEventSparkGC(cap); } } else { pruned_sparks++; // discard spark cap->spark_stats.fizzled++; + traceEventSparkFizzle(cap); } } } |