static FILE *heap_file = NULL;
I_
-heap_profile_init(cc_select_str, mod_select_str, grp_select_str,
- descr_select_str, type_select_str, kind_select_str,
- argv)
- char *cc_select_str;
- char *mod_select_str;
- char *grp_select_str;
- char *descr_select_str;
- char *type_select_str;
- char *kind_select_str;
- char *argv[];
+heap_profile_init(argv)
+ char *argv[];
{
+ char *cc_select_str = RTSflags.ProfFlags.ccSelector;
+ char *mod_select_str = RTSflags.ProfFlags.modSelector;
+ char *grp_select_str = RTSflags.ProfFlags.grpSelector;
+ char *descr_select_str = RTSflags.ProfFlags.descrSelector;
+ char *type_select_str = RTSflags.ProfFlags.typeSelector;
+ char *kind_select_str = RTSflags.ProfFlags.kindSelector;
+
hash_t count, max, first;
W_ heap_prof_style;
#define NON_PROF_HS (FIXED_HS - PROF_FIXED_HDR - TICKY_FIXED_HDR)
void
-profile_closure_none(P_ closure, I_ size)
-{
- return;
-}
-
-void
profile_closure_cc(P_ closure, I_ size)
{
CostCentre cc = (CostCentre) CC_HDR(closure);
@heap_profile_setup@ is called before garbage collection to initialise
for the profile. It assigns the appropriate closure profiling function
to @heap_profile_fn@ and memoises any cost centre selection. If no
-profile is required @profile_closure_none@ is assigned.
+profile is required @heap_profile_fn@ is assigned NULL.
On completion of garbage collection @heap_profile_done@ is called. It
produces a heap profile report and resets the residency counts to 0.
\begin{code}
-void (* heap_profile_fn) PROTO((P_,I_)) = profile_closure_none;
+void (* heap_profile_fn) PROTO((P_,I_)) = NULL;
void (* profiling_fns_select[]) PROTO((P_,I_)) = {
- profile_closure_none,
+ NULL,
profile_closure_cc_select,
profile_closure_mod_select,
profile_closure_grp_select,
};
void (* profiling_fns[]) PROTO((P_,I_)) = {
- profile_closure_none,
+ NULL,
profile_closure_cc,
profile_closure_mod,
profile_closure_grp,
return;
heap_prof_style = RTSflags.ProfFlags.doHeapProfile;
- heap_profile_fn = profile_closure_none;
+ heap_profile_fn = NULL;
seconds = (previous_ticks + current_ticks) / (StgFloat)TICK_FREQUENCY;
fprintf(heap_file, "BEGIN_SAMPLE %0.2f\n", seconds);