1 /* -----------------------------------------------------------------------------
2 * $Id: ProfHeap.c,v 1.53 2004/08/13 13:10:25 simonmar Exp $
4 * (c) The GHC Team, 1998-2003
6 * Support for heap profiling
8 * ---------------------------------------------------------------------------*/
10 #if defined(DEBUG) && !defined(PROFILING)
11 #define DEBUG_HEAP_PROF
13 #undef DEBUG_HEAP_PROF
16 #if defined(PROFILING) || defined(DEBUG_HEAP_PROF)
18 #include "PosixSource.h"
22 #include "Profiling.h"
28 #include "RetainerProfile.h"
29 #include "LdvProfile.h"
37 /* -----------------------------------------------------------------------------
38 * era stores the current time period. It is the same as the
39 * number of censuses that have been performed.
42 * era must be no longer than LDV_SHIFT (15 or 30) bits.
44 * era is initialized to 1 in initHeapProfiling().
46 * max_era is initialized to 2^LDV_SHIFT in initHeapProfiling().
47 * When era reaches max_era, the profiling stops because a closure can
48 * store only up to (max_era - 1) as its creation or last use time.
49 * -------------------------------------------------------------------------- */
53 /* -----------------------------------------------------------------------------
56 * For most heap profiles each closure identity gets a simple count
57 * of live words in the heap at each census. However, if we're
58 * selecting by biography, then we have to keep the various
59 * lag/drag/void counters for each identity.
60 * -------------------------------------------------------------------------- */
61 typedef struct _counter {
66 int prim; // total size of 'inherently used' closures
67 int not_used; // total size of 'never used' closures
68 int used; // total size of 'used at least once' closures
69 int void_total; // current total size of 'destroyed without being used' closures
70 int drag_total; // current total size of 'used at least once and waiting to die'
73 struct _counter *next;
77 initLDVCtr( counter *ctr )
80 ctr->c.ldv.not_used = 0;
82 ctr->c.ldv.void_total = 0;
83 ctr->c.ldv.drag_total = 0;
87 double time; // the time in MUT time when the census is made
92 // for LDV profiling, when just displaying by LDV
100 static Census *censuses = NULL;
101 static nat n_censuses = 0;
104 static void aggregateCensusInfo( void );
107 static void dumpCensus( Census *census );
109 /* -----------------------------------------------------------------------------
110 Closure Type Profiling;
112 PROBABLY TOTALLY OUT OF DATE -- ToDo (SDM)
113 -------------------------------------------------------------------------- */
115 #ifdef DEBUG_HEAP_PROF
116 static char *type_names[] = {
122 , "CONSTR_NOCAF_STATIC"
160 , "MUT_ARR_PTRS_FROZEN"
174 #endif /* DEBUG_HEAP_PROF */
176 /* -----------------------------------------------------------------------------
177 * Find the "closure identity", which is a unique pointer reresenting
178 * the band to which this closure's heap space is attributed in the
180 * ------------------------------------------------------------------------- */
182 closureIdentity( StgClosure *p )
184 switch (RtsFlags.ProfFlags.doHeapProfile) {
188 return p->header.prof.ccs;
190 return p->header.prof.ccs->cc->module;
192 return get_itbl(p)->prof.closure_desc;
194 return get_itbl(p)->prof.closure_type;
195 case HEAP_BY_RETAINER:
196 // AFAIK, the only closures in the heap which might not have a
197 // valid retainer set are DEAD_WEAK closures.
198 if (isRetainerSetFieldValid(p))
199 return retainerSetOf(p);
204 case HEAP_BY_INFOPTR:
205 return (void *)((StgClosure *)p)->header.info;
206 case HEAP_BY_CLOSURE_TYPE:
207 return type_names[get_itbl(p)->type];
211 barf("closureIdentity");
215 /* --------------------------------------------------------------------------
216 * Profiling type predicates
217 * ----------------------------------------------------------------------- */
219 STATIC_INLINE rtsBool
220 doingLDVProfiling( void )
222 return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV
223 || RtsFlags.ProfFlags.bioSelector != NULL);
226 STATIC_INLINE rtsBool
227 doingRetainerProfiling( void )
229 return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER
230 || RtsFlags.ProfFlags.retainerSelector != NULL);
234 // Precesses a closure 'c' being destroyed whose size is 'size'.
235 // Make sure that LDV_recordDead() is not invoked on 'inherently used' closures
236 // such as TSO; they should not be involved in computing dragNew or voidNew.
238 // Even though era is checked in both LdvCensusForDead() and
239 // LdvCensusKillAll(), we still need to make sure that era is > 0 because
240 // LDV_recordDead() may be called from elsewhere in the runtime system. E.g.,
241 // when a thunk is replaced by an indirection object.
245 LDV_recordDead( StgClosure *c, nat size )
251 if (era > 0 && closureSatisfiesConstraints(c)) {
252 size -= sizeofW(StgProfHeader);
253 ASSERT(LDVW(c) != 0);
254 if ((LDVW((c)) & LDV_STATE_MASK) == LDV_STATE_CREATE) {
255 t = (LDVW((c)) & LDV_CREATE_MASK) >> LDV_SHIFT;
257 if (RtsFlags.ProfFlags.bioSelector == NULL) {
258 censuses[t].void_total += (int)size;
259 censuses[era].void_total -= (int)size;
261 id = closureIdentity(c);
262 ctr = lookupHashTable(censuses[t].hash, (StgWord)id);
263 ASSERT( ctr != NULL );
264 ctr->c.ldv.void_total += (int)size;
265 ctr = lookupHashTable(censuses[era].hash, (StgWord)id);
267 ctr = arenaAlloc(censuses[era].arena, sizeof(counter));
269 insertHashTable(censuses[era].hash, (StgWord)id, ctr);
271 ctr->next = censuses[era].ctrs;
272 censuses[era].ctrs = ctr;
274 ctr->c.ldv.void_total -= (int)size;
278 t = LDVW((c)) & LDV_LAST_MASK;
280 if (RtsFlags.ProfFlags.bioSelector == NULL) {
281 censuses[t+1].drag_total += size;
282 censuses[era].drag_total -= size;
285 id = closureIdentity(c);
286 ctr = lookupHashTable(censuses[t+1].hash, (StgWord)id);
287 ASSERT( ctr != NULL );
288 ctr->c.ldv.drag_total += (int)size;
289 ctr = lookupHashTable(censuses[era].hash, (StgWord)id);
291 ctr = arenaAlloc(censuses[era].arena, sizeof(counter));
293 insertHashTable(censuses[era].hash, (StgWord)id, ctr);
295 ctr->next = censuses[era].ctrs;
296 censuses[era].ctrs = ctr;
298 ctr->c.ldv.drag_total -= (int)size;
306 /* --------------------------------------------------------------------------
307 * Initialize censuses[era];
308 * ----------------------------------------------------------------------- */
310 initEra(Census *census)
312 census->hash = allocHashTable();
314 census->arena = newArena();
316 census->not_used = 0;
319 census->void_total = 0;
320 census->drag_total = 0;
323 /* --------------------------------------------------------------------------
324 * Increases era by 1 and initialize census[era].
325 * Reallocates gi[] and increases its size if needed.
326 * ----------------------------------------------------------------------- */
331 if (doingLDVProfiling()) {
334 if (era == max_era) {
335 prog_belch("maximum number of censuses reached; use +RTS -i to reduce");
336 stg_exit(EXIT_FAILURE);
339 if (era == n_censuses) {
341 censuses = stgReallocBytes(censuses, sizeof(Census) * n_censuses,
347 initEra( &censuses[era] );
350 /* -----------------------------------------------------------------------------
351 * DEBUG heap profiling, by info table
352 * -------------------------------------------------------------------------- */
354 #ifdef DEBUG_HEAP_PROF
356 static char *hp_filename;
358 void initProfiling1( void )
362 void initProfiling2( void )
364 if (RtsFlags.ProfFlags.doHeapProfile) {
365 /* Initialise the log file name */
366 hp_filename = stgMallocBytes(strlen(prog_name) + 6, "hpFileName");
367 sprintf(hp_filename, "%s.hp", prog_name);
369 /* open the log file */
370 if ((hp_file = fopen(hp_filename, "w")) == NULL) {
371 fprintf(stderr, "Can't open profiling report file %s\n",
373 RtsFlags.ProfFlags.doHeapProfile = 0;
381 void endProfiling( void )
385 #endif /* DEBUG_HEAP_PROF */
388 printSample(rtsBool beginSample, StgDouble sampleValue)
390 StgDouble fractionalPart, integralPart;
391 fractionalPart = modf(sampleValue, &integralPart);
392 fprintf(hp_file, "%s %d.%02d\n",
393 (beginSample ? "BEGIN_SAMPLE" : "END_SAMPLE"),
394 (int)integralPart, (int)(fractionalPart * 100 + 0.5));
397 /* --------------------------------------------------------------------------
398 * Initialize the heap profilier
399 * ----------------------------------------------------------------------- */
401 initHeapProfiling(void)
403 if (! RtsFlags.ProfFlags.doHeapProfile) {
408 if (doingLDVProfiling() && doingRetainerProfiling()) {
409 prog_belch("cannot mix -hb and -hr");
414 // we only count eras if we're doing LDV profiling. Otherwise era
417 if (doingLDVProfiling()) {
425 { // max_era = 2^LDV_SHIFT
428 for (p = 0; p < LDV_SHIFT; p++)
433 censuses = stgMallocBytes(sizeof(Census) * n_censuses, "initHeapProfiling");
435 initEra( &censuses[era] );
437 /* initProfilingLogFile(); */
438 fprintf(hp_file, "JOB \"%s", prog_name);
443 for(count = 1; count < prog_argc; count++)
444 fprintf(hp_file, " %s", prog_argv[count]);
445 fprintf(hp_file, " +RTS");
446 for(count = 0; count < rts_argc; count++)
447 fprintf(hp_file, " %s", rts_argv[count]);
449 #endif /* PROFILING */
451 fprintf(hp_file, "\"\n" );
453 fprintf(hp_file, "DATE \"%s\"\n", time_str());
455 fprintf(hp_file, "SAMPLE_UNIT \"seconds\"\n");
456 fprintf(hp_file, "VALUE_UNIT \"bytes\"\n");
458 printSample(rtsTrue, 0);
459 printSample(rtsFalse, 0);
461 #ifdef DEBUG_HEAP_PROF
462 DEBUG_LoadSymbols(prog_name);
466 if (doingRetainerProfiling()) {
467 initRetainerProfiling();
475 endHeapProfiling(void)
479 if (! RtsFlags.ProfFlags.doHeapProfile) {
484 if (doingRetainerProfiling()) {
485 endRetainerProfiling();
490 if (doingLDVProfiling()) {
493 aggregateCensusInfo();
494 for (t = 1; t < era; t++) {
495 dumpCensus( &censuses[t] );
500 seconds = mut_user_time();
501 printSample(rtsTrue, seconds);
502 printSample(rtsFalse, seconds);
510 buf_append(char *p, const char *q, char *end)
514 for (m = 0; p < end; p++, q++, m++) {
516 if (*q == '\0') { break; }
522 fprint_ccs(FILE *fp, CostCentreStack *ccs, nat max_length)
524 char buf[max_length+1], *p, *buf_end;
528 // MAIN on its own gets printed as "MAIN", otherwise we ignore MAIN.
529 if (ccs == CCS_MAIN) {
534 fprintf(fp, "(%d)", ccs->ccsID);
537 buf_end = buf + max_length + 1;
539 // keep printing components of the stack until we run out of space
540 // in the buffer. If we run out of space, end with "...".
541 for (; ccs != NULL && ccs != CCS_MAIN; ccs = ccs->prevStack) {
543 // CAF cost centres print as M.CAF, but we leave the module
544 // name out of all the others to save space.
545 if (!strcmp(ccs->cc->label,"CAF")) {
546 p += buf_append(p, ccs->cc->module, buf_end);
547 p += buf_append(p, ".CAF", buf_end);
549 if (ccs->prevStack != NULL && ccs->prevStack != CCS_MAIN) {
550 p += buf_append(p, "/", buf_end);
552 p += buf_append(p, ccs->cc->label, buf_end);
556 sprintf(buf+max_length-4, "...");
559 next_offset += written;
562 fprintf(fp, "%s", buf);
567 strMatchesSelector( char* str, char* sel )
570 // fprintf(stderr, "str_matches_selector %s %s\n", str, sel);
572 // Compare str against wherever we've got to in sel.
574 while (*p != '\0' && *sel != ',' && *sel != '\0' && *p == *sel) {
577 // Match if all of str used and have reached the end of a sel fragment.
578 if (*p == '\0' && (*sel == ',' || *sel == '\0'))
581 // No match. Advance sel to the start of the next elem.
582 while (*sel != ',' && *sel != '\0') sel++;
583 if (*sel == ',') sel++;
585 /* Run out of sel ?? */
586 if (*sel == '\0') return rtsFalse;
590 /* -----------------------------------------------------------------------------
591 * Figure out whether a closure should be counted in this census, by
592 * testing against all the specified constraints.
593 * -------------------------------------------------------------------------- */
595 closureSatisfiesConstraints( StgClosure* p )
597 #ifdef DEBUG_HEAP_PROF
598 (void)p; /* keep gcc -Wall happy */
603 // The CCS has a selected field to indicate whether this closure is
604 // deselected by not being mentioned in the module, CC, or CCS
606 if (!p->header.prof.ccs->selected) {
610 if (RtsFlags.ProfFlags.descrSelector) {
611 b = strMatchesSelector( (get_itbl((StgClosure *)p))->prof.closure_desc,
612 RtsFlags.ProfFlags.descrSelector );
613 if (!b) return rtsFalse;
615 if (RtsFlags.ProfFlags.typeSelector) {
616 b = strMatchesSelector( (get_itbl((StgClosure *)p))->prof.closure_type,
617 RtsFlags.ProfFlags.typeSelector );
618 if (!b) return rtsFalse;
620 if (RtsFlags.ProfFlags.retainerSelector) {
623 // We must check that the retainer set is valid here. One
624 // reason it might not be valid is if this closure is a
625 // a newly deceased weak pointer (i.e. a DEAD_WEAK), since
626 // these aren't reached by the retainer profiler's traversal.
627 if (isRetainerSetFieldValid((StgClosure *)p)) {
628 rs = retainerSetOf((StgClosure *)p);
630 for (i = 0; i < rs->num; i++) {
631 b = strMatchesSelector( rs->element[i]->cc->label,
632 RtsFlags.ProfFlags.retainerSelector );
633 if (b) return rtsTrue;
640 #endif /* PROFILING */
643 /* -----------------------------------------------------------------------------
644 * Aggregate the heap census info for biographical profiling
645 * -------------------------------------------------------------------------- */
648 aggregateCensusInfo( void )
652 counter *c, *d, *ctrs;
655 if (!doingLDVProfiling()) return;
657 // Aggregate the LDV counters when displaying by biography.
658 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
659 int void_total, drag_total;
661 // Now we compute void_total and drag_total for each census
664 for (t = 1; t < era; t++) { // note: start at 1, not 0
665 void_total += censuses[t].void_total;
666 drag_total += censuses[t].drag_total;
667 censuses[t].void_total = void_total;
668 censuses[t].drag_total = drag_total;
669 ASSERT( censuses[t].void_total <= censuses[t].not_used );
670 ASSERT( censuses[t].drag_total <= censuses[t].used );
676 // otherwise... we're doing a heap profile that is restricted to
677 // some combination of lag, drag, void or use. We've kept all the
678 // census info for all censuses so far, but we still need to
679 // aggregate the counters forwards.
682 acc = allocHashTable();
685 for (t = 1; t < era; t++) {
687 // first look through all the counters we're aggregating
688 for (c = ctrs; c != NULL; c = c->next) {
689 // if one of the totals is non-zero, then this closure
690 // type must be present in the heap at this census time...
691 d = lookupHashTable(censuses[t].hash, (StgWord)c->identity);
694 // if this closure identity isn't present in the
695 // census for this time period, then our running
696 // totals *must* be zero.
697 ASSERT(c->c.ldv.void_total == 0 && c->c.ldv.drag_total == 0);
699 // fprintCCS(stderr,c->identity);
700 // fprintf(stderr," census=%d void_total=%d drag_total=%d\n",
701 // t, c->c.ldv.void_total, c->c.ldv.drag_total);
703 d->c.ldv.void_total += c->c.ldv.void_total;
704 d->c.ldv.drag_total += c->c.ldv.drag_total;
705 c->c.ldv.void_total = d->c.ldv.void_total;
706 c->c.ldv.drag_total = d->c.ldv.drag_total;
708 ASSERT( c->c.ldv.void_total >= 0 );
709 ASSERT( c->c.ldv.drag_total >= 0 );
713 // now look through the counters in this census to find new ones
714 for (c = censuses[t].ctrs; c != NULL; c = c->next) {
715 d = lookupHashTable(acc, (StgWord)c->identity);
717 d = arenaAlloc( arena, sizeof(counter) );
719 insertHashTable( acc, (StgWord)c->identity, d );
720 d->identity = c->identity;
723 d->c.ldv.void_total = c->c.ldv.void_total;
724 d->c.ldv.drag_total = c->c.ldv.drag_total;
726 ASSERT( c->c.ldv.void_total >= 0 );
727 ASSERT( c->c.ldv.drag_total >= 0 );
731 freeHashTable(acc, NULL);
736 /* -----------------------------------------------------------------------------
737 * Print out the results of a heap census.
738 * -------------------------------------------------------------------------- */
740 dumpCensus( Census *census )
745 printSample(rtsTrue, census->time);
748 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
749 fprintf(hp_file, "VOID\t%u\n", census->void_total * sizeof(W_));
750 fprintf(hp_file, "LAG\t%u\n",
751 (census->not_used - census->void_total) * sizeof(W_));
752 fprintf(hp_file, "USE\t%u\n",
753 (census->used - census->drag_total) * sizeof(W_));
754 fprintf(hp_file, "INHERENT_USE\t%u\n",
755 census->prim * sizeof(W_));
756 fprintf(hp_file, "DRAG\t%u\n", census->drag_total *
758 printSample(rtsFalse, census->time);
763 for (ctr = census->ctrs; ctr != NULL; ctr = ctr->next) {
766 if (RtsFlags.ProfFlags.bioSelector != NULL) {
768 if (strMatchesSelector("lag", RtsFlags.ProfFlags.bioSelector))
769 count += ctr->c.ldv.not_used - ctr->c.ldv.void_total;
770 if (strMatchesSelector("drag", RtsFlags.ProfFlags.bioSelector))
771 count += ctr->c.ldv.drag_total;
772 if (strMatchesSelector("void", RtsFlags.ProfFlags.bioSelector))
773 count += ctr->c.ldv.void_total;
774 if (strMatchesSelector("use", RtsFlags.ProfFlags.bioSelector))
775 count += ctr->c.ldv.used - ctr->c.ldv.drag_total;
779 count = ctr->c.resid;
782 ASSERT( count >= 0 );
784 if (count == 0) continue;
786 #ifdef DEBUG_HEAP_PROF
787 switch (RtsFlags.ProfFlags.doHeapProfile) {
788 case HEAP_BY_INFOPTR:
789 fprintf(hp_file, "%s", lookupGHCName(ctr->identity));
791 case HEAP_BY_CLOSURE_TYPE:
792 fprintf(hp_file, "%s", (char *)ctr->identity);
798 switch (RtsFlags.ProfFlags.doHeapProfile) {
800 fprint_ccs(hp_file, (CostCentreStack *)ctr->identity, 25);
805 fprintf(hp_file, "%s", (char *)ctr->identity);
807 case HEAP_BY_RETAINER:
809 RetainerSet *rs = (RetainerSet *)ctr->identity;
811 // it might be the distinguished retainer set rs_MANY:
812 if (rs == &rs_MANY) {
813 fprintf(hp_file, "MANY");
817 // Mark this retainer set by negating its id, because it
818 // has appeared in at least one census. We print the
819 // values of all such retainer sets into the log file at
820 // the end. A retainer set may exist but not feature in
821 // any censuses if it arose as the intermediate retainer
822 // set for some closure during retainer set calculation.
826 // report in the unit of bytes: * sizeof(StgWord)
827 printRetainerSetShort(hp_file, rs);
831 barf("dumpCensus; doHeapProfile");
835 fprintf(hp_file, "\t%d\n", count * sizeof(W_));
838 printSample(rtsFalse, census->time);
841 /* -----------------------------------------------------------------------------
842 * Code to perform a heap census.
843 * -------------------------------------------------------------------------- */
845 heapCensusChain( Census *census, bdescr *bd )
855 for (; bd != NULL; bd = bd->link) {
857 // HACK: ignore pinned blocks, because they contain gaps.
858 // It's not clear exactly what we'd like to do here, since we
859 // can't tell which objects in the block are actually alive.
860 // Perhaps the whole block should be counted as SYSTEM memory.
861 if (bd->flags & BF_PINNED) {
866 while (p < bd->free) {
867 info = get_itbl((StgClosure *)p);
870 switch (info->type) {
877 case IND_OLDGEN_PERM:
879 case SE_CAF_BLACKHOLE:
884 case CONSTR_CHARLIKE:
898 size = sizeW_fromITBL(info);
903 size = bco_sizeW((StgBCO *)p);
913 size = sizeW_fromITBL(info);
916 case THUNK_1_0: /* ToDo - shouldn't be here */
917 case THUNK_0_1: /* " ditto " */
919 size = sizeofW(StgHeader) + MIN_UPD_SIZE;
924 size = pap_sizeW((StgPAP *)p);
928 size = ap_stack_sizeW((StgAP_STACK *)p);
933 size = arr_words_sizeW(stgCast(StgArrWords*,p));
937 case MUT_ARR_PTRS_FROZEN:
939 size = mut_arr_ptrs_sizeW((StgMutArrPtrs *)p);
944 #ifdef DEBUG_HEAP_PROF
945 size = tso_sizeW((StgTSO *)p);
948 if (RtsFlags.ProfFlags.includeTSOs) {
949 size = tso_sizeW((StgTSO *)p);
952 // Skip this TSO and move on to the next object
953 p += tso_sizeW((StgTSO *)p);
964 #ifdef DEBUG_HEAP_PROF
967 // subtract the profiling overhead
968 real_size = size - sizeofW(StgProfHeader);
971 if (closureSatisfiesConstraints((StgClosure*)p)) {
973 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
975 census->prim += real_size;
976 else if ((LDVW(p) & LDV_STATE_MASK) == LDV_STATE_CREATE)
977 census->not_used += real_size;
979 census->used += real_size;
983 identity = closureIdentity((StgClosure *)p);
985 if (identity != NULL) {
986 ctr = lookupHashTable( census->hash, (StgWord)identity );
989 if (RtsFlags.ProfFlags.bioSelector != NULL) {
991 ctr->c.ldv.prim += real_size;
992 else if ((LDVW(p) & LDV_STATE_MASK) == LDV_STATE_CREATE)
993 ctr->c.ldv.not_used += real_size;
995 ctr->c.ldv.used += real_size;
999 ctr->c.resid += real_size;
1002 ctr = arenaAlloc( census->arena, sizeof(counter) );
1004 insertHashTable( census->hash, (StgWord)identity, ctr );
1005 ctr->identity = identity;
1006 ctr->next = census->ctrs;
1010 if (RtsFlags.ProfFlags.bioSelector != NULL) {
1012 ctr->c.ldv.prim = real_size;
1013 else if ((LDVW(p) & LDV_STATE_MASK) == LDV_STATE_CREATE)
1014 ctr->c.ldv.not_used = real_size;
1016 ctr->c.ldv.used = real_size;
1020 ctr->c.resid = real_size;
1038 census = &censuses[era];
1039 census->time = mut_user_time();
1041 // calculate retainer sets if necessary
1043 if (doingRetainerProfiling()) {
1049 stat_startHeapCensus();
1052 // Traverse the heap, collecting the census info
1054 // First the small_alloc_list: we have to fix the free pointer at
1055 // the end by calling tidyAllocatedLists() first.
1056 tidyAllocateLists();
1057 heapCensusChain( census, small_alloc_list );
1059 // Now traverse the heap in each generation/step.
1060 if (RtsFlags.GcFlags.generations == 1) {
1061 heapCensusChain( census, g0s0->to_blocks );
1063 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
1064 for (s = 0; s < generations[g].n_steps; s++) {
1065 heapCensusChain( census, generations[g].steps[s].blocks );
1066 // Are we interested in large objects? might be
1067 // confusing to include the stack in a heap profile.
1068 heapCensusChain( census, generations[g].steps[s].large_objects );
1073 // dump out the census info
1075 // We can't generate any info for LDV profiling until
1076 // the end of the run...
1077 if (!doingLDVProfiling())
1078 dumpCensus( census );
1080 dumpCensus( census );
1084 // free our storage, unless we're keeping all the census info for
1085 // future restriction by biography.
1087 if (RtsFlags.ProfFlags.bioSelector == NULL)
1090 freeHashTable( census->hash, NULL/* don't free the elements */ );
1091 arenaFree( census->arena );
1092 census->hash = NULL;
1093 census->arena = NULL;
1096 // we're into the next time period now
1100 stat_endHeapCensus();
1104 #endif /* PROFILING || DEBUG_HEAP_PROF */