Rename traceCapsetModify for consistency and clarity
authorDuncan Coutts <duncan@well-typed.com>
Tue, 25 Oct 2011 17:31:33 +0000 (18:31 +0100)
committerDuncan Coutts <duncan@well-typed.com>
Wed, 26 Oct 2011 11:00:42 +0000 (12:00 +0100)
rts/Trace.c
rts/Trace.h
rts/eventlog/EventLog.c
rts/eventlog/EventLog.h

index 1dce968..7aa0f7b 100644 (file)
@@ -293,9 +293,9 @@ void traceGcEvent_ (Capability *cap, EventTypeNum tag)
     }
 }
 
-void traceCapsetModify_ (EventTypeNum tag,
-                         CapsetID capset,
-                         StgWord32 other)
+void traceCapsetEvent_ (EventTypeNum tag,
+                        CapsetID capset,
+                        StgWord info)
 {
 #ifdef DEBUG
     if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
@@ -304,18 +304,18 @@ void traceCapsetModify_ (EventTypeNum tag,
         tracePreface();
         switch (tag) {
         case EVENT_CAPSET_CREATE:   // (capset, capset_type)
-            debugBelch("created capset %lu of type %d\n", (lnat)capset, (int)other);
+            debugBelch("created capset %lu of type %d\n", (lnat)capset, (int)info);
             break;
         case EVENT_CAPSET_DELETE:   // (capset)
             debugBelch("deleted capset %lu\n", (lnat)capset);
             break;
         case EVENT_CAPSET_ASSIGN_CAP:  // (capset, capno)
             debugBelch("assigned cap %lu to capset %lu\n",
-                       (lnat)other, (lnat)capset);
+                       (lnat)info, (lnat)capset);
             break;
         case EVENT_CAPSET_REMOVE_CAP:  // (capset, capno)
             debugBelch("removed cap %lu from capset %lu\n",
-                       (lnat)other, (lnat)capset);
+                       (lnat)info, (lnat)capset);
             break;
         }
         RELEASE_LOCK(&trace_utx);
@@ -323,25 +323,25 @@ void traceCapsetModify_ (EventTypeNum tag,
 #endif
     {
         if (eventlog_enabled) {
-            postCapsetModifyEvent(tag, capset, other);
+            postCapsetEvent(tag, capset, info);
         }
     }
 }
 
 void traceOSProcessInfo_(void) {
     if (eventlog_enabled) {
-        postCapsetModifyEvent(EVENT_OSPROCESS_PID,
-                              CAPSET_OSPROCESS_DEFAULT,
-                              getpid());
+        postCapsetEvent(EVENT_OSPROCESS_PID,
+                        CAPSET_OSPROCESS_DEFAULT,
+                        getpid());
 
 #if !defined(cygwin32_HOST_OS) && !defined (mingw32_HOST_OS)
 /* Windows has no strong concept of process heirarchy, so no getppid().
  * In any case, this trace event is mainly useful for tracing programs
  * that use 'forkProcess' which Windows doesn't support anyway.
  */
-        postCapsetModifyEvent(EVENT_OSPROCESS_PPID,
-                              CAPSET_OSPROCESS_DEFAULT,
-                              getppid());
+        postCapsetEvent(EVENT_OSPROCESS_PPID,
+                        CAPSET_OSPROCESS_DEFAULT,
+                        getppid());
 #endif
         {
             char buf[256];
index f896c0e..7143a5b 100644 (file)
@@ -195,9 +195,9 @@ void traceEventStartup_ (int n_caps);
  * the capset info events so for simplicity, rather than working out if
  * they're necessary we always emit them. They should be very low volume.
  */
-void traceCapsetModify_ (EventTypeNum tag,
-                         CapsetID capset,
-                         StgWord32 other);
+void traceCapsetEvent_ (EventTypeNum tag,
+                        CapsetID capset,
+                        StgWord info);
 
 void traceOSProcessInfo_ (void);
 
@@ -218,7 +218,7 @@ void traceSparkCounters_ (Capability *cap,
 #define debugTraceCap(class, cap, str, ...) /* nothing */
 #define traceThreadStatus(class, tso) /* nothing */
 INLINE_HEADER void traceEventStartup_ (int n_caps STG_UNUSED) {};
-#define traceCapsetModify_(tag, capset, other) /* nothing */
+#define traceCapsetEvent_(tag, capset, info) /* nothing */
 #define traceOSProcessInfo_() /* nothing */
 #define traceSparkCounters_(cap, counters, remaining) /* nothing */
 
@@ -468,27 +468,27 @@ INLINE_HEADER void traceEventStartup(void)
 INLINE_HEADER void traceCapsetCreate(CapsetID   capset      STG_UNUSED,
                                      CapsetType capset_type STG_UNUSED)
 {
-    traceCapsetModify_(EVENT_CAPSET_CREATE, capset, capset_type);
+    traceCapsetEvent_(EVENT_CAPSET_CREATE, capset, capset_type);
     dtraceCapsetCreate(capset, capset_type);
 }
 
 INLINE_HEADER void traceCapsetDelete(CapsetID capset STG_UNUSED)
 {
-    traceCapsetModify_(EVENT_CAPSET_DELETE, capset, 0);
+    traceCapsetEvent_(EVENT_CAPSET_DELETE, capset, 0);
     dtraceCapsetDelete(capset);
 }
 
 INLINE_HEADER void traceCapsetAssignCap(CapsetID capset STG_UNUSED,
                                         nat      capno  STG_UNUSED)
 {
-    traceCapsetModify_(EVENT_CAPSET_ASSIGN_CAP, capset, capno);
+    traceCapsetEvent_(EVENT_CAPSET_ASSIGN_CAP, capset, capno);
     dtraceCapsetAssignCap(capset, capno);
 }
 
 INLINE_HEADER void traceCapsetRemoveCap(CapsetID capset STG_UNUSED,
                                         nat      capno  STG_UNUSED)
 {
-    traceCapsetModify_(EVENT_CAPSET_REMOVE_CAP, capset, capno);
+    traceCapsetEvent_(EVENT_CAPSET_REMOVE_CAP, capset, capno);
     dtraceCapsetRemoveCap(capset, capno);
 }
 
index db0f3e4..d5bfd19 100644 (file)
@@ -559,9 +559,9 @@ postSparkCountersEvent (Capability *cap,
     postWord64(eb,remaining);
 }
 
-void postCapsetModifyEvent (EventTypeNum tag,
-                            EventCapsetID capset,
-                            StgWord32 other)
+void postCapsetEvent (EventTypeNum tag,
+                      EventCapsetID capset,
+                      StgWord info)
 {
     ACQUIRE_LOCK(&eventBufMutex);
 
@@ -576,7 +576,7 @@ void postCapsetModifyEvent (EventTypeNum tag,
     switch (tag) {
     case EVENT_CAPSET_CREATE:   // (capset, capset_type)
     {
-        postCapsetType(&eventBuf, other /* capset_type */);
+        postCapsetType(&eventBuf, info /* capset_type */);
         break;
     }
 
@@ -588,17 +588,17 @@ void postCapsetModifyEvent (EventTypeNum tag,
     case EVENT_CAPSET_ASSIGN_CAP:  // (capset, capno)
     case EVENT_CAPSET_REMOVE_CAP:  // (capset, capno)
     {
-        postCapNo(&eventBuf, other /* capno */);
+        postCapNo(&eventBuf, info /* capno */);
         break;
     }
     case EVENT_OSPROCESS_PID:   // (capset, pid)
     case EVENT_OSPROCESS_PPID:  // (capset, parent_pid)
     {
-        postWord32(&eventBuf, other);
+        postWord32(&eventBuf, info);
         break;
     }
     default:
-        barf("postCapsetModifyEvent: unknown event tag %d", tag);
+        barf("postCapsetEvent: unknown event tag %d", tag);
     }
 
     RELEASE_LOCK(&eventBufMutex);
index 6bb1404..e09da07 100644 (file)
@@ -48,11 +48,11 @@ void postCapMsg(Capability *cap, char *msg, va_list ap);
 void postEventStartup(EventCapNo n_caps);
 
 /*
- * Post a capability set modification event
+ * Post an event that is associated with a capability set
  */
-void postCapsetModifyEvent (EventTypeNum tag,
-                            EventCapsetID capset,
-                            StgWord32 other);
+void postCapsetEvent (EventTypeNum tag,
+                      EventCapsetID capset,
+                      StgWord info);
 
 /*
  * Post a capability set event with a string payload