steadystate: add line for output-format=normal
[fio.git] / steadystate.h
index 5342b2cd283844b9cd63bb860582e38303eeef67..441817a85a4e949d3b24ac8ad511865c5f440636 100644 (file)
@@ -5,7 +5,9 @@
 
 extern void steadystate_check(void);
 extern void steadystate_setup(void);
-extern void steadystate_alloc(struct thread_data *);
+extern int td_steadystate_init(struct thread_data *);
+extern unsigned long long steadystate_bw_mean(struct steadystate_data *);
+extern unsigned long long steadystate_iops_mean(struct steadystate_data *);
 
 extern bool steadystate_enabled;
 
@@ -16,13 +18,8 @@ struct steadystate_data {
        double limit;
        unsigned long long dur;
        unsigned long long ramp_time;
-       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;
@@ -45,24 +42,20 @@ struct steadystate_data {
 };
 
 enum {
-       FIO_STEADYSTATE_IOPS    = 0,
-       FIO_STEADYSTATE_IOPS_SLOPE,
-       FIO_STEADYSTATE_BW,
-       FIO_STEADYSTATE_BW_SLOPE,
+       __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
 
-static inline bool steadystate_check_slope(struct thread_options *o)
-{
-       return o->ss == FIO_STEADYSTATE_IOPS_SLOPE ||
-               o->ss == FIO_STEADYSTATE_BW_SLOPE;
-}
-
-static inline bool steadystate_check_iops(struct thread_options *o)
-{
-       return o->ss == FIO_STEADYSTATE_IOPS ||
-               o->ss == FIO_STEADYSTATE_IOPS_SLOPE;
-}
-
 #endif