summaryrefslogtreecommitdiff
path: root/rts/Capability.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-06-06 10:39:16 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-07-18 16:31:14 +0100
commitd77df1caad3a5f833aac9275938a0675e1ee6aac (patch)
tree611e7bb5cb902a0bc0987f541627d565c4563c0a /rts/Capability.c
parent5d091088ce94be4c389fa669911d0e842bd08952 (diff)
downloadhaskell-d77df1caad3a5f833aac9275938a0675e1ee6aac.tar.gz
Add spark counter tracing
A new eventlog event containing 7 spark counters/statistics: sparks created, dud, overflowed, converted, GC'd, fizzled and remaining. These are maintained and logged separately for each capability. We log them at startup, on each GC (minor and major) and on shutdown.
Diffstat (limited to 'rts/Capability.c')
-rw-r--r--rts/Capability.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/rts/Capability.c b/rts/Capability.c
index d8c3b2d53c..3c06f5adb5 100644
--- a/rts/Capability.c
+++ b/rts/Capability.c
@@ -265,6 +265,9 @@ initCapability( Capability *cap, nat i )
cap->pinned_object_block = NULL;
traceCapsetAssignCap(CAPSET_OSPROCESS_DEFAULT, i);
+#if defined(THREADED_RTS)
+ traceSparkCounters(cap);
+#endif
}
/* ---------------------------------------------------------------------------
@@ -829,7 +832,9 @@ shutdownCapability (Capability *cap,
// threads performing foreign calls that will eventually try to
// return via resumeThread() and attempt to grab cap->lock.
// closeMutex(&cap->lock);
-
+
+ traceSparkCounters(cap);
+
#endif /* THREADED_RTS */
traceCapsetRemoveCap(CAPSET_OSPROCESS_DEFAULT, cap->no);