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