Merge branch 'master' of http://darcs.haskell.org//ghc
[ghc.git] / rts / Trace.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2008-2009
4 *
5 * Support for fast binary event logging and user-space dtrace probes.
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef TRACE_H
10 #define TRACE_H
11
12 #include "rts/EventLogFormat.h"
13 #include "Capability.h"
14
15 #if defined(DTRACE)
16 #include "RtsProbes.h"
17 #endif /* defined(DTRACE) */
18
19 #include "BeginPrivate.h"
20
21 // -----------------------------------------------------------------------------
22 // EventLog API
23 // -----------------------------------------------------------------------------
24
25 #if defined(TRACING)
26
27 void initTracing (void);
28 void endTracing (void);
29 void freeTracing (void);
30 void resetTracing (void);
31
32 #endif /* TRACING */
33
34 typedef StgWord32 CapsetID;
35 typedef StgWord16 CapsetType;
36 enum CapsetType { CapsetTypeCustom = CAPSET_TYPE_CUSTOM,
37 CapsetTypeOsProcess = CAPSET_TYPE_OSPROCESS,
38 CapsetTypeClockdomain = CAPSET_TYPE_CLOCKDOMAIN };
39 #define CAPSET_OSPROCESS_DEFAULT 0
40 #define CAPSET_CLOCKDOMAIN_DEFAULT 1
41
42 // -----------------------------------------------------------------------------
43 // Message classes
44 // -----------------------------------------------------------------------------
45
46 // debugging flags, set with +RTS -D<something>
47 extern int DEBUG_sched;
48 extern int DEBUG_interp;
49 extern int DEBUG_weak;
50 extern int DEBUG_gccafs;
51 extern int DEBUG_gc;
52 extern int DEBUG_block_alloc;
53 extern int DEBUG_sanity;
54 extern int DEBUG_stable;
55 extern int DEBUG_stm;
56 extern int DEBUG_prof;
57 extern int DEBUG_gran;
58 extern int DEBUG_par;
59 extern int DEBUG_linker;
60 extern int DEBUG_squeeze;
61 extern int DEBUG_hpc;
62 extern int DEBUG_sparks;
63
64 // events
65 extern int TRACE_sched;
66 extern int TRACE_gc;
67 extern int TRACE_spark_sampled;
68 extern int TRACE_spark_full;
69 /* extern int TRACE_user; */ // only used in Trace.c
70
71 // -----------------------------------------------------------------------------
72 // Posting events
73 //
74 // We use macros rather than inline functions deliberately. We want
75 // the not-taken case to be as efficient as possible, a simple
76 // test-and-jump, and with inline functions gcc seemed to move some of
77 // the instructions from the branch up before the test.
78 //
79 // -----------------------------------------------------------------------------
80
81 #ifdef DEBUG
82 void traceBegin (const char *str, ...);
83 void traceEnd (void);
84 #endif
85
86 #ifdef TRACING
87
88 /*
89 * Record a scheduler event
90 */
91 #define traceSchedEvent(cap, tag, tso, other) \
92 if (RTS_UNLIKELY(TRACE_sched)) { \
93 traceSchedEvent_(cap, tag, tso, other, 0); \
94 }
95
96 #define traceSchedEvent2(cap, tag, tso, info1, info2) \
97 if (RTS_UNLIKELY(TRACE_sched)) { \
98 traceSchedEvent_(cap, tag, tso, info1, info2); \
99 }
100
101 void traceSchedEvent_ (Capability *cap, EventTypeNum tag,
102 StgTSO *tso, StgWord info1, StgWord info2);
103
104 /*
105 * Record a GC event
106 */
107 #define traceGcEvent(cap, tag) \
108 if (RTS_UNLIKELY(TRACE_gc)) { \
109 traceGcEvent_(cap, tag); \
110 }
111
112 void traceGcEvent_ (Capability *cap, EventTypeNum tag);
113
114 /*
115 * Record a spark event
116 */
117 #define traceSparkEvent(cap, tag) \
118 if (RTS_UNLIKELY(TRACE_spark_full)) { \
119 traceSparkEvent_(cap, tag, 0); \
120 }
121
122 #define traceSparkEvent2(cap, tag, other) \
123 if (RTS_UNLIKELY(TRACE_spark_full)) { \
124 traceSparkEvent_(cap, tag, other); \
125 }
126
127 void traceSparkEvent_ (Capability *cap, EventTypeNum tag, StgWord info1);
128
129 // variadic macros are C99, and supported by gcc. However, the
130 // ##__VA_ARGS syntax is a gcc extension, which allows the variable
131 // argument list to be empty (see gcc docs for details).
132
133 /*
134 * Emit a trace message on a particular Capability
135 */
136 #define traceCap(class, cap, msg, ...) \
137 if (RTS_UNLIKELY(class)) { \
138 traceCap_(cap, msg, ##__VA_ARGS__); \
139 }
140
141 void traceCap_(Capability *cap, char *msg, ...);
142
143 /*
144 * Emit a trace message
145 */
146 #define trace(class, msg, ...) \
147 if (RTS_UNLIKELY(class)) { \
148 trace_(msg, ##__VA_ARGS__); \
149 }
150
151 void trace_(char *msg, ...);
152
153 /*
154 * A message or event emitted by the program
155 * Used by Debug.Trace.{traceEvent, traceEventIO}
156 */
157 void traceUserMsg(Capability *cap, char *msg);
158
159 /*
160 * An event to record a Haskell thread's label/name
161 * Used by GHC.Conc.labelThread
162 */
163 void traceThreadLabel_(Capability *cap,
164 StgTSO *tso,
165 char *label);
166
167 /*
168 * Emit a debug message (only when DEBUG is defined)
169 */
170 #ifdef DEBUG
171 #define debugTrace(class, msg, ...) \
172 if (RTS_UNLIKELY(class)) { \
173 trace_(msg, ##__VA_ARGS__); \
174 }
175 #else
176 #define debugTrace(class, str, ...) /* nothing */
177 #endif
178
179 #ifdef DEBUG
180 #define debugTraceCap(class, cap, msg, ...) \
181 if (RTS_UNLIKELY(class)) { \
182 traceCap_(cap, msg, ##__VA_ARGS__); \
183 }
184 #else
185 #define debugTraceCap(class, cap, str, ...) /* nothing */
186 #endif
187
188 /*
189 * Emit a message/event describing the state of a thread
190 */
191 #define traceThreadStatus(class, tso) \
192 if (RTS_UNLIKELY(class)) { \
193 traceThreadStatus_(tso); \
194 }
195
196 void traceThreadStatus_ (StgTSO *tso);
197
198 void traceEventStartup_ (int n_caps);
199
200 /*
201 * Events for describing capability sets in the eventlog
202 *
203 * Note: unlike other events, these are not conditional on TRACE_sched or
204 * similar because they are not "real" events themselves but provide
205 * information and context for other "real" events. Other events depend on
206 * the capset info events so for simplicity, rather than working out if
207 * they're necessary we always emit them. They should be very low volume.
208 */
209 void traceCapsetEvent_ (EventTypeNum tag,
210 CapsetID capset,
211 StgWord info);
212
213 void traceWallClockTime_(void);
214
215 void traceOSProcessInfo_ (void);
216
217 void traceSparkCounters_ (Capability *cap,
218 SparkCounters counters,
219 StgWord remaining);
220
221 #else /* !TRACING */
222
223 #define traceSchedEvent(cap, tag, tso, other) /* nothing */
224 #define traceSchedEvent2(cap, tag, tso, other, info) /* nothing */
225 #define traceGcEvent(cap, tag) /* nothing */
226 #define traceSparkEvent(cap, tag) /* nothing */
227 #define traceSparkEvent2(cap, tag, other) /* nothing */
228 #define traceCap(class, cap, msg, ...) /* nothing */
229 #define trace(class, msg, ...) /* nothing */
230 #define debugTrace(class, str, ...) /* nothing */
231 #define debugTraceCap(class, cap, str, ...) /* nothing */
232 #define traceThreadStatus(class, tso) /* nothing */
233 #define traceThreadLabel_(cap, tso, label) /* nothing */
234 INLINE_HEADER void traceEventStartup_ (int n_caps STG_UNUSED) {};
235 #define traceCapsetEvent_(tag, capset, info) /* nothing */
236 #define traceWallClockTime_() /* nothing */
237 #define traceOSProcessInfo_() /* nothing */
238 #define traceSparkCounters_(cap, counters, remaining) /* nothing */
239
240 #endif /* TRACING */
241
242 // If DTRACE is enabled, but neither DEBUG nor TRACING, we need a C land
243 // wrapper for the user-msg probe (as we can't expand that in PrimOps.cmm)
244 //
245 #if !defined(DEBUG) && !defined(TRACING) && defined(DTRACE)
246
247 void dtraceUserMsgWrapper(Capability *cap, char *msg);
248
249 #endif /* !defined(DEBUG) && !defined(TRACING) && defined(DTRACE) */
250
251 // -----------------------------------------------------------------------------
252 // Aliases for static dtrace probes if dtrace is available
253 // -----------------------------------------------------------------------------
254
255 #if defined(DTRACE)
256
257 #define dtraceCreateThread(cap, tid) \
258 HASKELLEVENT_CREATE_THREAD(cap, tid)
259 #define dtraceRunThread(cap, tid) \
260 HASKELLEVENT_RUN_THREAD(cap, tid)
261 #define dtraceStopThread(cap, tid, status, info) \
262 HASKELLEVENT_STOP_THREAD(cap, tid, status, info)
263 #define dtraceThreadRunnable(cap, tid) \
264 HASKELLEVENT_THREAD_RUNNABLE(cap, tid)
265 #define dtraceMigrateThread(cap, tid, new_cap) \
266 HASKELLEVENT_MIGRATE_THREAD(cap, tid, new_cap)
267 #define dtraceShutdown(cap) \
268 HASKELLEVENT_SHUTDOWN(cap)
269 #define dtraceThreadWakeup(cap, tid, other_cap) \
270 HASKELLEVENT_THREAD_WAKEUP(cap, tid, other_cap)
271 #define dtraceGcStart(cap) \
272 HASKELLEVENT_GC_START(cap)
273 #define dtraceGcEnd(cap) \
274 HASKELLEVENT_GC_END(cap)
275 #define dtraceRequestSeqGc(cap) \
276 HASKELLEVENT_REQUEST_SEQ_GC(cap)
277 #define dtraceRequestParGc(cap) \
278 HASKELLEVENT_REQUEST_PAR_GC(cap)
279 #define dtraceCreateSparkThread(cap, spark_tid) \
280 HASKELLEVENT_CREATE_SPARK_THREAD(cap, spark_tid)
281 #define dtraceThreadLabel(cap, tso, label) \
282 HASKELLEVENT_THREAD_LABEL(cap, tso, label)
283 INLINE_HEADER void dtraceStartup (int num_caps) {
284 HASKELLEVENT_STARTUP(num_caps);
285 }
286 #define dtraceUserMsg(cap, msg) \
287 HASKELLEVENT_USER_MSG(cap, msg)
288 #define dtraceGcIdle(cap) \
289 HASKELLEVENT_GC_IDLE(cap)
290 #define dtraceGcWork(cap) \
291 HASKELLEVENT_GC_WORK(cap)
292 #define dtraceGcDone(cap) \
293 HASKELLEVENT_GC_DONE(cap)
294 #define dtraceCapsetCreate(capset, capset_type) \
295 HASKELLEVENT_CAPSET_CREATE(capset, capset_type)
296 #define dtraceCapsetDelete(capset) \
297 HASKELLEVENT_CAPSET_DELETE(capset)
298 #define dtraceCapsetAssignCap(capset, capno) \
299 HASKELLEVENT_CAPSET_ASSIGN_CAP(capset, capno)
300 #define dtraceCapsetRemoveCap(capset, capno) \
301 HASKELLEVENT_CAPSET_REMOVE_CAP(capset, capno)
302 #define dtraceSparkCounters(cap, a, b, c, d, e, f, g) \
303 HASKELLEVENT_SPARK_COUNTERS(cap, a, b, c, d, e, f, g)
304 #define dtraceSparkCreate(cap) \
305 HASKELLEVENT_SPARK_CREATE(cap)
306 #define dtraceSparkDud(cap) \
307 HASKELLEVENT_SPARK_DUD(cap)
308 #define dtraceSparkOverflow(cap) \
309 HASKELLEVENT_SPARK_OVERFLOW(cap)
310 #define dtraceSparkRun(cap) \
311 HASKELLEVENT_SPARK_RUN(cap)
312 #define dtraceSparkSteal(cap, victim_cap) \
313 HASKELLEVENT_SPARK_STEAL(cap, victim_cap)
314 #define dtraceSparkFizzle(cap) \
315 HASKELLEVENT_SPARK_FIZZLE(cap)
316 #define dtraceSparkGc(cap) \
317 HASKELLEVENT_SPARK_GC(cap)
318
319 #else /* !defined(DTRACE) */
320
321 #define dtraceCreateThread(cap, tid) /* nothing */
322 #define dtraceRunThread(cap, tid) /* nothing */
323 #define dtraceStopThread(cap, tid, status, info) /* nothing */
324 #define dtraceThreadRunnable(cap, tid) /* nothing */
325 #define dtraceMigrateThread(cap, tid, new_cap) /* nothing */
326 #define dtraceShutdown(cap) /* nothing */
327 #define dtraceThreadWakeup(cap, tid, other_cap) /* nothing */
328 #define dtraceGcStart(cap) /* nothing */
329 #define dtraceGcEnd(cap) /* nothing */
330 #define dtraceRequestSeqGc(cap) /* nothing */
331 #define dtraceRequestParGc(cap) /* nothing */
332 #define dtraceCreateSparkThread(cap, spark_tid) /* nothing */
333 #define dtraceThreadLabel(cap, tso, label) /* nothing */
334 INLINE_HEADER void dtraceStartup (int num_caps STG_UNUSED) {};
335 #define dtraceUserMsg(cap, msg) /* nothing */
336 #define dtraceGcIdle(cap) /* nothing */
337 #define dtraceGcWork(cap) /* nothing */
338 #define dtraceGcDone(cap) /* nothing */
339 #define dtraceCapsetCreate(capset, capset_type) /* nothing */
340 #define dtraceCapsetDelete(capset) /* nothing */
341 #define dtraceCapsetAssignCap(capset, capno) /* nothing */
342 #define dtraceCapsetRemoveCap(capset, capno) /* nothing */
343 #define dtraceSparkCounters(cap, a, b, c, d, e, f, g) /* nothing */
344 #define dtraceSparkCreate(cap) /* nothing */
345 #define dtraceSparkDud(cap) /* nothing */
346 #define dtraceSparkOverflow(cap) /* nothing */
347 #define dtraceSparkRun(cap) /* nothing */
348 #define dtraceSparkSteal(cap, victim_cap) /* nothing */
349 #define dtraceSparkFizzle(cap) /* nothing */
350 #define dtraceSparkGc(cap) /* nothing */
351
352 #endif
353
354 // -----------------------------------------------------------------------------
355 // Trace probes dispatching to various tracing frameworks
356 //
357 // In order to avoid accumulating multiple calls to tracing calls at trace
358 // points, we define inline probe functions that contain the various
359 // invocations.
360 //
361 // Dtrace - dtrace probes are unconditionally added as probe activation is
362 // handled by the dtrace component of the kernel, and inactive probes are
363 // very cheap — usually, one no-op. Consequently, dtrace can be used with
364 // all flavours of the RTS. In addition, we still support logging events to
365 // a file, even in the presence of dtrace. This is, eg, useful when tracing
366 // on a server, but browsing trace information with ThreadScope on a local
367 // client.
368 //
369 // -----------------------------------------------------------------------------
370
371 INLINE_HEADER void traceEventCreateThread(Capability *cap STG_UNUSED,
372 StgTSO *tso STG_UNUSED)
373 {
374 traceSchedEvent(cap, EVENT_CREATE_THREAD, tso, tso->stackobj->stack_size);
375 dtraceCreateThread((EventCapNo)cap->no, (EventThreadID)tso->id);
376 }
377
378 INLINE_HEADER void traceEventRunThread(Capability *cap STG_UNUSED,
379 StgTSO *tso STG_UNUSED)
380 {
381 traceSchedEvent(cap, EVENT_RUN_THREAD, tso, tso->what_next);
382 dtraceRunThread((EventCapNo)cap->no, (EventThreadID)tso->id);
383 }
384
385 INLINE_HEADER void traceEventStopThread(Capability *cap STG_UNUSED,
386 StgTSO *tso STG_UNUSED,
387 StgThreadReturnCode status STG_UNUSED,
388 StgWord32 info STG_UNUSED)
389 {
390 traceSchedEvent2(cap, EVENT_STOP_THREAD, tso, status, info);
391 dtraceStopThread((EventCapNo)cap->no, (EventThreadID)tso->id,
392 (EventThreadStatus)status, (EventThreadID)info);
393 }
394
395 // needs to be EXTERN_INLINE as it is used in another EXTERN_INLINE function
396 EXTERN_INLINE void traceEventThreadRunnable(Capability *cap STG_UNUSED,
397 StgTSO *tso STG_UNUSED);
398
399 EXTERN_INLINE void traceEventThreadRunnable(Capability *cap STG_UNUSED,
400 StgTSO *tso STG_UNUSED)
401 {
402 traceSchedEvent(cap, EVENT_THREAD_RUNNABLE, tso, 0);
403 dtraceThreadRunnable((EventCapNo)cap->no, (EventThreadID)tso->id);
404 }
405
406 INLINE_HEADER void traceEventMigrateThread(Capability *cap STG_UNUSED,
407 StgTSO *tso STG_UNUSED,
408 nat new_cap STG_UNUSED)
409 {
410 traceSchedEvent(cap, EVENT_MIGRATE_THREAD, tso, new_cap);
411 dtraceMigrateThread((EventCapNo)cap->no, (EventThreadID)tso->id,
412 (EventCapNo)new_cap);
413 }
414
415 INLINE_HEADER void traceEventShutdown(Capability *cap STG_UNUSED)
416 {
417 traceSchedEvent(cap, EVENT_SHUTDOWN, 0, 0);
418 dtraceShutdown((EventCapNo)cap->no);
419 }
420
421 INLINE_HEADER void traceEventThreadWakeup(Capability *cap STG_UNUSED,
422 StgTSO *tso STG_UNUSED,
423 nat other_cap STG_UNUSED)
424 {
425 traceSchedEvent(cap, EVENT_THREAD_WAKEUP, tso, other_cap);
426 dtraceThreadWakeup((EventCapNo)cap->no, (EventThreadID)tso->id,
427 (EventCapNo)other_cap);
428 }
429
430 INLINE_HEADER void traceThreadLabel(Capability *cap STG_UNUSED,
431 StgTSO *tso STG_UNUSED,
432 char *label STG_UNUSED)
433 {
434 if (RTS_UNLIKELY(TRACE_sched)) {
435 traceThreadLabel_(cap, tso, label);
436 }
437 dtraceThreadLabel((EventCapNo)cap->no, (EventThreadID)tso->id, label);
438 }
439
440 INLINE_HEADER void traceEventGcStart(Capability *cap STG_UNUSED)
441 {
442 traceGcEvent(cap, EVENT_GC_START);
443 dtraceGcStart((EventCapNo)cap->no);
444 }
445
446 INLINE_HEADER void traceEventGcEnd(Capability *cap STG_UNUSED)
447 {
448 traceGcEvent(cap, EVENT_GC_END);
449 dtraceGcEnd((EventCapNo)cap->no);
450 }
451
452 INLINE_HEADER void traceEventRequestSeqGc(Capability *cap STG_UNUSED)
453 {
454 traceGcEvent(cap, EVENT_REQUEST_SEQ_GC);
455 dtraceRequestSeqGc((EventCapNo)cap->no);
456 }
457
458 INLINE_HEADER void traceEventRequestParGc(Capability *cap STG_UNUSED)
459 {
460 traceGcEvent(cap, EVENT_REQUEST_PAR_GC);
461 dtraceRequestParGc((EventCapNo)cap->no);
462 }
463
464 INLINE_HEADER void traceEventGcIdle(Capability *cap STG_UNUSED)
465 {
466 traceGcEvent(cap, EVENT_GC_IDLE);
467 dtraceGcIdle((EventCapNo)cap->no);
468 }
469
470 INLINE_HEADER void traceEventGcWork(Capability *cap STG_UNUSED)
471 {
472 traceGcEvent(cap, EVENT_GC_WORK);
473 dtraceGcWork((EventCapNo)cap->no);
474 }
475
476 INLINE_HEADER void traceEventGcDone(Capability *cap STG_UNUSED)
477 {
478 traceGcEvent(cap, EVENT_GC_DONE);
479 dtraceGcDone((EventCapNo)cap->no);
480 }
481
482 INLINE_HEADER void traceEventStartup(void)
483 {
484 int n_caps;
485 #ifdef THREADED_RTS
486 // XXX n_capabilities hasn't been initialised yet
487 n_caps = RtsFlags.ParFlags.nNodes;
488 #else
489 n_caps = 1;
490 #endif
491
492 traceEventStartup_(n_caps);
493 dtraceStartup(n_caps);
494 }
495
496 INLINE_HEADER void traceCapsetCreate(CapsetID capset STG_UNUSED,
497 CapsetType capset_type STG_UNUSED)
498 {
499 traceCapsetEvent_(EVENT_CAPSET_CREATE, capset, capset_type);
500 dtraceCapsetCreate(capset, capset_type);
501 }
502
503 INLINE_HEADER void traceCapsetDelete(CapsetID capset STG_UNUSED)
504 {
505 traceCapsetEvent_(EVENT_CAPSET_DELETE, capset, 0);
506 dtraceCapsetDelete(capset);
507 }
508
509 INLINE_HEADER void traceCapsetAssignCap(CapsetID capset STG_UNUSED,
510 nat capno STG_UNUSED)
511 {
512 traceCapsetEvent_(EVENT_CAPSET_ASSIGN_CAP, capset, capno);
513 dtraceCapsetAssignCap(capset, capno);
514 }
515
516 INLINE_HEADER void traceCapsetRemoveCap(CapsetID capset STG_UNUSED,
517 nat capno STG_UNUSED)
518 {
519 traceCapsetEvent_(EVENT_CAPSET_REMOVE_CAP, capset, capno);
520 dtraceCapsetRemoveCap(capset, capno);
521 }
522
523 INLINE_HEADER void traceWallClockTime(void)
524 {
525 traceWallClockTime_();
526 /* Note: no DTrace equivalent because it is available to DTrace directly */
527 }
528
529 INLINE_HEADER void traceOSProcessInfo(void)
530 {
531 traceOSProcessInfo_();
532 /* Note: no DTrace equivalent because all this OS process info
533 * is available to DTrace directly */
534 }
535
536 INLINE_HEADER void traceEventCreateSparkThread(Capability *cap STG_UNUSED,
537 StgThreadID spark_tid STG_UNUSED)
538 {
539 traceSparkEvent2(cap, EVENT_CREATE_SPARK_THREAD, spark_tid);
540 dtraceCreateSparkThread((EventCapNo)cap->no, (EventThreadID)spark_tid);
541 }
542
543 INLINE_HEADER void traceSparkCounters(Capability *cap STG_UNUSED)
544 {
545 #ifdef THREADED_RTS
546 if (RTS_UNLIKELY(TRACE_spark_sampled)) {
547 traceSparkCounters_(cap, cap->spark_stats, sparkPoolSize(cap->sparks));
548 }
549 dtraceSparkCounters((EventCapNo)cap->no,
550 cap->spark_stats.created,
551 cap->spark_stats.dud,
552 cap->spark_stats.overflowed,
553 cap->spark_stats.converted,
554 cap->spark_stats.gcd,
555 cap->spark_stats.fizzled,
556 sparkPoolSize(cap->sparks));
557 #endif
558 }
559
560 INLINE_HEADER void traceEventSparkCreate(Capability *cap STG_UNUSED)
561 {
562 traceSparkEvent(cap, EVENT_SPARK_CREATE);
563 dtraceSparkCreate((EventCapNo)cap->no);
564 }
565
566 INLINE_HEADER void traceEventSparkDud(Capability *cap STG_UNUSED)
567 {
568 traceSparkEvent(cap, EVENT_SPARK_DUD);
569 dtraceSparkDud((EventCapNo)cap->no);
570 }
571
572 INLINE_HEADER void traceEventSparkOverflow(Capability *cap STG_UNUSED)
573 {
574 traceSparkEvent(cap, EVENT_SPARK_OVERFLOW);
575 dtraceSparkOverflow((EventCapNo)cap->no);
576 }
577
578 INLINE_HEADER void traceEventSparkRun(Capability *cap STG_UNUSED)
579 {
580 traceSparkEvent(cap, EVENT_SPARK_RUN);
581 dtraceSparkRun((EventCapNo)cap->no);
582 }
583
584 INLINE_HEADER void traceEventSparkSteal(Capability *cap STG_UNUSED,
585 nat victim_cap STG_UNUSED)
586 {
587 traceSparkEvent2(cap, EVENT_SPARK_STEAL, victim_cap);
588 dtraceSparkSteal((EventCapNo)cap->no, (EventCapNo)victim_cap);
589 }
590
591 INLINE_HEADER void traceEventSparkFizzle(Capability *cap STG_UNUSED)
592 {
593 traceSparkEvent(cap, EVENT_SPARK_FIZZLE);
594 dtraceSparkFizzle((EventCapNo)cap->no);
595 }
596
597 INLINE_HEADER void traceEventSparkGC(Capability *cap STG_UNUSED)
598 {
599 traceSparkEvent(cap, EVENT_SPARK_GC);
600 dtraceSparkGc((EventCapNo)cap->no);
601 }
602
603 #include "EndPrivate.h"
604
605 #endif /* TRACE_H */