Remove the Unicode alternative for ".." (#3894)
[ghc-hetmet.git] / rts / Trace.c
index a1da991..be3fff7 100644 (file)
@@ -204,7 +204,7 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag,
         debugBelch("cap %d: GC done\n", cap->no);
         break;
     default:
-        debugBelch("cap %2d: thread %lu: event %d\n\n", 
+        debugBelch("cap %d: thread %lu: event %d\n\n", 
                    cap->no, (lnat)tso->id, tag);
         break;
     }
@@ -244,7 +244,7 @@ static void traceCap_stderr(Capability *cap, char *msg, va_list ap)
     ACQUIRE_LOCK(&trace_utx);
 
     tracePreface();
-    debugBelch("cap %2d: ", cap->no);
+    debugBelch("cap %d: ", cap->no);
     vdebugBelch(msg,ap);
     debugBelch("\n");
 
@@ -299,21 +299,29 @@ void trace_(char *msg, ...)
     va_end(ap);
 }
 
-void traceUserMsg(Capability *cap, char *msg)
+static void traceFormatUserMsg(Capability *cap, char *msg, ...)
 {
+    va_list ap;
+    va_start(ap,msg);
+
 #ifdef DEBUG
     if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
-        traceCap_stderr(cap, msg, NULL);
+        traceCap_stderr(cap, msg, ap);
     } else
 #endif
     {
         if (eventlog_enabled) {
-            postUserMsg(cap, msg);
+            postUserMsg(cap, msg, ap);
         }
     }
     dtraceUserMsg(cap->no, msg);
 }
 
+void traceUserMsg(Capability *cap, char *msg)
+{
+    traceFormatUserMsg(cap, "%s", msg);
+}
+
 void traceThreadStatus_ (StgTSO *tso USED_IF_DEBUG)
 {
 #ifdef DEBUG