do a bit of by-hand CSE
[ghc-hetmet.git] / rts / RtsProbes.d
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team, 2009
4  *
5  * User-space dtrace probes for the runtime system.
6  *
7  * ---------------------------------------------------------------------------*/
8
9 #include "HsFFI.h"
10 #include "rts/EventLogFormat.h"
11
12
13 // -----------------------------------------------------------------------------
14 // Payload datatypes for Haskell events
15 // -----------------------------------------------------------------------------
16
17 // We effectively have:
18 //
19 // typedef uint16_t EventTypeNum;
20 // typedef uint64_t EventTimestamp;   // in nanoseconds
21 // typedef uint32_t EventThreadID;
22 // typedef uint16_t EventCapNo;
23 // typedef uint16_t EventPayloadSize; // variable-size events
24 // typedef uint16_t EventThreadStatus;
25
26
27 // -----------------------------------------------------------------------------
28 // The HaskellEvent provider captures everything from eventlog for use with
29 // dtrace
30 // -----------------------------------------------------------------------------
31
32 // These probes correspond to the events defined in EventLogFormat.h
33 //
34 provider HaskellEvent {
35
36   // scheduler events
37   probe create__thread (EventCapNo, EventThreadID);
38   probe run__thread (EventCapNo, EventThreadID);
39   probe stop__thread (EventCapNo, EventThreadID, EventThreadStatus, EventThreadID);
40   probe thread__runnable (EventCapNo, EventThreadID);
41   probe migrate__thread (EventCapNo, EventThreadID, EventCapNo);
42   probe run__spark (EventCapNo, EventThreadID);
43   probe steal__spark (EventCapNo, EventThreadID, EventCapNo);
44   probe shutdown (EventCapNo);
45   probe thread_wakeup (EventCapNo, EventThreadID, EventCapNo);
46   probe gc__start (EventCapNo);
47   probe gc__end (EventCapNo);
48   probe request__seq__gc (EventCapNo);
49   probe request__par__gc (EventCapNo);
50   probe create__spark__thread (EventCapNo, EventThreadID);
51
52   // other events
53 //This one doesn't seem to be used at all at the moment:
54 //  probe log__msg (char *);
55   probe startup (EventCapNo);
56   // we don't need EVENT_BLOCK_MARKER with dtrace
57   probe user__msg (EventCapNo, char *);
58   probe gc__idle (EventCapNo);
59   probe gc__work (EventCapNo);
60   probe gc__done (EventCapNo);
61
62 };