X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FProftimer.c;h=dc36df9d71cb7569f21b9315379ae613c851580c;hb=e6d14f325f2c6c580025d0dc97dd70b723b6f92a;hp=390dd6953bd0d6029cb1040b7a8cefad0bd473e6;hpb=db61851c5472bf565cd1da900b33d6e033fd743d;p=ghc-hetmet.git diff --git a/ghc/rts/Proftimer.c b/ghc/rts/Proftimer.c index 390dd69..dc36df9 100644 --- a/ghc/rts/Proftimer.c +++ b/ghc/rts/Proftimer.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Proftimer.c,v 1.8 2001/11/22 14:25:12 simonmar Exp $ + * $Id: Proftimer.c,v 1.12 2003/02/22 04:51:52 sof Exp $ * * (c) The GHC Team, 1998-1999 * @@ -11,9 +11,11 @@ #include "PosixSource.h" +#include + #include "Rts.h" #include "Profiling.h" -#include "Itimer.h" +#include "Timer.h" #include "Proftimer.h" #include "RtsFlags.h" @@ -29,17 +31,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 +49,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 +67,13 @@ initProfTimer( void ) startHeapProfTimer(); } - + void handleProfTick(void) { if (do_prof_ticks) { - CCS_TICK(CCCS); + CCCS->time_ticks++; } if (do_heap_prof_ticks) {