#ifdef PROFILING
+#include "PosixSource.h"
#include "Rts.h"
-#include "LdvProfile.h"
-#include "RtsFlags.h"
+
#include "Profiling.h"
+#include "LdvProfile.h"
#include "Stats.h"
#include "RtsUtils.h"
#include "Schedule.h"
case FUN_1_1:
case FUN_0_2:
case BLACKHOLE:
- case SE_BLACKHOLE:
case CAF_BLACKHOLE:
- case SE_CAF_BLACKHOLE:
case IND_PERM:
case IND_OLDGEN_PERM:
/*
case RET_SMALL:
case RET_BIG:
// others
- case BLOCKED_FETCH:
- case FETCH_ME:
- case FETCH_ME_BQ:
- case RBH:
- case REMOTE_REF:
case INVALID_OBJECT:
default:
barf("Invalid object in processHeapClosureForDead(): %d", info->type);
}
/* --------------------------------------------------------------------------
- * Calls processHeapClosureForDead() on every *dead* closures in the
- * small object pool.
- * ----------------------------------------------------------------------- */
-static void
-processSmallObjectPoolForDead( void )
-{
- bdescr *bd;
- StgPtr p;
-
- for (bd = g0s0->blocks; bd != NULL; bd = bd->link) {
- p = bd->start;
- while (p < bd->free) {
- p += processHeapClosureForDead((StgClosure *)p);
- while (p < bd->free && !*p) // skip slop
- p++;
- }
- ASSERT(p == bd->free);
- }
-}
-
-/* --------------------------------------------------------------------------
* Calls processHeapClosureForDead() on every *dead* closures in the closure
* chain.
* ----------------------------------------------------------------------- */
{
// Any object still in the chain is dead!
while (bd != NULL) {
- processHeapClosureForDead((StgClosure *)bd->start);
+ if (!(bd->flags & BF_PINNED)) {
+ processHeapClosureForDead((StgClosure *)bd->start);
+ }
bd = bd->link;
}
}
void
LdvCensusForDead( nat N )
{
- nat g, s;
+ nat g;
// ldvTime == 0 means that LDV profiling is currently turned off.
if (era == 0)
//
barf("Lag/Drag/Void profiling not supported with -G1");
} else {
- for (g = 0; g <= N; g++)
- for (s = 0; s < generations[g].n_steps; s++) {
- if (g == 0 && s == 0) {
- processSmallObjectPoolForDead();
- processNurseryForDead();
- processChainForDead(generations[g].steps[s].large_objects);
- } else{
- processHeapForDead(generations[g].steps[s].old_blocks);
- processChainForDead(generations[g].steps[s].large_objects);
- }
- }
+ processNurseryForDead();
+ for (g = 0; g <= N; g++) {
+ processHeapForDead(generations[g].old_blocks);
+ processChainForDead(generations[g].large_objects);
+ }
}
}