-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.h
More file actions
79 lines (66 loc) · 1.85 KB
/
Copy pathstats.h
File metadata and controls
79 lines (66 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* contains functions and data for statistics used in chow allocator.
* this includes statistics about the allocation itself as well as
* static properties of the program text such as the number of uses
* and defs of a variable in a given basic block.
*/
#ifndef __GUARD_STATS_H
#define __GUARD_STATS_H
/*----------------------------INCLUDES----------------------------*/
#include <Shared.h>
#include <time.h>
#include "types.h"
#include "debug.h"
namespace Stats {
/*----------------------------TYPES------------------------------*/
//usage statistics for variables
struct BBStats
{
Unsigned_Int defs;
Unsigned_Int uses;
Boolean start_with_def;
};
//statistics for allocation
struct ChowStats
{
Unsigned_Int clrInitial;
Unsigned_Int clrRemat;
Unsigned_Int clrFinal;
Unsigned_Int clrColored;
Unsigned_Int cSplits;
Unsigned_Int cSpills;
Unsigned_Int cZeroOccurrence;
Unsigned_Int cChowStores;
Unsigned_Int cChowLoads;
Unsigned_Int cInsertedCopies;
Unsigned_Int cThwartedCopies;
Unsigned_Int cSpilledOptimist;
Unsigned_Int cFoundOptimist;
};
class Timer
{
public:
typedef std::vector<std::pair<const char*, double> > SavedTimes;
private:
double elapsed_time;
const char* section;
time_t tstart;
SavedTimes saved_times;
public:
void Start(const char* = "");
double Stop();
const char* ElapsedStr();
inline double Elapsed() {return elapsed_time;}
const SavedTimes GetSavedTimes(){return saved_times;}
};
/*-------------------------VARIABLES---------------------------*/
extern ChowStats chowstats;
extern Timer program_timer;
extern Timer section_timer;
/*-------------------------FUNCTIONS---------------------------*/
void ComputeBBStats(Arena, Unsigned_Int);
BBStats GetStatsForBlock(Block* blk, LRID lrid);
void DumpAllocationStats();
void Start(const char*); //timing functions
void Stop(); //timing functions
}
#endif