Stats.h 1.7 KB
Newer Older
1
/* -----------------------------------------------------------------------------
2
 *
3
 * (c) The GHC Team, 1998-2005
4 5 6 7 8
 *
 * Statistics and timing-related functions.
 *
 * ---------------------------------------------------------------------------*/

9 10 11
#ifndef STATS_H
#define STATS_H

12
#include "GetTime.h"
13

14
#include "BeginPrivate.h"
15

Ian Lynagh's avatar
Ian Lynagh committed
16 17 18 19 20 21 22 23 24
#if defined(mingw32_HOST_OS)
/* On Win64, if we say "printf" then gcc thinks we are going to use
   MS format specifiers like %I64d rather than %llu */
#define PRINTF gnu_printf
#else
/* However, on OS X, "gnu_printf" isn't recognised */
#define PRINTF printf
#endif

Simon Marlow's avatar
Simon Marlow committed
25 26
struct gc_thread_;

27 28
void      stat_startInit(void);
void      stat_endInit(void);
29

30
void      stat_startGCSync(struct gc_thread_ *_gct);
31
void      stat_startGC(Capability *cap, struct gc_thread_ *_gct);
32 33
void      stat_endGC  (Capability *cap, struct gc_thread_ *_gct, W_ live,
                       W_ copied, W_ slop, uint32_t gen, uint32_t n_gc_threads,
Simon Marlow's avatar
Simon Marlow committed
34
                       W_ par_max_copied);
Simon Marlow's avatar
Simon Marlow committed
35

36
#ifdef PROFILING
37
void      stat_startRP(void);
38
void      stat_endRP(uint32_t,
39
#ifdef DEBUG_RETAINER
40
                            uint32_t, int,
41
#endif
42
                            double);
43
#endif /* PROFILING */
44

45
#if defined(PROFILING) || defined(DEBUG)
46 47
void      stat_startHeapCensus(void);
void      stat_endHeapCensus(void);
48 49
#endif

50 51
void      stat_startExit(void);
void      stat_endExit(void);
52

53
void      stat_exit(void);
54
void      stat_workerStop(void);
55

56 57
void      initStats0(void);
void      initStats1(void);
58

Simon Marlow's avatar
Simon Marlow committed
59
double    mut_user_time_until(Time t);
60
double    mut_user_time(void);
61

62
void      statDescribeGens( void );
sof's avatar
sof committed
63

Ben Gamari's avatar
Ben Gamari committed
64 65
Time      stat_getElapsedGCTime(void);
Time      stat_getElapsedTime(void);
mrchebas@gmail.com's avatar
mrchebas@gmail.com committed
66

67
#include "EndPrivate.h"
mrchebas@gmail.com's avatar
mrchebas@gmail.com committed
68

69
#endif /* STATS_H */