X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FTrace.c;h=a1da9911a717d20484041d9408a107f09ee6a4e9;hb=bb7b45dcf16118fb03bf28aea08a168ac6598a33;hp=81a2eb2c243d88dd7baf5e8f1c9c95bc02ba2af9;hpb=41a801223a8bd07659ea1178df67912f5dc3d588;p=ghc-hetmet.git diff --git a/rts/Trace.c b/rts/Trace.c index 81a2eb2..a1da991 100644 --- a/rts/Trace.c +++ b/rts/Trace.c @@ -9,10 +9,11 @@ // external headers #include "Rts.h" -#ifdef TRACING - // internal headers #include "Trace.h" + +#ifdef TRACING + #include "GetTime.h" #include "Stats.h" #include "eventlog/EventLog.h" @@ -193,6 +194,15 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag, case EVENT_GC_END: // (cap) debugBelch("cap %d: finished GC\n", cap->no); break; + case EVENT_GC_IDLE: // (cap) + debugBelch("cap %d: GC idle\n", cap->no); + break; + case EVENT_GC_WORK: // (cap) + debugBelch("cap %d: GC working\n", cap->no); + break; + case EVENT_GC_DONE: // (cap) + debugBelch("cap %d: GC done\n", cap->no); + break; default: debugBelch("cap %2d: thread %lu: event %d\n\n", cap->no, (lnat)tso->id, tag); @@ -216,6 +226,18 @@ void traceSchedEvent_ (Capability *cap, EventTypeNum tag, } } +void traceEvent_ (Capability *cap, EventTypeNum tag) +{ +#ifdef DEBUG + if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { + traceSchedEvent_stderr(cap, tag, 0, 0); + } else +#endif + { + postEvent(cap,tag); + } +} + #ifdef DEBUG static void traceCap_stderr(Capability *cap, char *msg, va_list ap) { @@ -289,6 +311,7 @@ void traceUserMsg(Capability *cap, char *msg) postUserMsg(cap, msg); } } + dtraceUserMsg(cap->no, msg); } void traceThreadStatus_ (StgTSO *tso USED_IF_DEBUG) @@ -324,3 +347,15 @@ void traceEnd (void) #endif /* DEBUG */ #endif /* TRACING */ + +// If DTRACE is enabled, but neither DEBUG nor TRACING, we need a C land +// wrapper for the user-msg probe (as we can't expand that in PrimOps.cmm) +// +#if !defined(DEBUG) && !defined(TRACING) && defined(DTRACE) + +void dtraceUserMsgWrapper(Capability *cap, char *msg) +{ + dtraceUserMsg(cap->no, msg); +} + +#endif /* !defined(DEBUG) && !defined(TRACING) && defined(DTRACE) */