/* -----------------------------------------------------------------------------
- * $Id: ProfHeap.c,v 1.2 1999/09/16 12:29:55 simonmar Exp $
+ * $Id: ProfHeap.c,v 1.10 2000/04/03 15:54:49 simonmar Exp $
*
- * (c) The GHC Team, 1998-1999
+ * (c) The GHC Team, 1998-2000
*
* Support for heap profiling
*
#include "Rts.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
-#include "ProfRts.h"
+#include "Profiling.h"
#include "Storage.h"
#include "ProfHeap.h"
#include "Stats.h"
-#include "ProfRts.h"
#ifdef DEBUG_HEAP_PROF
#include "Printer.h"
static void initSymbolHash(void);
#endif
char prof_filename[128]; /* urk */
-FILE *prof_file;
#ifdef DEBUG_HEAP_PROF
-void initProfiling( void )
+FILE *prof_file;
+
+void initProfiling1( void )
+{
+}
+
+void initProfiling2( void )
{
initHeapProfiling();
}
return 0;
}
- sprintf(prof_filename, "%.124s.hp", prog_argv[0]);
-
- prof_file = fopen(prof_filename, "w");
- if (prof_file == NULL) {
- fprintf(stderr, "Can't open heap profiling log file %s\n",
- prof_filename);
- return 1;
- }
-
fprintf(prof_file, "JOB \"%s\"\n", prog_argv[0]);
fprintf(prof_file, "DATE \"%s\"\n", time_str());
ccs->mem_resid = 0;
for (i = ccs->indexTable; i != 0; i = i->next) {
- clearCCSResid(i->ccs);
+ if (!i->back_edge) {
+ clearCCSResid(i->ccs);
+ }
}
}
prev = ccs->prevStack;
if (prev == NULL
- || prev->cc->is_subsumed != CC_IS_BORING
+ || prev->cc->is_caf != CC_IS_BORING
|| components == 1) {
fprintf(fp,"%s",cc->label);
return;
}
for (i = ccs->indexTable; i != 0; i = i->next) {
- reportCCSResid(fp,i->ccs);
+ if (!i->back_edge) {
+ reportCCSResid(fp,i->ccs);
+ }
}
}
#endif
clear_table_data();
break;
case HEAP_BY_CLOSURE_TYPE:
+#if 0
+# error fix me
memset(closure_types, 0, N_CLOSURE_TYPES * sizeof(nat));
+#endif
break;
default:
return;
case FUN_1_1:
case FUN_0_2:
case FUN_2_0:
- case THUNK_1_0:
- case THUNK_0_1:
case THUNK_1_1:
case THUNK_0_2:
case THUNK_2_0:
size = sizeW_fromITBL(info);
break;
+ case THUNK_1_0: /* ToDo - shouldn't be here */
+ case THUNK_0_1: /* " ditto " */
case THUNK_SELECTOR:
size = sizeofW(StgHeader) + MIN_UPD_SIZE;
break;