/* -----------------------------------------------------------------------------
- * $Id: ProfHeap.c,v 1.1 1999/09/15 13:46:28 simonmar Exp $
+ * $Id: ProfHeap.c,v 1.9 2000/03/31 03:09:36 hwloidl Exp $
*
- * (c) The GHC Team, 1998-1999
+ * (c) The GHC Team, 1998-2000
*
* Support for heap profiling
*
#endif
char prof_filename[128]; /* urk */
+
+#ifdef DEBUG_HEAP_PROF
FILE *prof_file;
+void initProfiling1( void )
+{
+}
+
+void initProfiling2( void )
+{
+ initHeapProfiling();
+}
+
+void endProfiling( void )
+{
+ endHeapProfiling();
+}
+#endif /* DEBUG_HEAP_PROF */
+
nat
initHeapProfiling(void)
{
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);
+ }
}
}
}
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;