X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FProftimer.c;h=dfcc7096258ef06372eb016985a3c175f29dbb86;hb=cd47700887365ca2a6af17d03e731efce65cf2ac;hp=3b499152d66b768e682ec7b8947e07b5d6438720;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/Proftimer.c b/rts/Proftimer.c index 3b49915..dfcc709 100644 --- a/rts/Proftimer.c +++ b/rts/Proftimer.c @@ -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 */