From: simonmar Date: Thu, 30 Jan 2003 10:19:07 +0000 (+0000) Subject: [project @ 2003-01-30 10:19:07 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1219 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=674e4a46c238dfde609204e27516a629c1ede879;p=ghc-hetmet.git [project @ 2003-01-30 10:19:07 by simonmar] Quick fix for profiling after I broke it in rev. 1.68. The profiling system needs some initialisation after module registration (hs_add_root()). Since module registration now happens later, the profiling system was getting initialised too early before any cost centers had been registered. This is a quick fix; we still can't handle multiple hs_add_root()s with profiling. --- diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c index 6826f5c..fc7bf81 100644 --- a/ghc/rts/RtsStartup.c +++ b/ghc/rts/RtsStartup.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsStartup.c,v 1.69 2003/01/29 09:54:33 simonmar Exp $ + * $Id: RtsStartup.c,v 1.70 2003/01/30 10:19:07 simonmar Exp $ * * (c) The GHC Team, 1998-2002 * @@ -140,10 +140,6 @@ hs_init(int *argc, char **argv[]) initProfiling1(); #endif -#if defined(PROFILING) || defined(DEBUG) - initProfiling2(); -#endif - /* start the virtual timer 'subsystem'. */ startVirtTimer(TICK_MILLISECS); @@ -258,6 +254,12 @@ hs_add_root(void (*init_root)(void)) StgRun((StgFunPtr)stg_init, &cap.r); freeGroup(bd); + +#if defined(PROFILING) || defined(DEBUG) + // This must be done after module initialisation. + // ToDo: make this work in the presence of multiple hs_add_root()s. + initProfiling2(); +#endif } /* -----------------------------------------------------------------------------