[commit: ghc] ghc-lwc2: Sanitising debug messages (d0a6973)

Sivaramakrishnan Krishnamoorthy Chandrasekaran t-sichan at microsoft.com
Sat Apr 27 04:23:00 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : ghc-lwc2

https://github.com/ghc/ghc/commit/d0a6973ee5f19b484d0f083cde00ee415bed877a

>---------------------------------------------------------------

commit d0a6973ee5f19b484d0f083cde00ee415bed877a
Author: KC Sivaramakrishnan <chandras at cs.purdue.edu>
Date:   Fri Apr 26 19:08:52 2013 -0400

    Sanitising debug messages

>---------------------------------------------------------------

 rts/PrimOps.cmm |  3 +--
 rts/Schedule.c  | 12 ++++--------
 rts/Upcalls.c   |  8 ++++----
 3 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 072ceb8..2eee6c2 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -886,8 +886,7 @@ stg_getStatusTVarzh ( gcptr scont )
 stg_sleepCapabilityzh ()
 {
 	IF_DEBUG (scheduler,
-		ccall debugBelch ("stg_sleepCapability: thread %d\n",
-		StgTSO_id(CurrentTSO)));
+		ccall debugBelch ("stg_sleepCapability: thread %d\n", StgTSO_id(CurrentTSO)));
   StgTSO_is_sleeping (CurrentTSO) = 1::I32;
   jump stg_retryzh [];
 }
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 3adb53b..81dd6be 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -541,8 +541,8 @@ run_thread:
              * out. Why and where it happens is still a mystery?
              */
             if (t->what_next == ThreadKilled && sched_state != SCHED_SHUTTING_DOWN) {
-                debugTrace (DEBUG_sched, "Schedule: Upcall thread %d on capability %d killed\n",
-                      (int)t->id, (int)t->cap->no);
+                debugTrace (DEBUG_sched, "Schedule: Upcall thread %d on capability %d killed",
+                            (int)t->id, (int)t->cap->no);
             }
 
             if (ret == ThreadFinished) {
@@ -960,8 +960,7 @@ scheduleResumeBlockedOnForeignCall(Capability *cap USED_IF_THREADS)
         incall->uls_stat == UserLevelSchedulerBlocked) {
 
         debugTrace (DEBUG_sched, "resuming scheduler associated with task %p"
-                    " with incall %p",
-                    incall->task, incall);
+                    " with incall %p", incall->task, incall);
         //Inform the task associated with the incall that we have resumed the
         //scheduler.
         incall->uls_stat = UserLevelSchedulerRunning;
@@ -2539,11 +2538,8 @@ retry:
         }
     }
 
-    if (!done) {
-      debugTrace (DEBUG_sched, "scheduleThreadOnFreeCap: thread %d is retrying",
-                  (int)tso->id);
+    if (!done)
       goto retry;
-    }
     debugTrace (DEBUG_sched, "scheduleThreadOnFreeCap: thread %d scheduled on cap %d",
                 (int)tso->id, (int)cap0->no);
 
diff --git a/rts/Upcalls.c b/rts/Upcalls.c
index 4aacdcd..1b3d58f 100644
--- a/rts/Upcalls.c
+++ b/rts/Upcalls.c
@@ -99,8 +99,8 @@ prepareUpcallThread (Capability* cap, StgTSO* current_thread)
       initUpcallThreadOnCapability (cap);
 
     upcall_thread = cap->upcall_thread;
-    debugTrace (DEBUG_sched, "Switching to upcall_thread %d. Saving current "
-                "thread %d.", cap->upcall_thread->id,
+    debugTrace (DEBUG_sched, "cap %d: switching to upcall_thread %d. Saving current "
+                "thread %d.", (int)cap->no, cap->upcall_thread->id,
                 (current_thread == (StgTSO*)END_TSO_QUEUE)?-1:(int)current_thread->id);
 
     //Save current thread
@@ -162,8 +162,8 @@ restoreCurrentThreadIfNecessary (Capability* cap, StgTSO* current_thread) {
     //Save the upcall thread
     cap->upcall_thread = current_thread;
 
-    debugTrace (DEBUG_sched, "Saving upcall thread %d and restoring original"
-                " thread %d", current_thread->id,
+    debugTrace (DEBUG_sched, "cap %d: saving upcall thread %d and restoring original"
+                " thread %d", (int)cap->no, current_thread->id,
                 (return_thread == (StgTSO*)END_TSO_QUEUE)?-1:(int)return_thread->id);
   }
   else {





More information about the ghc-commits mailing list