(partial) Merge branch 'master' into type-nats
[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(void);
54
55 #ifdef PROFILING
56 double mut_user_time_during_RP(void);
57 double mut_user_time_during_heap_census(void);
58 #endif /* PROFILING */
59
60 void statDescribeGens( void );
61
62 Ticks stat_getElapsedGCTime(void);
63 Ticks stat_getElapsedTime(void);
64
65 /* Only exported for Papi.c */
66 void statsPrintf( char *s, ... )
67 GNUC3_ATTRIBUTE(format (printf, 1, 2));
68
69 #include "EndPrivate.h"
70
71 #endif /* STATS_H */