+INLINE_HEADER void traceEventStopThread(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED,
+ StgThreadReturnCode status STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_STOP_THREAD, tso, status);
+ dtraceStopThread((EventCapNo)cap->no, (EventThreadID)tso->id,
+ (EventThreadStatus)status);
+}
+
+// needs to be EXTERN_INLINE as it is used in another EXTERN_INLINE function
+EXTERN_INLINE void traceEventThreadRunnable(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED);
+
+EXTERN_INLINE void traceEventThreadRunnable(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_THREAD_RUNNABLE, tso, 0);
+ dtraceThreadRunnable((EventCapNo)cap->no, (EventThreadID)tso->id);
+}
+
+INLINE_HEADER void traceEventMigrateThread(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED,
+ nat new_cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_MIGRATE_THREAD, tso, new_cap);
+ dtraceMigrateThread((EventCapNo)cap->no, (EventThreadID)tso->id,
+ (EventCapNo)new_cap);
+}
+
+INLINE_HEADER void traceEventRunSpark(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_RUN_SPARK, tso, 0);
+ dtraceRunSpark((EventCapNo)cap->no, (EventThreadID)tso->id);
+}
+
+INLINE_HEADER void traceEventStealSpark(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED,
+ nat victim_cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_STEAL_SPARK, tso, victim_cap);
+ dtraceStealSpark((EventCapNo)cap->no, (EventThreadID)tso->id,
+ (EventCapNo)victim_cap);
+}
+
+INLINE_HEADER void traceEventShutdown(Capability *cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_SHUTDOWN, 0, 0);
+ dtraceShutdown((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventThreadWakeup(Capability *cap STG_UNUSED,
+ StgTSO *tso STG_UNUSED,
+ nat other_cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_THREAD_WAKEUP, tso, other_cap);
+ dtraceThreadWakeup((EventCapNo)cap->no, (EventThreadID)tso->id,
+ (EventCapNo)other_cap);
+}
+
+INLINE_HEADER void traceEventGcStart(Capability *cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_GC_START, 0, 0);
+ dtraceGcStart((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventGcEnd(Capability *cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_GC_END, 0, 0);
+ dtraceGcEnd((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventRequestSeqGc(Capability *cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_REQUEST_SEQ_GC, 0, 0);
+ dtraceRequestSeqGc((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventRequestParGc(Capability *cap STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_REQUEST_PAR_GC, 0, 0);
+ dtraceRequestParGc((EventCapNo)cap->no);
+}
+
+INLINE_HEADER void traceEventCreateSparkThread(Capability *cap STG_UNUSED,
+ StgThreadID spark_tid STG_UNUSED)
+{
+ traceSchedEvent(cap, EVENT_CREATE_SPARK_THREAD, 0, spark_tid);
+ dtraceCreateSparkThread((EventCapNo)cap->no, (EventThreadID)spark_tid);
+}
+
+// This applies only to dtrace as EVENT_STARTUP in the logging framework is
+// handled specially in 'EventLog.c'.
+//
+INLINE_HEADER void dtraceEventStartup(void)
+{
+#ifdef THREADED_RTS
+ // XXX n_capabilities hasn't been initislised yet
+ dtraceStartup(RtsFlags.ParFlags.nNodes);
+#else
+ dtraceStartup(1);
+#endif
+}
+
+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);
+}
+
+END_RTS_PRIVATE