1 #ifndef FIO_STEADYSTATE_H
2 #define FIO_STEADYSTATE_H
4 #include "thread_options.h"
6 extern void steadystate_check(void);
7 extern void steadystate_setup(void);
8 extern void steadystate_alloc(struct thread_data *);
10 extern bool steadystate;
13 * For steady state detection
15 struct steadystate_data {
17 unsigned long long dur;
18 unsigned long long ramp_time;
29 unsigned long *iops_data;
30 unsigned long *bw_data;
36 unsigned long long sum_y;
37 unsigned long long sum_x;
38 unsigned long long sum_x_sq;
39 unsigned long long sum_xy;
40 unsigned long long oldest_y;
42 struct timeval prev_time;
43 unsigned long long prev_iops;
44 unsigned long long prev_bytes;
48 FIO_STEADYSTATE_IOPS = 0,
49 FIO_STEADYSTATE_IOPS_SLOPE,
51 FIO_STEADYSTATE_BW_SLOPE,
54 static inline bool steadystate_check_slope(struct thread_options *o)
56 return o->ss == FIO_STEADYSTATE_IOPS_SLOPE ||
57 o->ss == FIO_STEADYSTATE_BW_SLOPE;
60 static inline bool steadystate_check_iops(struct thread_options *o)
62 return o->ss == FIO_STEADYSTATE_IOPS ||
63 o->ss == FIO_STEADYSTATE_IOPS_SLOPE;