steadystate: cleanups
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 7f685eaeb8b8ac302687591762670ab214efb6fd..d099da82e2653de7c9ad6a501532e1709614d742 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -41,6 +41,7 @@
 #include "flow.h"
 #include "io_u_queue.h"
 #include "workqueue.h"
+#include "steadystate.h"
 
 #ifdef CONFIG_SOLARISAIO
 #include <sys/asynch.h>
@@ -126,11 +127,10 @@ struct zone_split_index {
  * This describes a single thread/process executing a fio job.
  */
 struct thread_data {
-       struct thread_options o;
        struct flist_head opt_list;
        unsigned long flags;
+       struct thread_options o;
        void *eo;
-       char verror[FIO_VERROR_SIZE];
        pthread_t thread;
        unsigned int thread_number;
        unsigned int subjob_number;
@@ -394,6 +394,10 @@ struct thread_data {
        void *prof_data;
 
        void *pinned_mem;
+
+       struct steadystate_data ss;
+
+       char verror[FIO_VERROR_SIZE];
 };
 
 /*
@@ -468,6 +472,9 @@ extern char *trigger_remote_cmd;
 extern long long trigger_timeout;
 extern char *aux_path;
 
+extern bool steadystate;
+#define STEADYSTATE_MSEC (1000)
+
 extern struct thread_data *threads;
 
 static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u)
@@ -555,8 +562,27 @@ enum {
        TD_EXITED,
        TD_REAPED,
        TD_LAST,
+       TD_NR,
 };
 
+#define TD_ENG_FLAG_SHIFT      16
+#define TD_ENG_FLAG_MASK       ((1U << 16) - 1)
+
+static inline enum fio_ioengine_flags td_ioengine_flags(struct thread_data *td)
+{
+       return (td->flags >> TD_ENG_FLAG_SHIFT) & TD_ENG_FLAG_MASK;
+}
+
+static inline void td_set_ioengine_flags(struct thread_data *td)
+{
+       td->flags |= (td->io_ops->flags << TD_ENG_FLAG_SHIFT);
+}
+
+static inline bool td_ioengine_flagged(struct thread_data *td, unsigned int val)
+{
+       return ((td->flags >> TD_ENG_FLAG_SHIFT) & val) != 0;
+}
+
 extern void td_set_runstate(struct thread_data *, int);
 extern int td_bump_runstate(struct thread_data *, int);
 extern void td_restore_runstate(struct thread_data *, int);