Commit 674e4a46 authored by simonmar's avatar simonmar
Browse files

[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.
parent 858255ab
/* -----------------------------------------------------------------------------
* $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
}
/* -----------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment