Changes between Version 1 and Version 2 of DTrace


Ignore:
Timestamp:
Dec 12, 2009 10:26:02 AM (4 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DTrace

    v1 v2  
    11= Using DTrace with GHC = 
    22 
    3 GHC 6.13 includes DTrace probes in the runtime system.  Currently, these probes correspond to the events of the EventLog framework and are only available on Mac OS X. 
     3GHC 6.13 includes DTrace probes in the runtime system.  Currently, these probes correspond to the events of the EventLog framework and are only available on Mac OS X (from Leopard onwards). 
    44 
    5 It is straight forward to extend the current implementation with additional probes, and due to the lightweight nature of DTrace, new probes could inspect the runtime system and running Haskell program even in a more fine-grained manner. 
     5It is straight forward to extend the current implementation with additional probes, and due to the lightweight nature of DTrace, new probes could inspect the runtime system and running Haskell program in an even more fine-grained manner. 
     6 
     7== Probes == 
     8 
     9The provider is defined as follows: 
     10{{{ 
     11provider HaskellEvent { 
     12 
     13  // scheduler events 
     14  probe create__thread (EventCapNo, EventThreadID); 
     15  probe run__thread (EventCapNo, EventThreadID); 
     16  probe stop__thread (EventCapNo, EventThreadID, EventThreadStatus); 
     17  probe thread__runnable (EventCapNo, EventThreadID); 
     18  probe migrate__thread (EventCapNo, EventThreadID, EventCapNo); 
     19  probe run__spark (EventCapNo, EventThreadID); 
     20  probe steal__spark (EventCapNo, EventThreadID, EventCapNo); 
     21  probe shutdown (EventCapNo); 
     22  probe thread_wakeup (EventCapNo, EventThreadID, EventCapNo); 
     23  probe gc__start (EventCapNo); 
     24  probe gc__end (EventCapNo); 
     25  probe request__seq__gc (EventCapNo); 
     26  probe request__par__gc (EventCapNo); 
     27  probe create__spark__thread (EventCapNo, EventThreadID); 
     28 
     29  // other events 
     30  probe startup (EventCapNo); 
     31  probe user__msg (EventCapNo, char *); 
     32  probe gc__idle (EventCapNo); 
     33  probe gc__work (EventCapNo); 
     34  probe gc__done (EventCapNo); 
     35 
     36}; 
     37}}} 
     38where we have 
     39{{{ 
     40typedef uint32_t EventThreadID; 
     41typedef uint16_t EventCapNo; 
     42typedef uint16_t EventThreadStatus; 
     43}}} 
     44The two events `EVENT_LOG_MSG` and `EVENT_BLOCK_MARKER` are not supported.  The former doesn't appear to be used and the latter appears to be an artefact of the event log file format. 
    645 
    746== Portability == 
    847 
    9 User-space DTrace probes are implemented differently on Mac OS X than in the original DTrace implementation; see under the heading '''BUILDING CODE CONTAINING USDT PROBES''' at [http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/dtrace.1.html].  Nevertheless, it shouldn't be too hard to enable these probes on other platforms, too. 
     48User-space DTrace probes are implemented differently on Mac OS X than in the original DTrace implementation; see under the heading ''BUILDING CODE CONTAINING USDT PROBES'' in the [http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/dtrace.1.html Mac OS X dtrace man page].  Nevertheless, it shouldn't be too hard to enable these probes on other platforms, too.