X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FProfHeap.c;h=ea71e20fd40ce0c6ea909c3eac71bcbd9facf1c8;hb=ca5ded310c0a596be199a3da5f14be2fb2020687;hp=0ee53f3e221f37bd6efd55456291b695780e5bee;hpb=16871485a44ba8a6e93e40f30af7ea46839e0c4c;p=ghc-hetmet.git diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 0ee53f3..ea71e20 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -19,7 +19,6 @@ #include "RtsUtils.h" #include "RtsFlags.h" #include "Profiling.h" -#include "Storage.h" #include "ProfHeap.h" #include "Stats.h" #include "Hash.h" @@ -138,9 +137,7 @@ static char *type_names[] = { , "RET_BCO" , "RET_SMALL" - , "RET_VEC_SMALL" , "RET_BIG" - , "RET_VEC_BIG" , "RET_DYN" , "UPDATE_FRAME" , "CATCH_FRAME" @@ -317,6 +314,13 @@ initEra(Census *census) census->drag_total = 0; } +STATIC_INLINE void +freeEra(Census *census) +{ + arenaFree(census->arena); + freeHashTable(census->hash, NULL); +} + /* -------------------------------------------------------------------------- * Increases era by 1 and initialize census[era]. * Reallocates gi[] and increases its size if needed. @@ -356,6 +360,10 @@ void initProfiling1( void ) { } +void freeProfiling1( void ) +{ +} + void initProfiling2( void ) { if (RtsFlags.ProfFlags.doHeapProfile) { @@ -494,6 +502,14 @@ endHeapProfiling(void) } #endif + { + nat t; + for (t = 0; t <= era; t++) { + freeEra( &censuses[t] ); + } + } + stgFree(censuses); + seconds = mut_user_time(); printSample(rtsTrue, seconds); printSample(rtsFalse, seconds); @@ -541,10 +557,10 @@ fprint_ccs(FILE *fp, CostCentreStack *ccs, nat max_length) p += buf_append(p, ccs->cc->module, buf_end); p += buf_append(p, ".CAF", buf_end); } else { + p += buf_append(p, ccs->cc->label, buf_end); if (ccs->prevStack != NULL && ccs->prevStack != CCS_MAIN) { p += buf_append(p, "/", buf_end); } - p += buf_append(p, ccs->cc->label, buf_end); } if (p >= buf_end) {