summaryrefslogtreecommitdiff
path: root/rts/Trace.h
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-07-14 17:31:16 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-07-18 16:31:18 +0100
commit46b70749971341678c3e4d5cdb2b1ab1a13d039e (patch)
treec409612c7868e165fa559fcd27cfecfb30ddd994 /rts/Trace.h
parent02871adf5f27de9e8748c0a24d086f5be5827203 (diff)
downloadhaskell-46b70749971341678c3e4d5cdb2b1ab1a13d039e.tar.gz
Move GC tracing into a separate trace class
Previously GC was included in the scheduler trace class. It can be enabled specifically with +RTS -vg or -lg, though note that both -v and -l on their own now default to a sensible set of trace classes, currently: scheduler, gc and sparks.
Diffstat (limited to 'rts/Trace.h')
-rw-r--r--rts/Trace.h61
1 files changed, 31 insertions, 30 deletions
diff --git a/rts/Trace.h b/rts/Trace.h
index 34efdf6d87..676fa58515 100644
--- a/rts/Trace.h
+++ b/rts/Trace.h
@@ -62,6 +62,7 @@ extern int DEBUG_sparks;
// events
extern int TRACE_sched;
+extern int TRACE_gc;
extern int TRACE_spark;
// -----------------------------------------------------------------------------
@@ -102,16 +103,15 @@ void traceEnd (void);
void traceSchedEvent_ (Capability *cap, EventTypeNum tag,
StgTSO *tso, StgWord info1, StgWord info2);
-
-/*
- * Record a nullary event
+/*
+ * Record a GC event
*/
-#define traceEvent(cap, tag) \
- if (RTS_UNLIKELY(TRACE_sched)) { \
- traceEvent_(cap, tag); \
+#define traceGcEvent(cap, tag) \
+ if (RTS_UNLIKELY(TRACE_gc)) { \
+ traceGcEvent_(cap, tag); \
}
-void traceEvent_ (Capability *cap, EventTypeNum tag);
+void traceGcEvent_ (Capability *cap, EventTypeNum tag);
// variadic macros are C99, and supported by gcc. However, the
// ##__VA_ARGS syntax is a gcc extension, which allows the variable
@@ -198,8 +198,8 @@ void traceSparkCounters_ (Capability *cap,
#define traceSchedEvent(cap, tag, tso, other) /* nothing */
#define traceSchedEvent2(cap, tag, tso, other, info) /* nothing */
+#define traceGcEvent(cap, tag) /* nothing */
#define traceSparkEvent(cap, tag, tso, other) /* nothing */
-#define traceEvent(cap, tag) /* nothing */
#define traceCap(class, cap, msg, ...) /* nothing */
#define trace(class, msg, ...) /* nothing */
#define debugTrace(class, str, ...) /* nothing */
@@ -384,28 +384,47 @@ INLINE_HEADER void traceEventThreadWakeup(Capability *cap STG_UNUSED,
INLINE_HEADER void traceEventGcStart(Capability *cap STG_UNUSED)
{
- traceSchedEvent(cap, EVENT_GC_START, 0, 0);
+ traceGcEvent(cap, EVENT_GC_START);
dtraceGcStart((EventCapNo)cap->no);
}
INLINE_HEADER void traceEventGcEnd(Capability *cap STG_UNUSED)
{
- traceSchedEvent(cap, EVENT_GC_END, 0, 0);
+ traceGcEvent(cap, EVENT_GC_END);
dtraceGcEnd((EventCapNo)cap->no);
}
INLINE_HEADER void traceEventRequestSeqGc(Capability *cap STG_UNUSED)
{
- traceSchedEvent(cap, EVENT_REQUEST_SEQ_GC, 0, 0);
+ traceGcEvent(cap, EVENT_REQUEST_SEQ_GC);
dtraceRequestSeqGc((EventCapNo)cap->no);
}
INLINE_HEADER void traceEventRequestParGc(Capability *cap STG_UNUSED)
{
- traceSchedEvent(cap, EVENT_REQUEST_PAR_GC, 0, 0);
+ traceGcEvent(cap, EVENT_REQUEST_PAR_GC);
dtraceRequestParGc((EventCapNo)cap->no);
}
+INLINE_HEADER void traceEventGcIdle(Capability *cap STG_UNUSED)
+{
+ traceGcEvent(cap, EVENT_GC_IDLE);
+ dtraceGcIdle((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventGcWork(Capability *cap STG_UNUSED)
+{
+ traceGcEvent(cap, EVENT_GC_WORK);
+ dtraceGcWork((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventGcDone(Capability *cap STG_UNUSED)
+{
+ traceGcEvent(cap, EVENT_GC_DONE);
+ dtraceGcDone((EventCapNo)cap->no);
+}
+
+
INLINE_HEADER void traceEventRunSpark(Capability *cap STG_UNUSED,
StgTSO *tso STG_UNUSED)
{
@@ -443,24 +462,6 @@ INLINE_HEADER void traceEventStartup(void)
dtraceStartup(n_caps);
}
-INLINE_HEADER void traceEventGcIdle(Capability *cap STG_UNUSED)
-{
- traceEvent(cap, EVENT_GC_IDLE);
- dtraceGcIdle((EventCapNo)cap->no);
-}
-
-INLINE_HEADER void traceEventGcWork(Capability *cap STG_UNUSED)
-{
- traceEvent(cap, EVENT_GC_WORK);
- dtraceGcWork((EventCapNo)cap->no);
-}
-
-INLINE_HEADER void traceEventGcDone(Capability *cap STG_UNUSED)
-{
- traceEvent(cap, EVENT_GC_DONE);
- dtraceGcDone((EventCapNo)cap->no);
-}
-
INLINE_HEADER void traceCapsetCreate(CapsetID capset STG_UNUSED,
CapsetType capset_type STG_UNUSED)
{