[project @ 2003-10-01 10:57:39 by wolfgang]
[ghc-hetmet.git] / ghc / rts / ProfHeap.c
index 3752543..27a1a41 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: ProfHeap.c,v 1.45 2003/03/24 14:46:55 simonmar Exp $
+ * $Id: ProfHeap.c,v 1.48 2003/09/23 15:38:36 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2003
  *
@@ -407,7 +407,7 @@ initHeapProfiling(void)
 
     initEra( &censuses[era] );
 
-    fprintf(hp_file, "JOB \"%s", prog_argv[0]);
+    fprintf(hp_file, "JOB \"%s", prog_name);
 
 #ifdef PROFILING
     {
@@ -432,7 +432,7 @@ initHeapProfiling(void)
     fprintf(hp_file, "END_SAMPLE 0.00\n");
 
 #ifdef DEBUG_HEAP_PROF
-    DEBUG_LoadSymbols(prog_argv[0]);
+    DEBUG_LoadSymbols(prog_name);
 #endif
 
 #ifdef PROFILING
@@ -825,6 +825,15 @@ heapCensusChain( Census *census, bdescr *bd )
     rtsBool prim;
 
     for (; bd != NULL; bd = bd->link) {
+
+       // HACK: ignore pinned blocks, because they contain gaps.
+       // It's not clear exactly what we'd like to do here, since we
+       // can't tell which objects in the block are actually alive.
+       // Perhaps the whole block should be counted as SYSTEM memory.
+       if (bd->flags & BF_PINNED) {
+           continue;
+       }
+
        p = bd->start;
        while (p < bd->free) {
            info = get_itbl((StgClosure *)p);
@@ -836,6 +845,7 @@ heapCensusChain( Census *census, bdescr *bd )
            case FUN:
            case THUNK:
            case IND_PERM:
+           case IND_OLDGEN:
            case IND_OLDGEN_PERM:
            case CAF_BLACKHOLE:
            case SE_CAF_BLACKHOLE: