diff options
author | Duncan Coutts <duncan@well-typed.com> | 2012-07-03 19:28:40 +0100 |
---|---|---|
committer | Mikolaj Konarski <mikolaj@well-typed.com> | 2012-07-10 17:53:34 +0200 |
commit | 54c98b687a5e23f3371604dc4918dfb3106a74f8 (patch) | |
tree | 6f35fbe69fec9f26d14da6f0a146aef5a4a925f1 /includes | |
parent | 647ae1cfbb5ea3e2d3b1541c2bc12ea5db321134 (diff) | |
download | haskell-54c98b687a5e23f3371604dc4918dfb3106a74f8.tar.gz |
Define the task-tracking events
Based on initial patches by Mikolaj Konarski <mikolaj@well-typed.com>
These new eventlog events are to let profiling tools keep track of all
the OS threads that belong to an RTS capability at any moment in time.
In the RTS, OS threads correspond to the Task abstraction, so that is
what we track. There are events for tasks being created, migrated
between capabilities and deleted. In particular the task creation event
also records the kernel thread id which lets us match up the OS thread
with data collected by others tools (in the initial use case with
Linux's perf tool, but in principle also with DTrace).
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/EventLogFormat.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h index b1933562da..82d3f683cc 100644 --- a/includes/rts/EventLogFormat.h +++ b/includes/rts/EventLogFormat.h @@ -158,21 +158,26 @@ par_n_threads, par_max_copied, par_tot_copied) */ #define EVENT_GC_GLOBAL_SYNC 54 /* () */ +#define EVENT_TASK_CREATE 55 /* (taskID, cap, tid) */ +#define EVENT_TASK_MIGRATE 56 /* (taskID, cap, new_cap) */ +#define EVENT_TASK_DELETE 57 /* (taskID) */ -/* Range 55 - 59 is available for new GHC and common events */ +/* Range 58 - 59 is available for new GHC and common events. */ /* Range 60 - 80 is used by eden for parallel tracing * see http://www.mathematik.uni-marburg.de/~eden/ */ -/* Range 100 - 139 is reserved for Mercury */ +/* Range 100 - 139 is reserved for Mercury. */ + +/* Range 140 - 159 is reserved for Perf events. */ /* * The highest event code +1 that ghc itself emits. Note that some event * ranges higher than this are reserved but not currently emitted by ghc. * This must match the size of the EventDesc[] array in EventLog.c */ -#define NUM_GHC_EVENT_TAGS 55 +#define NUM_GHC_EVENT_TAGS 58 #if 0 /* DEPRECATED EVENTS: */ /* we don't actually need to record the thread, it's implicit */ @@ -229,6 +234,8 @@ typedef StgWord16 EventPayloadSize; /* variable-size events */ typedef StgWord16 EventThreadStatus; /* status for EVENT_STOP_THREAD */ typedef StgWord32 EventCapsetID; typedef StgWord16 EventCapsetType; /* types for EVENT_CAPSET_CREATE */ +typedef StgWord64 EventTaskId; /* for EVENT_TASK_* */ +typedef StgWord64 EventKernelThreadId; /* for EVENT_TASK_CREATE */ #endif |