[project @ 2005-03-10 14:03:28 by simonmar]
[ghc-hetmet.git] / ghc / rts / Proftimer.c
index 390dd69..3b49915 100644 (file)
@@ -1,5 +1,4 @@
 /* -----------------------------------------------------------------------------
- * $Id: Proftimer.c,v 1.8 2001/11/22 14:25:12 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -13,7 +12,7 @@
 
 #include "Rts.h"
 #include "Profiling.h"
-#include "Itimer.h"
+#include "Timer.h"
 #include "Proftimer.h"
 #include "RtsFlags.h"
 
@@ -29,17 +28,13 @@ rtsBool performHeapProfile;
 void
 stopProfTimer( void )
 {
-    if (time_profiling) {
-       do_prof_ticks = rtsFalse;
-    }
+    do_prof_ticks = rtsFalse;
 }
 
 void
 startProfTimer( void )
 {
-    if (time_profiling) {
-       do_prof_ticks = rtsTrue;
-    }
+    do_prof_ticks = rtsTrue;
 }
 
 void
@@ -51,7 +46,8 @@ stopHeapProfTimer( void )
 void
 startHeapProfTimer( void )
 {
-    if (RtsFlags.ProfFlags.doHeapProfile) {
+    if (RtsFlags.ProfFlags.doHeapProfile && 
+       RtsFlags.ProfFlags.profileIntervalTicks > 0) {
        do_heap_prof_ticks = rtsTrue;
     }
 }
@@ -68,13 +64,13 @@ initProfTimer( void )
 
     startHeapProfTimer();
 }
-    
+
 
 void
 handleProfTick(void)
 {
     if (do_prof_ticks) {
-       CCS_TICK(CCCS);
+       CCCS->time_ticks++;
     }
 
     if (do_heap_prof_ticks) {