Commit 43c68d65 authored by Austin Seipp's avatar Austin Seipp
Browse files

rts: detabify/dewhitespace Trace.c


Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 514a6310
...@@ -165,7 +165,7 @@ static void tracePreface (void) ...@@ -165,7 +165,7 @@ static void tracePreface (void)
debugBelch("%12lx: ", (unsigned long)osThreadId()); debugBelch("%12lx: ", (unsigned long)osThreadId());
#endif #endif
if (RtsFlags.TraceFlags.timestamp) { if (RtsFlags.TraceFlags.timestamp) {
debugBelch("%9" FMT_Word64 ": ", stat_getElapsedTime()); debugBelch("%9" FMT_Word64 ": ", stat_getElapsedTime());
} }
} }
#endif #endif
...@@ -194,8 +194,8 @@ static char *thread_stop_reasons[] = { ...@@ -194,8 +194,8 @@ static char *thread_stop_reasons[] = {
#endif #endif
#ifdef DEBUG #ifdef DEBUG
static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag, static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag,
StgTSO *tso, StgTSO *tso,
StgWord info1 STG_UNUSED, StgWord info1 STG_UNUSED,
StgWord info2 STG_UNUSED) StgWord info2 STG_UNUSED)
{ {
...@@ -204,26 +204,26 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag, ...@@ -204,26 +204,26 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag,
tracePreface(); tracePreface();
switch (tag) { switch (tag) {
case EVENT_CREATE_THREAD: // (cap, thread) case EVENT_CREATE_THREAD: // (cap, thread)
debugBelch("cap %d: created thread %" FMT_Word "\n", debugBelch("cap %d: created thread %" FMT_Word "\n",
cap->no, (W_)tso->id); cap->no, (W_)tso->id);
break; break;
case EVENT_RUN_THREAD: // (cap, thread) case EVENT_RUN_THREAD: // (cap, thread)
debugBelch("cap %d: running thread %" FMT_Word " (%s)\n", debugBelch("cap %d: running thread %" FMT_Word " (%s)\n",
cap->no, (W_)tso->id, what_next_strs[tso->what_next]); cap->no, (W_)tso->id, what_next_strs[tso->what_next]);
break; break;
case EVENT_THREAD_RUNNABLE: // (cap, thread) case EVENT_THREAD_RUNNABLE: // (cap, thread)
debugBelch("cap %d: thread %" FMT_Word " appended to run queue\n", debugBelch("cap %d: thread %" FMT_Word " appended to run queue\n",
cap->no, (W_)tso->id); cap->no, (W_)tso->id);
break; break;
case EVENT_MIGRATE_THREAD: // (cap, thread, new_cap) case EVENT_MIGRATE_THREAD: // (cap, thread, new_cap)
debugBelch("cap %d: thread %" FMT_Word " migrating to cap %d\n", debugBelch("cap %d: thread %" FMT_Word " migrating to cap %d\n",
cap->no, (W_)tso->id, (int)info1); cap->no, (W_)tso->id, (int)info1);
break; break;
case EVENT_THREAD_WAKEUP: // (cap, thread, info1_cap) case EVENT_THREAD_WAKEUP: // (cap, thread, info1_cap)
debugBelch("cap %d: waking up thread %" FMT_Word " on cap %d\n", debugBelch("cap %d: waking up thread %" FMT_Word " on cap %d\n",
cap->no, (W_)tso->id, (int)info1); cap->no, (W_)tso->id, (int)info1);
break; break;
case EVENT_STOP_THREAD: // (cap, thread, status) case EVENT_STOP_THREAD: // (cap, thread, status)
if (info1 == 6 + BlockedOnBlackHole) { if (info1 == 6 + BlockedOnBlackHole) {
debugBelch("cap %d: thread %" FMT_Word " stopped (blocked on black hole owned by thread %lu)\n", debugBelch("cap %d: thread %" FMT_Word " stopped (blocked on black hole owned by thread %lu)\n",
...@@ -234,7 +234,7 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag, ...@@ -234,7 +234,7 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag,
} }
break; break;
default: default:
debugBelch("cap %d: thread %" FMT_Word ": event %d\n\n", debugBelch("cap %d: thread %" FMT_Word ": event %d\n\n",
cap->no, (W_)tso->id, tag); cap->no, (W_)tso->id, tag);
break; break;
} }
...@@ -243,7 +243,7 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag, ...@@ -243,7 +243,7 @@ static void traceSchedEvent_stderr (Capability *cap, EventTypeNum tag,
} }
#endif #endif
void traceSchedEvent_ (Capability *cap, EventTypeNum tag, void traceSchedEvent_ (Capability *cap, EventTypeNum tag,
StgTSO *tso, StgWord info1, StgWord info2) StgTSO *tso, StgWord info1, StgWord info2)
{ {
#ifdef DEBUG #ifdef DEBUG
...@@ -499,7 +499,7 @@ void traceOSProcessInfo_(void) { ...@@ -499,7 +499,7 @@ void traceOSProcessInfo_(void) {
} }
#ifdef DEBUG #ifdef DEBUG
static void traceSparkEvent_stderr (Capability *cap, EventTypeNum tag, static void traceSparkEvent_stderr (Capability *cap, EventTypeNum tag,
StgWord info1) StgWord info1)
{ {
ACQUIRE_LOCK(&trace_utx); ACQUIRE_LOCK(&trace_utx);
...@@ -508,7 +508,7 @@ static void traceSparkEvent_stderr (Capability *cap, EventTypeNum tag, ...@@ -508,7 +508,7 @@ static void traceSparkEvent_stderr (Capability *cap, EventTypeNum tag,
switch (tag) { switch (tag) {
case EVENT_CREATE_SPARK_THREAD: // (cap, spark_thread) case EVENT_CREATE_SPARK_THREAD: // (cap, spark_thread)
debugBelch("cap %d: creating spark thread %lu\n", debugBelch("cap %d: creating spark thread %lu\n",
cap->no, (long)info1); cap->no, (long)info1);
break; break;
case EVENT_SPARK_CREATE: // (cap) case EVENT_SPARK_CREATE: // (cap)
...@@ -516,27 +516,27 @@ static void traceSparkEvent_stderr (Capability *cap, EventTypeNum tag, ...@@ -516,27 +516,27 @@ static void traceSparkEvent_stderr (Capability *cap, EventTypeNum tag,
cap->no); cap->no);
break; break;
case EVENT_SPARK_DUD: // (cap) case EVENT_SPARK_DUD: // (cap)
debugBelch("cap %d: discarded dud spark\n", debugBelch("cap %d: discarded dud spark\n",
cap->no); cap->no);
break; break;
case EVENT_SPARK_OVERFLOW: // (cap) case EVENT_SPARK_OVERFLOW: // (cap)
debugBelch("cap %d: discarded overflowed spark\n", debugBelch("cap %d: discarded overflowed spark\n",
cap->no); cap->no);
break; break;
case EVENT_SPARK_RUN: // (cap) case EVENT_SPARK_RUN: // (cap)
debugBelch("cap %d: running a spark\n", debugBelch("cap %d: running a spark\n",
cap->no); cap->no);
break; break;
case EVENT_SPARK_STEAL: // (cap, victim_cap) case EVENT_SPARK_STEAL: // (cap, victim_cap)
debugBelch("cap %d: stealing a spark from cap %d\n", debugBelch("cap %d: stealing a spark from cap %d\n",
cap->no, (int)info1); cap->no, (int)info1);
break; break;
case EVENT_SPARK_FIZZLE: // (cap) case EVENT_SPARK_FIZZLE: // (cap)
debugBelch("cap %d: fizzled spark removed from pool\n", debugBelch("cap %d: fizzled spark removed from pool\n",
cap->no); cap->no);
break; break;
case EVENT_SPARK_GC: // (cap) case EVENT_SPARK_GC: // (cap)
debugBelch("cap %d: GCd spark removed from pool\n", debugBelch("cap %d: GCd spark removed from pool\n",
cap->no); cap->no);
break; break;
default: default:
...@@ -639,7 +639,7 @@ void traceCap_(Capability *cap, char *msg, ...) ...@@ -639,7 +639,7 @@ void traceCap_(Capability *cap, char *msg, ...)
{ {
va_list ap; va_list ap;
va_start(ap,msg); va_start(ap,msg);
#ifdef DEBUG #ifdef DEBUG
if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) { if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
traceCap_stderr(cap, msg, ap); traceCap_stderr(cap, msg, ap);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment