RtsProbes.d 3.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2009
 *
 * User-space dtrace probes for the runtime system.
 *
 * ---------------------------------------------------------------------------*/

#include "HsFFI.h"
#include "rts/EventLogFormat.h"


13 14 15 16 17 18 19 20 21 22 23 24 25
/* -----------------------------------------------------------------------------
 * 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;
26 27
 * typedef uint32_t EventCapsetID;
 * typedef uint16_t EventCapsetType;  // types for EVENT_CAPSET_CREATE
28 29 30 31 32 33 34 35 36 37
 */

/* -----------------------------------------------------------------------------
 * The HaskellEvent provider captures everything from eventlog for use with
 * dtrace
 * -----------------------------------------------------------------------------
 */

/* These probes correspond to the events defined in EventLogFormat.h
 */
38 39
provider HaskellEvent {

40
  /* scheduler events */
41 42
  probe create__thread (EventCapNo, EventThreadID);
  probe run__thread (EventCapNo, EventThreadID);
43
  probe stop__thread (EventCapNo, EventThreadID, EventThreadStatus, EventThreadID);
44 45 46
  probe thread__runnable (EventCapNo, EventThreadID);
  probe migrate__thread (EventCapNo, EventThreadID, EventCapNo);
  probe thread_wakeup (EventCapNo, EventThreadID, EventCapNo);
47 48 49 50
  probe create__spark__thread (EventCapNo, EventThreadID);
  probe thread__label (EventCapNo, EventThreadID, char *);

  /* GC and heap events */
51 52 53 54 55 56 57
  probe gc__start (EventCapNo);
  probe gc__end (EventCapNo);
  probe request__seq__gc (EventCapNo);
  probe request__par__gc (EventCapNo);
  probe gc__idle (EventCapNo);
  probe gc__work (EventCapNo);
  probe gc__done (EventCapNo);
58
  probe gc__sync (EventCapNo);
59 60 61 62 63
  probe gc__stats (CapsetID, StgWord, StgWord, StgWord, StgWord, StgWord, StgWord, StgWord);
  probe heap__info (CapsetID, StgWord, StgWord, StgWord, StgWord, StgWord);
  probe heap__allocated (EventCapNo, CapsetID, StgWord64);
  probe heap__size (CapsetID, StgWord);
  probe heap__live (CapsetID, StgWord);
64 65 66 67 68 69 70 71 72

  /* capability events */
  probe startup (EventCapNo);
  probe cap__create (EventCapNo);
  probe cap__delete (EventCapNo);
  probe cap__enable (EventCapNo);
  probe cap__disable (EventCapNo);

  /* capset info events */
73 74 75 76
  probe capset__create(EventCapsetID, EventCapsetType);
  probe capset__delete(EventCapsetID);
  probe capset__assign__cap(EventCapsetID, EventCapNo);
  probe capset__remove__cap(EventCapsetID, EventCapNo);
77

78
  /* spark events */
Duncan Coutts's avatar
Duncan Coutts committed
79
  probe spark__counters(EventCapNo,
80 81
                        StgWord, StgWord, StgWord,
                        StgWord, StgWord, StgWord,
Duncan Coutts's avatar
Duncan Coutts committed
82
                        StgWord);
83 84 85 86 87 88 89 90

  probe spark__create   (EventCapNo);
  probe spark__dud      (EventCapNo);
  probe spark__overflow (EventCapNo);
  probe spark__run      (EventCapNo);
  probe spark__steal    (EventCapNo, EventCapNo);
  probe spark__fizzle   (EventCapNo);
  probe spark__gc       (EventCapNo);
91 92 93 94 95 96

  /* other events */
/* This one doesn't seem to be used at all at the moment: */
/*  probe log__msg (char *); */
  /* we don't need EVENT_BLOCK_MARKER with dtrace */
  probe user__msg (EventCapNo, char *);
97
};