File: steadystate.h

package info (click to toggle)
fio 3.12-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,488 kB
  • sloc: ansic: 65,165; sh: 3,284; python: 1,978; makefile: 657; yacc: 204; lex: 184
file content (69 lines) | stat: -rw-r--r-- 1,454 bytes parent folder | download
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
#ifndef FIO_STEADYSTATE_H
#define FIO_STEADYSTATE_H

#include "thread_options.h"

extern void steadystate_free(struct thread_data *);
extern void steadystate_check(void);
extern void steadystate_setup(void);
extern int td_steadystate_init(struct thread_data *);
extern uint64_t steadystate_bw_mean(struct thread_stat *);
extern uint64_t steadystate_iops_mean(struct thread_stat *);

extern bool steadystate_enabled;

struct steadystate_data {
	double limit;
	unsigned long long dur;
	unsigned long long ramp_time;

	uint32_t state;

	unsigned int head;
	unsigned int tail;
	uint64_t *iops_data;
	uint64_t *bw_data;

	double slope;
	double deviation;
	double criterion;

	uint64_t sum_y;
	uint64_t sum_x;
	uint64_t sum_x_sq;
	uint64_t sum_xy;
	uint64_t oldest_y;

	struct timespec prev_time;
	uint64_t prev_iops;
	uint64_t prev_bytes;
};

enum {
	__FIO_SS_IOPS = 0,
	__FIO_SS_BW,
	__FIO_SS_SLOPE,
	__FIO_SS_ATTAINED,
	__FIO_SS_RAMP_OVER,
	__FIO_SS_DATA,
	__FIO_SS_PCT,
	__FIO_SS_BUFFER_FULL,
};

enum {
	FIO_SS_IOPS		= 1 << __FIO_SS_IOPS,
	FIO_SS_BW		= 1 << __FIO_SS_BW,
	FIO_SS_SLOPE		= 1 << __FIO_SS_SLOPE,
	FIO_SS_ATTAINED		= 1 << __FIO_SS_ATTAINED,
	FIO_SS_RAMP_OVER	= 1 << __FIO_SS_RAMP_OVER,
	FIO_SS_DATA		= 1 << __FIO_SS_DATA,
	FIO_SS_PCT		= 1 << __FIO_SS_PCT,
	FIO_SS_BUFFER_FULL	= 1 << __FIO_SS_BUFFER_FULL,

	FIO_SS_IOPS_SLOPE	= FIO_SS_IOPS | FIO_SS_SLOPE,
	FIO_SS_BW_SLOPE		= FIO_SS_BW | FIO_SS_SLOPE,
};

#define STEADYSTATE_MSEC	1000

#endif