From 674e4a46c238dfde609204e27516a629c1ede879 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 30 Jan 2003 10:19:07 +0000 Subject: [PATCH] [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. --- ghc/rts/RtsStartup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 } /* ----------------------------------------------------------------------------- -- 1.7.10.4