rts: Rename the nondescript initProfiling2 to refreshProfilingCCSs
[ghc.git] / rts / Profiling.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2005
4 *
5 * Support for profiling
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #pragma once
10
11 #include <stdio.h>
12
13 #include "BeginPrivate.h"
14 #include "Rts.h"
15
16 #if defined(DEBUG)
17 #include "Arena.h"
18 #endif
19
20 #if defined(PROFILING)
21 #define PROFILING_ONLY(s) s
22 #else
23 #define PROFILING_ONLY(s) doNothing()
24 #endif
25
26 void initProfiling (void);
27 void refreshProfilingCCSs (void);
28 void endProfiling (void);
29 void freeProfiling (void);
30
31 extern FILE *prof_file;
32 extern FILE *hp_file;
33
34 /* A summary of an execution of a profiled program */
35 typedef struct {
36 /* Total bytes allocated */
37 uint64_t total_alloc;
38 /* Total number of profiler ticks */
39 unsigned int total_prof_ticks;
40 } ProfilerTotals;
41
42 #if defined(PROFILING)
43
44 void reportCCSProfiling ( void );
45
46 void fprintCCS( FILE *f, CostCentreStack *ccs );
47 void fprintCCS_stderr (CostCentreStack *ccs, StgClosure *exception, StgTSO *tso);
48
49 bool ignoreCCS (CostCentreStack const *ccs);
50 bool ignoreCC (CostCentre const *cc);
51
52 #if defined(DEBUG)
53 extern Arena *prof_arena;
54
55 void debugCCS( CostCentreStack *ccs );
56 #endif
57
58 #endif
59
60 #include "EndPrivate.h"