diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-04-11 10:58:56 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-04-11 11:39:13 +0100 |
commit | e12bec813e8a5077615c8113a2b8875d5fefc9da (patch) | |
tree | 7412102f79b4118118eea1eee2855e8682696c83 /rts/Trace.c | |
parent | dd24d6bc37879c6b32a3d5ac4ee765e59e13501c (diff) | |
download | haskell-e12bec813e8a5077615c8113a2b8875d5fefc9da.tar.gz |
Fix crash with debug tracing and the new heap events
Diffstat (limited to 'rts/Trace.c')
-rw-r--r-- | rts/Trace.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/rts/Trace.c b/rts/Trace.c index 089bf24423..de335631b0 100644 --- a/rts/Trace.c +++ b/rts/Trace.c @@ -325,8 +325,14 @@ void traceHeapEvent_ (Capability *cap, CapsetID heap_capset, lnat info1) { - /* no stderr equivalent for these ones */ - postHeapEvent(cap, tag, heap_capset, info1); +#ifdef DEBUG + if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { + /* no stderr equivalent for these ones */ + } else +#endif + { + postHeapEvent(cap, tag, heap_capset, info1); + } } void traceEventHeapInfo_ (CapsetID heap_capset, @@ -336,10 +342,16 @@ void traceEventHeapInfo_ (CapsetID heap_capset, lnat mblockSize, lnat blockSize) { - /* no stderr equivalent for this one */ - postEventHeapInfo(heap_capset, gens, - maxHeapSize, allocAreaSize, - mblockSize, blockSize); +#ifdef DEBUG + if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { + /* no stderr equivalent for these ones */ + } else +#endif + { + postEventHeapInfo(heap_capset, gens, + maxHeapSize, allocAreaSize, + mblockSize, blockSize); + } } void traceEventGcStats_ (Capability *cap, @@ -352,10 +364,16 @@ void traceEventGcStats_ (Capability *cap, lnat par_max_copied, lnat par_tot_copied) { - /* no stderr equivalent for this one */ - postEventGcStats(cap, heap_capset, gen, - copied, slop, fragmentation, - par_n_threads, par_max_copied, par_tot_copied); +#ifdef DEBUG + if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { + /* no stderr equivalent for these ones */ + } else +#endif + { + postEventGcStats(cap, heap_capset, gen, + copied, slop, fragmentation, + par_n_threads, par_max_copied, par_tot_copied); + } } void traceCapEvent (Capability *cap, |