diff options
author | Simon Marlow <marlowsd@gmail.com> | 2016-08-02 09:57:19 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-08-03 08:07:34 +0100 |
commit | d1fe08ec15230d5a6c3025ef798a8c911d2fa1c7 (patch) | |
tree | fafd1d019805eff2a819a27f0940f52d49e2c83a /rts/Trace.c | |
parent | 988ad8ba8e709eff3cea59728e481bb269fa6185 (diff) | |
download | haskell-d1fe08ec15230d5a6c3025ef798a8c911d2fa1c7.tar.gz |
Only trace cap/capset events if we're tracing anything else
Summary:
I was getting annoyed by cap/capset messages when using +RTS -DS, which
doesn't cause any other trace messages to be emitted. This makes it
possible to add --with-rtsopts=-DS when running tests, and not have all
the tests fail due to spurious trace messages.
Test Plan: validate
Reviewers: duncan, bgamari, ezyang, austin, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2438
Diffstat (limited to 'rts/Trace.c')
-rw-r--r-- | rts/Trace.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/rts/Trace.c b/rts/Trace.c index fdf80496f8..0dc05d57f7 100644 --- a/rts/Trace.c +++ b/rts/Trace.c @@ -51,6 +51,7 @@ int TRACE_gc; int TRACE_spark_sampled; int TRACE_spark_full; int TRACE_user; +int TRACE_cap; #ifdef THREADED_RTS static Mutex trace_utx; @@ -114,6 +115,14 @@ void initTracing (void) TRACE_user = RtsFlags.TraceFlags.user; + // We trace cap events if we're tracing anything else + TRACE_cap = + TRACE_sched || + TRACE_gc || + TRACE_spark_sampled || + TRACE_spark_full || + TRACE_user; + eventlog_enabled = RtsFlags.TraceFlags.tracing == TRACE_EVENTLOG; /* Note: we can have any of the TRACE_* flags turned on even when @@ -378,8 +387,8 @@ void traceEventGcStats_ (Capability *cap, } } -void traceCapEvent (Capability *cap, - EventTypeNum tag) +void traceCapEvent_ (Capability *cap, + EventTypeNum tag) { #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { @@ -410,9 +419,9 @@ void traceCapEvent (Capability *cap, } } -void traceCapsetEvent (EventTypeNum tag, - CapsetID capset, - StgWord info) +void traceCapsetEvent_ (EventTypeNum tag, + CapsetID capset, + StgWord info) { #ifdef DEBUG if (RtsFlags.TraceFlags.tracing == TRACE_STDERR && TRACE_sched) |