#include "RtsUtils.h"
#include "RtsFlags.h"
#include "Profiling.h"
-#include "Storage.h"
#include "Proftimer.h"
#include "Timer.h"
#include "ProfHeap.h"
#include <string.h>
+#ifdef DEBUG
+#include "Trace.h"
+#endif
+
/*
* Profiling allocation arena.
*/
}
void
+freeProfiling1 (void)
+{
+ arenaFree(prof_arena);
+}
+
+void
initProfiling2 (void)
{
CostCentreStack *ccs, *next;
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 */
{
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
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_),
reportCCS_XML(pruneCCSTree(CCS_MAIN));
fprintf(prof_file, " 0\n");
-
- fclose(prof_file);
}
static void