-
Notifications
You must be signed in to change notification settings - Fork 0
/
ioreplayer.h
53 lines (43 loc) · 913 Bytes
/
ioreplayer.h
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
#ifndef __SCHEME_IOREPLAYER__
#define __SCHEME_IOREPLAYER__
#include <sys/types.h>
#include <pthread.h>
#include "arrayqueue.h"
#define PRNG_BUFSZ 64
#define MAX_THREADS 2048
#define MAX_ROW_LENGTH 1024
#define MAX_PATH_LENGTH 512
typedef enum {
READ_IO = 'R',
WRITE_IO = 'W'
} iotype_t;
typedef struct {
queue_t tasks;
queue_control_t control;
} task_queue_t;
typedef struct {
char filepath[MAX_PATH_LENGTH];
iotype_t iotype;
off_t offset;
size_t iosize;
long iteration;
} iotask_t;
typedef struct {
queue_t finthreads;
pthread_mutex_t mtx;
pthread_cond_t cnd;
} cleanup_queue_t;
typedef struct {
long operated_tasks;
long read_ops, write_ops;
long read_byte, write_byte;
} stats_t;
typedef struct {
pthread_t pt;
cpu_set_t cpuset;
char *buf;
task_queue_t *iotaskque;
cleanup_queue_t *cleanupque;
stats_t stats;
} threadconf_t;
#endif // __SCHEME_IOREPLAYER__