+#ifdef DEBUG
+INLINE_HEADER void debugTrace (StgWord32 class, char *msg, ...)
+{
+ va_list ap;
+ va_start(ap,msg);
+ if (traceClass(class)) {
+ trace_(msg, ap);
+ }
+ va_end(ap);
+}
+#else
+
+#define debugTrace(class, str, ...) /* nothing */
+// variable arg macros are C99, and supported by gcc.
+
+#endif
+
+void traceThreadStatus_ (StgTSO *tso);
+
+INLINE_HEADER void traceThreadStatus (StgWord32 class, StgTSO *tso)
+{
+ if (traceClass(class)) {
+ traceThreadStatus_(tso);
+ }
+}
+
+#else /* !TRACING */
+
+INLINE_HEADER rtsBool traceClass (StgWord32 class STG_UNUSED)
+{ return rtsFalse; }
+
+INLINE_HEADER void traceSchedEvent (Capability *cap STG_UNUSED,
+ EventTypeNum tag STG_UNUSED,
+ StgTSO *tso STG_UNUSED,
+ StgWord64 other STG_UNUSED)
+{ /* nothing */ }
+
+INLINE_HEADER void traceCap (StgWord32 class STG_UNUSED,
+ Capability *cap STG_UNUSED,
+ char *msg STG_UNUSED, ...)
+{ /* nothing */ }
+
+INLINE_HEADER void trace (StgWord32 class STG_UNUSED,
+ char *msg STG_UNUSED, ...)
+{ /* nothing */ }
+
+#define debugTrace(class, str, ...) /* nothing */
+// variable arg macros are C99, and supported by gcc.
+
+INLINE_HEADER void traceThreadStatus (StgWord32 class STG_UNUSED,
+ StgTSO *tso STG_UNUSED)
+{ /* nothing */ }
+
+#endif /* TRACING */
+
+END_RTS_PRIVATE