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