fix #3910
[ghc-hetmet.git] / rts / Trace.c
index c8a0285..53fc25a 100644 (file)
@@ -106,6 +106,14 @@ void freeTracing (void)
     }
 }
 
+void resetTracing (void)
+{
+    if (eventlog_enabled) {
+        abortEventLogging(); // abort eventlog inherited from parent
+        initEventLogging(); // child starts its own eventlog
+    }
+}
+
 /* ---------------------------------------------------------------------------
    Emitting trace messages/events
  --------------------------------------------------------------------------- */
@@ -204,7 +212,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 +252,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");