-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.h
More file actions
142 lines (118 loc) · 2.49 KB
/
main.h
File metadata and controls
142 lines (118 loc) · 2.49 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
// Storage
long long int KB;
long long int MB;
long long int GB;
long long int K;
long long int M;
long long int G;
/*
* Information with default
*/
// partition
int NUMBER_PARTITION;
int PARTITION_SIZE;
// stream
int NUMBER_STREAM;
// cluster
int CLUSTER_SIZE;
int NUMBER_CLUSTER;
// default size
int SECTOR_SIZE;
int PAGE_SIZE;
int BLOCK_SIZE;
long long int LOGICAL_FLASH_SIZE;
long long int FLASH_SIZE;
double OVERPROVISION;
int FREE_BLOCK;
int ALLOC_PARTITION;
// x per y
int PAGE_PER_BLOCK;
int SECTOR_PER_PAGE;
int PAGE_PER_PARTITION;
int PAGE_PER_PARTITION_32; // page per partition / 32
int BLOCK_PER_PARTITION;
int PARTITION_PER_CLUSTER; //partition_size/cluster_size
int PAGE_PER_CLUSTER; //CLUSERT_SIZE/PAGE_SIZE
int PARTITION_PER_BLOCK;
int BLOCK_PER_PARTITION;
// GC point
int PARTITION_LIMIT;
int BLOCK_LIMIT;
// aging variables
double AGING_LOGICAL_ADDRESS_SPACE_PERCENTAGE;
double AGING_SEQ_PERCENTAGE;
double AGING_RANDOM_PERCENTAGE;
// trace
double TRACE_LOGICAL_ADDRESS_SPACE_PERCENTAGE;
// aging
double RANDOM_RATE;
double SEQ_RATE;
double RANDOM_MOUNT;
double RANDOM_ARRANGE;
int RANDOM_INCREASE;
int RANDOM_SIZE;
char * AGINGFILE;
// 0 : init, else size
int MSR;
int CUTTER;
int AGING_IO;
int break_GC;
int close_blockGC;
int close_partitionGC;
int MTB;
/*
* Structures
*/
// physical block
typedef struct _PB {
int *PPN2LPN; // store LPN to PPN
int *valid; // page's validity
}_PB;
// count information
typedef struct _GC {
int gc_read;
int gc_write;
int gc; // gc È£Ãâ Ƚ¼ö
int mem;
}_GC;
// count structure
typedef struct _COUNT {
int read;
int write;
struct _GC partition;
struct _GC block;
long long int IO_mem;
int IO_mem_M;
int null_p;
int overwrite;
//int nand;
}_COUNT;
_PB *PB;
_COUNT COUNT;
char * INPUT_FILENAME;
// function
int trace_parsing_filebench(FILE *fp, int* start_LPN, int *count);
int trace_parsing_msr(FILE *fp, int *start_LPN, int *count);
void command_setting(int argc, char *argv[]);
int parsing_size(char * str);
void print_count(char * file, int trace_total_write);
void count_init();
void READ_count();
void WRITE_count();
void PARTITIONGC_count();
void BLOCKGC_count();
void PARTITIONGC_READ_count();
void PARTITIONGC_WRITE_count();
void BLOCKGC_READ_count();
void BLOCKGC_WRITE_count();
//void MEM_count();
//void PARTITIONGC_MEM_count();
//void BLOCKGC_MEM_count();
void MEM_COUNT_IO(int host);
//void MEM_COUNT_IO(int MEM_HOST);