server: start conversion of data structures to network friendly types
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index e93e8f3d31edcaf53feed39d1b74701fe11a59f8..b0307df9b72f33663c1517efb25c82d735c0cfb5 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -35,6 +35,7 @@ struct thread_data;
 #include "time.h"
 #include "lib/getopt.h"
 #include "lib/rand.h"
+#include "server.h"
 
 #ifdef FIO_HAVE_GUASI
 #include <guasi.h>
@@ -45,11 +46,11 @@ struct thread_data;
 #endif
 
 struct group_run_stats {
-       unsigned long long max_run[2], min_run[2];
-       unsigned long long max_bw[2], min_bw[2];
-       unsigned long long io_kb[2];
-       unsigned long long agg[2];
-       unsigned int kb_base;
+       uint64_t max_run[2], min_run[2];
+       uint64_t max_bw[2], min_bw[2];
+       uint64_t io_kb[2];
+       uint64_t agg[2];
+       uint32_t kb_base;
 };
 
 /*
@@ -174,16 +175,11 @@ enum {
 struct thread_stat {
        char *name;
        char *verror;
-       int error;
-       int groupid;
-       pid_t pid;
+       int32_t error;
+       int32_t groupid;
+       uint32_t pid;
        char *description;
-       int members;
-
-       struct io_log *slat_log;
-       struct io_log *clat_log;
-       struct io_log *lat_log;
-       struct io_log *bw_log;
+       uint32_t members;
 
        /*
         * bandwidth and latency stats
@@ -193,7 +189,7 @@ struct thread_stat {
        struct io_stat lat_stat[2];             /* total latency */
        struct io_stat bw_stat[2];              /* bandwidth stats */
 
-       unsigned long long stat_io_bytes[2];
+       uint64_t stat_io_bytes[2];
        struct timeval stat_sample_time[2];
 
        /*
@@ -201,40 +197,40 @@ struct thread_stat {
         */
        struct rusage ru_start;
        struct rusage ru_end;
-       unsigned long usr_time;
-       unsigned long sys_time;
-       unsigned long ctx;
-       unsigned long minf, majf;
+       uint64_t usr_time;
+       uint64_t sys_time;
+       uint64_t ctx;
+       uint64_t minf, majf;
 
        /*
         * IO depth and latency stats
         */
-       unsigned int clat_percentiles;
-       doublepercentile_list;
-
-       unsigned int io_u_map[FIO_IO_U_MAP_NR];
-       unsigned int io_u_submit[FIO_IO_U_MAP_NR];
-       unsigned int io_u_complete[FIO_IO_U_MAP_NR];
-       unsigned int io_u_lat_u[FIO_IO_U_LAT_U_NR];
-       unsigned int io_u_lat_m[FIO_IO_U_LAT_M_NR];
-       unsigned int io_u_plat[2][FIO_IO_U_PLAT_NR];
-       unsigned long total_io_u[3];
-       unsigned long short_io_u[3];
-       unsigned long total_submit;
-       unsigned long total_complete;
-
-       unsigned long long io_bytes[2];
-       unsigned long long runtime[2];
-       unsigned long total_run_time;
+       uint64_t clat_percentiles;
+       double *percentile_list;
+
+       uint32_t io_u_map[FIO_IO_U_MAP_NR];
+       uint32_t io_u_submit[FIO_IO_U_MAP_NR];
+       uint32_t io_u_complete[FIO_IO_U_MAP_NR];
+       uint32_t io_u_lat_u[FIO_IO_U_LAT_U_NR];
+       uint32_t io_u_lat_m[FIO_IO_U_LAT_M_NR];
+       uint32_t io_u_plat[2][FIO_IO_U_PLAT_NR];
+       uint64_t total_io_u[3];
+       uint64_t short_io_u[3];
+       uint64_t total_submit;
+       uint64_t total_complete;
+
+       uint64_t io_bytes[2];
+       uint64_t runtime[2];
+       uint64_t total_run_time;
 
        /*
         * IO Error related stats
         */
-       unsigned continue_on_error;
-       unsigned long total_err_count;
-       int first_error;
+       uint16_t continue_on_error;
+       uint64_t total_err_count;
+       int32_t first_error;
 
-       unsigned int kb_base;
+       uint32_t kb_base;
 };
 
 struct bssplit {
@@ -348,6 +344,7 @@ struct thread_options {
        enum fio_fallocate_mode fallocate_mode;
        unsigned int zero_buffers;
        unsigned int refill_buffers;
+       unsigned int scramble_buffers;
        unsigned int time_based;
        unsigned int disable_lat;
        unsigned int disable_clat;
@@ -429,6 +426,12 @@ struct thread_data {
        int thread_number;
        int groupid;
        struct thread_stat ts;
+
+       struct io_log *slat_log;
+       struct io_log *clat_log;
+       struct io_log *lat_log;
+       struct io_log *bw_log;
+
        struct fio_file **files;
        unsigned int files_size;
        unsigned int files_index;
@@ -649,6 +652,9 @@ extern int fio_gtod_cpu;
 extern enum fio_cs fio_clock_source;
 extern int warnings_fatal;
 extern int terse_version;
+extern int is_backend;
+extern int nr_clients;
+extern int log_syslog;
 
 extern struct thread_data *threads;
 
@@ -689,6 +695,9 @@ static inline int should_fsync(struct thread_data *td)
  * Init/option functions
  */
 extern int __must_check parse_options(int, char **);
+extern int parse_jobs_ini(char *, int, int);
+extern int exec_run(void);
+extern void reset_fio_state(void);
 extern int fio_options_parse(struct thread_data *, char **, int);
 extern void fio_keywords_init(void);
 extern int fio_cmd_option_parse(struct thread_data *, const char *, char *);