diff options
author | Simon Marlow <simonmar@microsoft.com> | 2006-06-08 14:42:10 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2006-06-08 14:42:10 +0000 |
commit | 5a2769f0273dd389977e8283375e7920d183bdd4 (patch) | |
tree | cc5ffb1521eca3fb4f8c59ba649c8c16b852f125 /rts/Task.c | |
parent | 3f10646cfe2c3409056a49d1ef1c4507af522573 (diff) | |
download | haskell-5a2769f0273dd389977e8283375e7920d183bdd4.tar.gz |
New tracing interface
A simple interface for generating trace messages with timestamps and
thread IDs attached to them. Most debugging output goes through this
interface now, so it is straightforward to get timestamped debugging
traces with +RTS -vt. Also, we plan to use this to generate
parallelism profiles from the trace output.
Diffstat (limited to 'rts/Task.c')
-rw-r--r-- | rts/Task.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rts/Task.c b/rts/Task.c index 9923609884..918dc559b8 100644 --- a/rts/Task.c +++ b/rts/Task.c @@ -17,6 +17,7 @@ #include "RtsFlags.h" #include "Schedule.h" #include "Hash.h" +#include "Trace.h" #if HAVE_SIGNAL_H #include <signal.h> @@ -69,7 +70,9 @@ initTaskManager (void) void stopTaskManager (void) { - IF_DEBUG(scheduler, sched_belch("stopping task manager, %d tasks still running", tasksRunning)); + debugTrace(DEBUG_sched, + "stopping task manager, %d tasks still running", + tasksRunning); } @@ -144,7 +147,7 @@ newBoundTask (void) taskEnter(task); - IF_DEBUG(scheduler,sched_belch("new task (taskCount: %d)", taskCount);); + debugTrace(DEBUG_sched, "new task (taskCount: %d)", taskCount); return task; } @@ -168,7 +171,7 @@ boundTaskExiting (Task *task) task_free_list = task; RELEASE_LOCK(&sched_mutex); - IF_DEBUG(scheduler,sched_belch("task exiting")); + debugTrace(DEBUG_sched, "task exiting"); } #ifdef THREADED_RTS @@ -182,7 +185,7 @@ discardTask (Task *task) { ASSERT_LOCK_HELD(&sched_mutex); if (!task->stopped) { - IF_DEBUG(scheduler,sched_belch("discarding task %p", TASK_ID(task))); + debugTrace(DEBUG_sched, "discarding task %p", TASK_ID(task)); task->cap = NULL; task->tso = NULL; task->stopped = rtsTrue; @@ -275,7 +278,7 @@ startWorkerTask (Capability *cap, barf("startTask: Can't create new task"); } - IF_DEBUG(scheduler,sched_belch("new worker task (taskCount: %d)", taskCount);); + debugTrace(DEBUG_sched, "new worker task (taskCount: %d)", taskCount); task->id = tid; |