X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FProfiling.c;h=a8650788e95df0480f0f89b90fa449f323ae0f8e;hb=6feeea5a596026e3416ec6dcd5cae6fecaeb2e27;hp=0bb975cafc8a0828945b278c1dd557f44a884ebf;hpb=3f10646cfe2c3409056a49d1ef1c4507af522573;p=ghc-hetmet.git diff --git a/rts/Profiling.c b/rts/Profiling.c index 0bb975c..a865078 100644 --- a/rts/Profiling.c +++ b/rts/Profiling.c @@ -13,7 +13,6 @@ #include "RtsUtils.h" #include "RtsFlags.h" #include "Profiling.h" -#include "Storage.h" #include "Proftimer.h" #include "Timer.h" #include "ProfHeap.h" @@ -23,6 +22,10 @@ #include +#ifdef DEBUG +#include "Trace.h" +#endif + /* * Profiling allocation arena. */ @@ -277,7 +280,7 @@ initProfilingLogFile(void) if (RtsFlags.CcFlags.doCostCentres == COST_CENTRES_XML) { /* dump the time, and the profiling interval */ fprintf(prof_file, "\"%s\"\n", time_str()); - fprintf(prof_file, "\"%d ms\"\n", TICK_MILLISECS); + fprintf(prof_file, "\"%d ms\"\n", RtsFlags.MiscFlags.tickInterval); /* declare all the cost centres */ { @@ -353,11 +356,12 @@ CostCentreStack * PushCostCentre ( CostCentreStack *ccs, CostCentre *cc ) #define PushCostCentre _PushCostCentre { - IF_DEBUG(prof, - debugBelch("Pushing %s on ", cc->label); - debugCCS(ccs); - debugBelch("\n")); - return PushCostCentre(ccs,cc); + IF_DEBUG(prof, + traceBegin("pushing %s on ", cc->label); + debugCCS(ccs); + traceEnd();); + + return PushCostCentre(ccs,cc); } #endif @@ -731,8 +735,10 @@ reportCCSProfiling( void ) fprintf(prof_file, "\n\n"); fprintf(prof_file, "\ttotal time = %11.2f secs (%lu ticks @ %d ms)\n", - total_prof_ticks / (StgFloat) TICK_FREQUENCY, - total_prof_ticks, TICK_MILLISECS); + (double) total_prof_ticks * + (double) RtsFlags.MiscFlags.tickInterval / 1000, + (unsigned long) total_prof_ticks, + (int) RtsFlags.MiscFlags.tickInterval); fprintf(prof_file, "\ttotal alloc = %11s bytes", ullong_format_string(total_alloc * sizeof(W_), @@ -881,8 +887,6 @@ gen_XML_logfile( void ) reportCCS_XML(pruneCCSTree(CCS_MAIN)); fprintf(prof_file, " 0\n"); - - fclose(prof_file); } static void