diff options
author | Duncan Coutts <duncan@well-typed.com> | 2011-05-26 16:42:37 +0100 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2011-05-26 18:47:38 +0100 |
commit | 43c7d555c8d7eea6ba0d76bce33be8d25a01c6fd (patch) | |
tree | bdedeec69be072afc7dc5818652d85a3b42a10cf /rts/Capability.c | |
parent | c4f9b989c605776c1f07929672a856f07d9b4b44 (diff) | |
download | haskell-43c7d555c8d7eea6ba0d76bce33be8d25a01c6fd.tar.gz |
Add capability sets to the tracing/events system
We trace the creation and shutdown of capabilities. All the capabilities
in the process are assigned to one capabilitiy set of OS-process type.
This is a second version of the patch. Includes work by Spencer Janssen.
Diffstat (limited to 'rts/Capability.c')
-rw-r--r-- | rts/Capability.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/rts/Capability.c b/rts/Capability.c index 3e1dd972c7..fe5dbdca40 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -253,6 +253,8 @@ initCapability( Capability *cap, nat i ) cap->transaction_tokens = 0; cap->context_switch = 0; cap->pinned_object_block = NULL; + + traceCapsetAssignCap(CAPSET_OSPROCESS_DEFAULT, i); } /* --------------------------------------------------------------------------- @@ -266,6 +268,10 @@ initCapability( Capability *cap, nat i ) void initCapabilities( void ) { + /* Declare a single capability set representing the process. + Each capability will get added to this capset. */ + traceCapsetCreate(CAPSET_OSPROCESS_DEFAULT, CapsetTypeOsProcess); + #if defined(THREADED_RTS) nat i; @@ -717,7 +723,9 @@ tryGrabCapability (Capability *cap, Task *task) * ------------------------------------------------------------------------- */ void -shutdownCapability (Capability *cap USED_IF_THREADS, Task *task USED_IF_THREADS, rtsBool safe USED_IF_THREADS) +shutdownCapability (Capability *cap, + Task *task USED_IF_THREADS, + rtsBool safe USED_IF_THREADS) { #if defined(THREADED_RTS) nat i; @@ -813,6 +821,8 @@ shutdownCapability (Capability *cap USED_IF_THREADS, Task *task USED_IF_THREADS, // closeMutex(&cap->lock); #endif /* THREADED_RTS */ + + traceCapsetRemoveCap(CAPSET_OSPROCESS_DEFAULT, cap->no); } void @@ -823,6 +833,7 @@ shutdownCapabilities(Task *task, rtsBool safe) ASSERT(task->incall->tso == NULL); shutdownCapability(&capabilities[i], task, safe); } + traceCapsetDelete(CAPSET_OSPROCESS_DEFAULT); } static void |