summaryrefslogtreecommitdiff
path: root/rts/Trace.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-05-26 16:42:37 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-05-26 18:47:38 +0100
commit43c7d555c8d7eea6ba0d76bce33be8d25a01c6fd (patch)
treebdedeec69be072afc7dc5818652d85a3b42a10cf /rts/Trace.c
parentc4f9b989c605776c1f07929672a856f07d9b4b44 (diff)
downloadhaskell-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/Trace.c')
-rw-r--r--rts/Trace.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/rts/Trace.c b/rts/Trace.c
index 6c69cbc6dc..faa54d7741 100644
--- a/rts/Trace.c
+++ b/rts/Trace.c
@@ -251,6 +251,39 @@ void traceSchedEvent_ (Capability *cap, EventTypeNum tag,
}
}
+void traceCapsetModify_ (EventTypeNum tag,
+ CapsetID capset,
+ StgWord32 other)
+{
+#ifdef DEBUG
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ ACQUIRE_LOCK(&trace_utx);
+
+ tracePreface();
+ switch (tag) {
+ case EVENT_CAPSET_CREATE: // (capset, capset_type)
+ debugBelch("created capset %d of type %d\n", capset, other);
+ break;
+ case EVENT_CAPSET_DELETE: // (capset)
+ debugBelch("deleted capset %d\n", capset);
+ break;
+ case EVENT_CAPSET_ASSIGN_CAP: // (capset, capno)
+ debugBelch("assigned cap %d to capset %d\n", other, capset);
+ break;
+ case EVENT_CAPSET_REMOVE_CAP: // (capset, capno)
+ debugBelch("removed cap %d from capset %d\n", other, capset);
+ break;
+ }
+ RELEASE_LOCK(&trace_utx);
+ } else
+#endif
+ {
+ if (eventlog_enabled) {
+ postCapsetModifyEvent(tag, capset, other);
+ }
+ }
+}
+
void traceEvent_ (Capability *cap, EventTypeNum tag)
{
#ifdef DEBUG