steadystate: get rid of ->ss_pct and encode this information in ->state via __FIO_SS_PCT
[fio.git] / steadystate.h
index 6cd2940908a52bfd1d2729c04171c7c10e9fe4d3..a23c45ba9efff266891eaecbe5c050d888e471e1 100644 (file)
@@ -1,11 +1,13 @@
 #ifndef FIO_STEADYSTATE_H
 #define FIO_STEADYSTATE_H
 
+#include "thread_options.h"
+
 extern void steadystate_check(void);
 extern void steadystate_setup(void);
-extern void steadystate_alloc(struct thread_data *);
-extern bool steadystate_deviation(unsigned long, unsigned long, struct thread_data *);
-extern bool steadystate_slope(unsigned long, unsigned long, struct thread_data *);
+extern int td_steadystate_init(struct thread_data *);
+
+extern bool steadystate_enabled;
 
 /*
  * For steady state detection
@@ -14,14 +16,8 @@ struct steadystate_data {
        double limit;
        unsigned long long dur;
        unsigned long long ramp_time;
-       bool (*evaluate)(unsigned long, unsigned long, struct thread_data *);
-       bool check_iops;
-       bool check_slope;
-       bool pct;
 
-       int attained;
-       int last_in_group;
-       int ramp_time_over;
+       unsigned int state;
 
        unsigned int head;
        unsigned int tail;
@@ -43,4 +39,21 @@ struct steadystate_data {
        unsigned long long prev_bytes;
 };
 
+enum {
+       __FIO_SS_IOPS           = 1,
+       __FIO_SS_BW             = 2,
+       __FIO_SS_SLOPE          = 4,
+       __FIO_SS_ATTAINED       = 8,
+       __FIO_SS_RAMP_OVER      = 16,
+       __FIO_SS_DATA           = 32,
+       __FIO_SS_PCT            = 64,
+
+       FIO_SS_IOPS             = __FIO_SS_IOPS,
+       FIO_SS_IOPS_SLOPE       = __FIO_SS_IOPS | __FIO_SS_SLOPE,
+       FIO_SS_BW               = __FIO_SS_BW,
+       FIO_SS_BW_SLOPE         = __FIO_SS_BW | __FIO_SS_SLOPE,
+};
+
+#define STEADYSTATE_MSEC       1000
+
 #endif