Fix heap profiling times
[ghc.git] / rts / Stats.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2005
4 *
5 * Statistics and timing-related functions.
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef STATS_H
10 #define STATS_H
11
12 #include "GetTime.h"
13
14 #include "BeginPrivate.h"
15
16 struct gc_thread_;
17
18 void stat_startInit(void);
19 void stat_endInit(void);
20
21 void stat_startGC(struct gc_thread_ *gct);
22 void stat_endGC (struct gc_thread_ *gct, lnat alloc, lnat live,
23 lnat copied, nat gen,
24 lnat max_copied, lnat avg_copied, lnat slop);
25
26 void stat_gcWorkerThreadStart (struct gc_thread_ *gct);
27 void stat_gcWorkerThreadDone (struct gc_thread_ *gct);
28
29 #ifdef PROFILING
30 void stat_startRP(void);
31 void stat_endRP(nat,
32 #ifdef DEBUG_RETAINER
33 nat, int,
34 #endif
35 double);
36 #endif /* PROFILING */
37
38 #if defined(PROFILING) || defined(DEBUG)
39 void stat_startHeapCensus(void);
40 void stat_endHeapCensus(void);
41 #endif
42
43 void stat_startExit(void);
44 void stat_endExit(void);
45
46 void stat_exit(int alloc);
47 void stat_workerStop(void);
48
49 void initStats0(void);
50 void initStats1(void);
51
52 double mut_user_time_during_GC(void);
53 double mut_user_time_until(Ticks t);
54 double mut_user_time(void);
55
56 #ifdef PROFILING
57 double mut_user_time_during_RP(void);
58 double mut_user_time_during_heap_census(void);
59 #endif /* PROFILING */
60
61 void statDescribeGens( void );
62
63 Ticks stat_getElapsedGCTime(void);
64 Ticks stat_getElapsedTime(void);
65
66 /* Only exported for Papi.c */
67 void statsPrintf( char *s, ... )
68 GNUC3_ATTRIBUTE(format (printf, 1, 2));
69
70 #include "EndPrivate.h"
71
72 #endif /* STATS_H */