diff options
Diffstat (limited to 'rts/Profiling.c')
-rw-r--r-- | rts/Profiling.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/rts/Profiling.c b/rts/Profiling.c index b91129ed98..a4247c7809 100644 --- a/rts/Profiling.c +++ b/rts/Profiling.c @@ -25,7 +25,7 @@ #include <fs_rts.h> #include <string.h> -#if defined(DEBUG) +#if defined(DEBUG) || defined(PROFILING) #include "Trace.h" #endif @@ -132,6 +132,19 @@ static void initProfilingLogFile ( void ); Initialise the profiling environment -------------------------------------------------------------------------- */ +static void +dumpCostCentresToEventLog(void) +{ +#if defined(PROFILING) + CostCentre *cc, *next; + for (cc = CC_LIST; cc != NULL; cc = next) { + next = cc->link; + traceHeapProfCostCentre(cc->ccID, cc->label, cc->module, + cc->srcloc, cc->is_caf); + } +#endif +} + void initProfiling (void) { // initialise our arena @@ -187,8 +200,12 @@ void initProfiling (void) if (RtsFlags.CcFlags.doCostCentres) { initTimeProfiling(); } + + dumpCostCentresToEventLog(); } + + // // Should be called after loading any new Haskell code. // @@ -278,6 +295,7 @@ initProfilingLogFile(void) void initTimeProfiling(void) { + traceProfBegin(); /* Start ticking */ startProfTimer(); }; |