anyWork(): count the number of times we don't find any work
authorSimon Marlow <simonmarhaskell@gmail.com>
Wed, 16 Apr 2008 21:39:45 +0000 (21:39 +0000)
committerSimon Marlow <simonmarhaskell@gmail.com>
Wed, 16 Apr 2008 21:39:45 +0000 (21:39 +0000)
rts/sm/GC.c
rts/sm/GC.h
rts/sm/Scav.c

index 250d07f..6c19a6a 100644 (file)
@@ -468,6 +468,7 @@ GarbageCollect ( rtsBool force_major_gc )
               trace(TRACE_gc,"thread %d:", i);
               trace(TRACE_gc,"   copied           %ld", gc_threads[i]->copied * sizeof(W_));
               trace(TRACE_gc,"   any_work         %ld", gc_threads[i]->any_work);
+              trace(TRACE_gc,"   no_work          %ld", gc_threads[i]->no_work);
               trace(TRACE_gc,"   scav_global_work %ld", gc_threads[i]->scav_global_work);
               trace(TRACE_gc,"   scav_local_work  %ld", gc_threads[i]->scav_local_work);
           }
@@ -1362,6 +1363,7 @@ init_gc_thread (gc_thread *t)
     t->thunk_selector_depth = 0;
     t->copied = 0;
     t->any_work = 0;
+    t->no_work = 0;
     t->scav_global_work = 0;
     t->scav_local_work = 0;
 }
index 5183837..58aa46f 100644 (file)
@@ -152,6 +152,7 @@ typedef struct gc_thread_ {
 
     lnat copied;
     lnat any_work;
+    lnat no_work;
     lnat scav_global_work;
     lnat scav_local_work;
 
index 674078f..4ba80c4 100644 (file)
@@ -1582,5 +1582,7 @@ any_work (void)
         if (ws->stp->todos) return rtsTrue;
     }
 
+    gct->no_work++;
+
     return rtsFalse;
 }