RTS tidyup sweep, first phase
[ghc-hetmet.git] / rts / Proftimer.c
index 3b49915..dfcc709 100644 (file)
@@ -6,17 +6,16 @@
  *
  * ---------------------------------------------------------------------------*/
 
-#if defined (PROFILING)
-
 #include "PosixSource.h"
-
 #include "Rts.h"
+
 #include "Profiling.h"
-#include "Timer.h"
 #include "Proftimer.h"
-#include "RtsFlags.h"
 
+#ifdef PROFILING
 static rtsBool do_prof_ticks = rtsFalse;       // enable profiling ticks
+#endif
+
 static rtsBool do_heap_prof_ticks = rtsFalse;  // enable heap profiling ticks
 
 // Number of ticks until next heap census
@@ -25,6 +24,8 @@ static int ticks_to_heap_profile;
 // Time for a heap profile on the next context switch
 rtsBool performHeapProfile;
 
+#ifdef PROFILING
+
 void
 stopProfTimer( void )
 {
@@ -37,6 +38,8 @@ startProfTimer( void )
     do_prof_ticks = rtsTrue;
 }
 
+#endif
+
 void
 stopHeapProfTimer( void )
 {
@@ -57,9 +60,6 @@ initProfTimer( void )
 {
     performHeapProfile = rtsFalse;
 
-    RtsFlags.ProfFlags.profileIntervalTicks = 
-       RtsFlags.ProfFlags.profileInterval / TICK_MILLISECS;
-
     ticks_to_heap_profile = RtsFlags.ProfFlags.profileIntervalTicks;
 
     startHeapProfTimer();
@@ -69,9 +69,11 @@ initProfTimer( void )
 void
 handleProfTick(void)
 {
+#ifdef PROFILING
     if (do_prof_ticks) {
        CCCS->time_ticks++;
     }
+#endif
 
     if (do_heap_prof_ticks) {
        ticks_to_heap_profile--;
@@ -81,5 +83,3 @@ handleProfTick(void)
        }
     }
 }
-
-#endif /* PROFILING */