summaryrefslogtreecommitdiff
path: root/rts/Threads.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-08-29 09:47:27 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-08-29 09:47:27 +0000
commita5288c551349a0adab0d931a429b10a096d9444d (patch)
tree245dd2dfd2b4e23f3fc8ae474b709289b60e5f15 /rts/Threads.c
parentc51229b2bfd3b1a61d3966db894210ef848f0a6d (diff)
downloadhaskell-a5288c551349a0adab0d931a429b10a096d9444d.tar.gz
Unify event logging and debug tracing.
- tracing facilities are now enabled with -DTRACING, and -DDEBUG additionally enables debug-tracing. -DEVENTLOG has been removed. - -debug now implies -eventlog - events can be printed to stderr instead of being sent to the binary .eventlog file by adding +RTS -v (which is implied by the +RTS -Dx options). - -Dx debug messages can be sent to the binary .eventlog file by adding +RTS -l. This should help debugging by reducing the impact of debug tracing on execution time. - Various debug messages that duplicated the information in events have been removed.
Diffstat (limited to 'rts/Threads.c')
-rw-r--r--rts/Threads.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index 8318e28ca9..3b209ea95b 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -106,11 +106,9 @@ createThread(Capability *cap, nat size)
g0s0->threads = tso;
RELEASE_LOCK(&sched_mutex);
- postEvent (cap, EVENT_CREATE_THREAD, tso->id, 0);
+ // ToDo: report the stack size in the event?
+ traceSchedEvent (cap, EVENT_CREATE_THREAD, tso, tso->stack_size);
- debugTrace(DEBUG_sched,
- "created thread %ld, stack size = %lx words",
- (long)tso->id, (long)tso->stack_size);
return tso;
}
@@ -256,10 +254,7 @@ unblockOne_ (Capability *cap, StgTSO *tso,
cap->context_switch = 1;
#endif
- postEvent (cap, EVENT_THREAD_WAKEUP, tso->id, tso->cap->no);
-
- debugTrace(DEBUG_sched, "waking up thread %ld on cap %d",
- (long)tso->id, tso->cap->no);
+ traceSchedEvent (cap, EVENT_THREAD_WAKEUP, tso, tso->cap->no);
return next;
}
@@ -357,6 +352,7 @@ printThreadBlockage(StgTSO *tso)
}
}
+
void
printThreadStatus(StgTSO *t)
{