summaryrefslogtreecommitdiff
path: root/rts/Trace.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-08-02 09:57:19 +0100
committerSimon Marlow <marlowsd@gmail.com>2016-08-03 08:07:34 +0100
commitd1fe08ec15230d5a6c3025ef798a8c911d2fa1c7 (patch)
treefafd1d019805eff2a819a27f0940f52d49e2c83a /rts/Trace.h
parent988ad8ba8e709eff3cea59728e481bb269fa6185 (diff)
downloadhaskell-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.h')
-rw-r--r--rts/Trace.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/rts/Trace.h b/rts/Trace.h
index ab79671c4c..8b531f130a 100644
--- a/rts/Trace.h
+++ b/rts/Trace.h
@@ -69,6 +69,7 @@ extern int TRACE_gc;
extern int TRACE_spark_sampled;
extern int TRACE_spark_full;
/* extern int TRACE_user; */ // only used in Trace.c
+extern int TRACE_cap;
// -----------------------------------------------------------------------------
// Posting events
@@ -244,19 +245,23 @@ void traceThreadStatus_ (StgTSO *tso);
/*
* Events for describing capabilities and capability sets in the eventlog
- *
- * Note: unlike other events, these are not conditional on TRACE_sched or
- * similar because capabilities and capability sets are important
- * context for other events. Since other events depend on these events
- * then for simplicity we always emit them, rather than working out if
- * they're necessary . They should be very low volume.
*/
-void traceCapEvent (Capability *cap,
+#define traceCapEvent(cap, tag) \
+ if (RTS_UNLIKELY(TRACE_cap)) { \
+ traceCapEvent_(cap, tag); \
+ }
+
+void traceCapEvent_ (Capability *cap,
EventTypeNum tag);
-void traceCapsetEvent (EventTypeNum tag,
- CapsetID capset,
- StgWord info);
+#define traceCapsetEvent(cap, capset, info) \
+ if (RTS_UNLIKELY(TRACE_cap)) { \
+ traceCapsetEvent_(cap, capset, info); \
+ }
+
+void traceCapsetEvent_ (EventTypeNum tag,
+ CapsetID capset,
+ StgWord info);
void traceWallClockTime_(void);