Add options to have fio latency profile a device
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 965d7d9c7a4c0804396e91c149a3165381b7bff7..a0927bd9d60cebb8c03a873280ac097459be0390 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -39,6 +39,7 @@
 #include "server.h"
 #include "stat.h"
 #include "flow.h"
+#include "io_u_queue.h"
 
 #ifdef CONFIG_SOLARISAIO
 #include <sys/asynch.h>
@@ -81,7 +82,9 @@ enum {
        FIO_RAND_FILE_SIZE_OFF,
        FIO_RAND_TRIM_OFF,
        FIO_RAND_BUF_OFF,
-       FIO_RAND_SEQ_RAND_OFF,
+       FIO_RAND_SEQ_RAND_READ_OFF,
+       FIO_RAND_SEQ_RAND_WRITE_OFF,
+       FIO_RAND_SEQ_RAND_TRIM_OFF,
        FIO_RAND_NR_OFFS,
 };
 
@@ -193,9 +196,9 @@ struct thread_data {
        /*
         * List of free and busy io_u's
         */
-       struct flist_head io_u_freelist;
-       struct flist_head io_u_busylist;
-       struct flist_head io_u_requeues;
+       struct io_u_ring io_u_requeues;
+       struct io_u_queue io_u_freelist;
+       struct io_u_queue io_u_all;
        pthread_mutex_t io_u_lock;
        pthread_cond_t free_cond;
 
@@ -245,6 +248,16 @@ struct thread_data {
        unsigned int tv_cache_mask;
        unsigned int ramp_time_over;
 
+       /*
+        * Time since last latency_window was started
+        */
+       struct timeval latency_ts;
+       unsigned int latency_qd;
+       unsigned int latency_qd_high;
+       unsigned int latency_qd_low;
+       unsigned int latency_failed;
+       uint64_t latency_ios;
+
        /*
         * read/write mixed workload state
         */
@@ -260,8 +273,8 @@ struct thread_data {
         * rand/seq mixed workload state
         */
        union {
-               os_random_state_t seq_rand_state;
-               struct frand_state __seq_rand_state;
+               os_random_state_t seq_rand_state[DDIR_RWDIR_CNT];
+               struct frand_state __seq_rand_state[DDIR_RWDIR_CNT];
        };
 
        /*
@@ -403,7 +416,7 @@ extern int parse_cmd_line(int, char **, int);
 extern int fio_backend(void);
 extern void reset_fio_state(void);
 extern void clear_io_state(struct thread_data *);
-extern int fio_options_parse(struct thread_data *, char **, int);
+extern int fio_options_parse(struct thread_data *, char **, int, int);
 extern void fio_keywords_init(void);
 extern int fio_cmd_option_parse(struct thread_data *, const char *, char *);
 extern int fio_cmd_ioengine_option_parse(struct thread_data *, const char *, char *);
@@ -417,6 +430,7 @@ extern void td_fill_rand_seeds(struct thread_data *);
 extern void add_job_opts(const char **, int);
 extern char *num2str(unsigned long, int, int, int, int);
 extern int ioengine_load(struct thread_data *);
+extern int parse_dryrun(void);
 
 extern uintptr_t page_mask;
 extern uintptr_t page_size;
@@ -475,10 +489,16 @@ extern void reset_all_stats(struct thread_data *);
  * blktrace support
  */
 #ifdef FIO_HAVE_BLKTRACE
-extern int is_blktrace(const char *);
-extern int load_blktrace(struct thread_data *, const char *);
+extern int is_blktrace(const char *, int *);
+extern int load_blktrace(struct thread_data *, const char *, int);
 #endif
 
+/*
+ * Latency target helpers
+ */
+extern void lat_target_check(struct thread_data *);
+extern void lat_target_init(struct thread_data *);
+
 #define for_each_td(td, i)     \
        for ((i) = 0, (td) = &threads[0]; (i) < (int) thread_number; (i)++, (td)++)
 #define for_each_file(td, f, i)        \