Merge branch 'barak/mmap_verify_only' of https://github.com/barakp/fio
authorJens Axboe <axboe@kernel.dk>
Wed, 27 Dec 2017 21:05:27 +0000 (14:05 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Dec 2017 21:05:27 +0000 (14:05 -0700)
23 files changed:
.gitignore
FIO-VERSION-GEN
HOWTO
backend.c
cconv.c
client.c
compiler/compiler.h
eta.c
filesetup.c
fio.1
fio.h
init.c
io_u.c
ioengines.c
options.c
os/windows/install.wxs
os/windows/posix.c
parse.c
parse.h
server.c
server.h
thread_options.h
tools/fio_generate_plots.1

index 463b53a7db928fcb7a0af594f295afa6c81126cb..0c8cb7c3418dff39f0c25e71115327e785d2f0af 100644 (file)
@@ -8,7 +8,19 @@
 /config.log
 /cscope.out
 /fio
+/gfio
+/t/axmap
+/t/fio-btrace2fio
+/t/fio-dedupe
+/t/fio-genzipf
+/t/fio-verify-state
+/t/gen-rand
+/t/ieee754
+/t/lfsr-test
+/t/stest
 y.tab.*
 lex.yy.c
 *.un~
 doc/output
+/tags
+/TAGS
index 22f440444e902aec71909644232a32d709e02a5e..5aed5352efb888cfaa4c2af4cdb7eff5b6785c1b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=FIO-VERSION-FILE
-DEF_VER=fio-3.2
+DEF_VER=fio-3.3
 
 LF='
 '
diff --git a/HOWTO b/HOWTO
index 4caaf542e0e4b89f4156309469e476700f4b372f..78fa6ccf4a61e623a44c0e1137f46cc416382ee8 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -173,7 +173,16 @@ Command line options
 .. option:: --eta=when
 
        Specifies when real-time ETA estimate should be printed.  `when` may be
-       `always`, `never` or `auto`.
+       `always`, `never` or `auto`. `auto` is the default, it prints ETA
+       when requested if the output is a TTY. `always` disregards the output
+       type, and prints ETA when requested. `never` never prints ETA.
+
+.. option:: --eta-interval=time
+
+       By default, fio requests client ETA status roughly every second. With
+       this option, the interval is configurable. Fio imposes a minimum
+       allowed time to avoid flooding the console, less than 250 msec is
+       not supported.
 
 .. option:: --eta-newline=time
 
@@ -2208,6 +2217,13 @@ I/O rate
        (https://en.wikipedia.org/wiki/Poisson_point_process). The lambda will be
        10^6 / IOPS for the given workload.
 
+.. option:: rate_ignore_thinktime=bool
+
+       By default, fio will attempt to catch up to the specified rate setting,
+       if any kind of thinktime setting was used. If this option is set, then
+       fio will ignore the thinktime and continue doing IO at the specified
+       rate, instead of entering a catch-up mode after thinktime is done.
+
 
 I/O latency
 ~~~~~~~~~~~
index 6c805c7f1e2b87cd23c6adb509de73d3698a2238..b4a09acae5ab0e2ccc2515a5b1251342f1dc34d9 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -844,14 +844,13 @@ static bool io_complete_bytes_exceeded(struct thread_data *td)
  */
 static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
 {
-       uint64_t secs, remainder, bps, bytes, iops;
+       uint64_t bps = td->rate_bps[ddir];
 
        assert(!(td->flags & TD_F_CHILD));
-       bytes = td->rate_io_issue_bytes[ddir];
-       bps = td->rate_bps[ddir];
 
        if (td->o.rate_process == RATE_PROCESS_POISSON) {
-               uint64_t val;
+               uint64_t val, iops;
+
                iops = bps / td->o.bs[ddir];
                val = (int64_t) (1000000 / iops) *
                                -logf(__rand_0_1(&td->poisson_state[ddir]));
@@ -863,14 +862,56 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
                td->last_usec[ddir] += val;
                return td->last_usec[ddir];
        } else if (bps) {
-               secs = bytes / bps;
-               remainder = bytes % bps;
+               uint64_t bytes = td->rate_io_issue_bytes[ddir];
+               uint64_t secs = bytes / bps;
+               uint64_t remainder = bytes % bps;
+
                return remainder * 1000000 / bps + secs * 1000000;
        }
 
        return 0;
 }
 
+static void handle_thinktime(struct thread_data *td, enum fio_ddir ddir)
+{
+       unsigned long long b;
+       uint64_t total;
+       int left;
+
+       b = ddir_rw_sum(td->io_blocks);
+       if (b % td->o.thinktime_blocks)
+               return;
+
+       io_u_quiesce(td);
+
+       total = 0;
+       if (td->o.thinktime_spin)
+               total = usec_spin(td->o.thinktime_spin);
+
+       left = td->o.thinktime - total;
+       if (left)
+               total += usec_sleep(td, left);
+
+       /*
+        * If we're ignoring thinktime for the rate, add the number of bytes
+        * we would have done while sleeping, minus one block to ensure we
+        * start issuing immediately after the sleep.
+        */
+       if (total && td->rate_bps[ddir] && td->o.rate_ign_think) {
+               uint64_t missed = (td->rate_bps[ddir] * total) / 1000000ULL;
+               uint64_t bs = td->o.min_bs[ddir];
+               uint64_t usperop = bs * 1000000ULL / td->rate_bps[ddir];
+               uint64_t over;
+
+               if (usperop <= total)
+                       over = bs;
+               else
+                       over = (usperop - total) / usperop * -bs;
+
+               td->rate_io_issue_bytes[ddir] += (missed - over);
+       }
+}
+
 /*
  * Main IO worker function. It retrieves io_u's to process and queues
  * and reaps them, checking for rate and errors along the way.
@@ -955,6 +996,7 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
                        int err = PTR_ERR(io_u);
 
                        io_u = NULL;
+                       ddir = DDIR_INVAL;
                        if (err == -EBUSY) {
                                ret = FIO_Q_BUSY;
                                goto reap;
@@ -1062,23 +1104,8 @@ reap:
                if (!in_ramp_time(td) && td->o.latency_target)
                        lat_target_check(td);
 
-               if (td->o.thinktime) {
-                       unsigned long long b;
-
-                       b = ddir_rw_sum(td->io_blocks);
-                       if (!(b % td->o.thinktime_blocks)) {
-                               int left;
-
-                               io_u_quiesce(td);
-
-                               if (td->o.thinktime_spin)
-                                       usec_spin(td->o.thinktime_spin);
-
-                               left = td->o.thinktime - td->o.thinktime_spin;
-                               if (left)
-                                       usec_sleep(td, left);
-                       }
-               }
+               if (ddir_rw(ddir) && td->o.thinktime)
+                       handle_thinktime(td, ddir);
        }
 
        check_update_rusage(td);
diff --git a/cconv.c b/cconv.c
index 5ed464065a0ed940e9c4c8298978802ea493047a..92996b1e430b744b4525d4e9390e528c496ac566 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -298,6 +298,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
 
        o->trim_backlog = le64_to_cpu(top->trim_backlog);
        o->rate_process = le32_to_cpu(top->rate_process);
+       o->rate_ign_think = le32_to_cpu(top->rate_ign_think);
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                o->percentile_list[i].u.f = fio_uint64_to_double(le64_to_cpu(top->percentile_list[i].u.i));
@@ -557,6 +558,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->offset_increment = __cpu_to_le64(o->offset_increment);
        top->number_ios = __cpu_to_le64(o->number_ios);
        top->rate_process = cpu_to_le32(o->rate_process);
+       top->rate_ign_think = cpu_to_le32(o->rate_ign_think);
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f));
index 2b136a0fc06950802dd0bf4ce7c2eb8f4d676005..18247ef6b9bd277c0e66a980b3a49679aa4f1173 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1834,6 +1834,9 @@ static void request_client_etas(struct client_ops *ops)
        struct client_eta *eta;
        int skipped = 0;
 
+       if (eta_print == FIO_ETA_NEVER)
+               return;
+
        dprint(FD_NET, "client: request eta (%d)\n", nr_clients);
 
        eta = calloc(1, sizeof(*eta) + __THREAD_RUNSTR_SZ(REAL_MAX_JOBS));
@@ -1997,7 +2000,7 @@ int fio_handle_clients(struct client_ops *ops)
                        int timeout;
 
                        fio_gettime(&ts, NULL);
-                       if (mtime_since(&eta_ts, &ts) >= 900) {
+                       if (eta_time_within_slack(mtime_since(&eta_ts, &ts))) {
                                request_client_etas(ops);
                                memcpy(&eta_ts, &ts, sizeof(ts));
 
index 20df21d050c3ba7941e705bf51140430dd7b237a..91a988369eccff1576ac60ef5c65c8cb52fb8310 100644 (file)
@@ -69,4 +69,9 @@
 
 #endif
 
+#ifdef FIO_INTERNAL
+#define ARRAY_SIZE(x)    (sizeof((x)) / (sizeof((x)[0])))
+#define FIELD_SIZE(s, f) (sizeof(((typeof(s))0)->f))
+#endif
+
 #endif
diff --git a/eta.c b/eta.c
index 1b0b000df115d4b04ff0ed614d3f9a8660e7abfb..087f57d965a015e171cd4478a2da4c5bdb5bdc4c 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -347,6 +347,14 @@ static void calc_iops(int unified_rw_rep, unsigned long mtime,
        }
 }
 
+/*
+ * Allow a little slack - if we're within 95% of the time, allow ETA.
+ */
+bool eta_time_within_slack(unsigned int time)
+{
+       return time > ((eta_interval_msec * 95) / 100);
+}
+
 /*
  * Print status of the jobs we know about. This includes rate estimates,
  * ETA, thread state, etc.
@@ -489,10 +497,7 @@ bool calc_thread_status(struct jobs_eta *je, int force)
 
        disp_time = mtime_since(&disp_prev_time, &now);
 
-       /*
-        * Allow a little slack, the target is to print it every 1000 msecs
-        */
-       if (!force && disp_time < 900)
+       if (!force && !eta_time_within_slack(disp_time))
                return false;
 
        calc_rate(unified_rw_rep, disp_time, io_bytes, disp_io_bytes, je->rate);
@@ -580,7 +585,7 @@ void display_thread_status(struct jobs_eta *je)
                        iops_str[ddir] = num2str(je->iops[ddir], 4, 1, 0, N2S_NONE);
                }
 
-               left = sizeof(output) - (p - output) - 1;
+               left = sizeof(output) - (p - output) - 2;
 
                if (je->rate[DDIR_TRIM] || je->iops[DDIR_TRIM])
                        l = snprintf(p, left,
@@ -596,6 +601,8 @@ void display_thread_status(struct jobs_eta *je)
                                rate_str[DDIR_READ], rate_str[DDIR_WRITE],
                                iops_str[DDIR_READ], iops_str[DDIR_WRITE],
                                eta_str);
+               if (l > left)
+                       l = left;
                p += l;
                if (l >= 0 && l < linelen_last)
                        p += sprintf(p, "%*s", linelen_last - l, "");
index 1d586b171e8bccad658b8a05945723d89c2ae5a6..30af085d0b33e3eb4ee6fd490fee0a01018d368b 100644 (file)
@@ -1628,8 +1628,6 @@ int add_file(struct thread_data *td, const char *fname, int numjob, int inc)
        }
 
        td->files_index++;
-       if (f->filetype == FIO_TYPE_FILE)
-               td->nr_normal_files++;
 
        if (td->o.numjobs > 1)
                set_already_allocated(file_name);
@@ -1855,7 +1853,6 @@ void free_release_files(struct thread_data *td)
        td->o.nr_files = 0;
        td->o.open_files = 0;
        td->files_index = 0;
-       td->nr_normal_files = 0;
 }
 
 void fio_file_reset(struct thread_data *td, struct fio_file *f)
diff --git a/fio.1 b/fio.1
index 54d1b0f3b55a65feda8cce23f4fb533cb885aa96..70eeeb0f6c8ca35634e98ed648b833df8299bb98 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -77,7 +77,14 @@ the I/O engine core to prevent writes due to unknown user space bug(s).
 .TP
 .BI \-\-eta \fR=\fPwhen
 Specifies when real\-time ETA estimate should be printed. \fIwhen\fR may
-be `always', `never' or `auto'.
+be `always', `never' or `auto'. `auto' is the default, it prints ETA when
+requested if the output is a TTY. `always' disregards the output type, and
+prints ETA when requested. `never' never prints ETA.
+.TP
+.BI \-\-eta\-interval \fR=\fPtime
+By default, fio requests client ETA status roughly every second. With this
+option, the interval is configurable. Fio imposes a minimum allowed time to
+avoid flooding the console, less than 250 msec is not supported.
 .TP
 .BI \-\-eta\-newline \fR=\fPtime
 Force a new line for every \fItime\fR period passed. When the unit is omitted,
@@ -1955,6 +1962,12 @@ I/Os that gets adjusted based on I/O completion rates. If this is set to
 flow, known as the Poisson process
 (\fIhttps://en.wikipedia.org/wiki/Poisson_point_process\fR). The lambda will be
 10^6 / IOPS for the given workload.
+.TP
+.BI rate_ignore_thinktime \fR=\fPbool
+By default, fio will attempt to catch up to the specified rate setting, if any
+kind of thinktime setting was used. If this option is set, then fio will
+ignore the thinktime and continue doing IO at the specified rate, instead of
+entering a catch-up mode after thinktime is done.
 .SS "I/O latency"
 .TP
 .BI latency_target \fR=\fPtime
@@ -3553,8 +3566,7 @@ containing two hostnames `h1' and `h2' with IP addresses 192.168.10.120 and
 .RE
 .SH AUTHORS
 .B fio
-was written by Jens Axboe <jens.axboe@oracle.com>,
-now Jens Axboe <axboe@fb.com>.
+was written by Jens Axboe <axboe@kernel.dk>.
 .br
 This man page was written by Aaron Carroll <aaronc@cse.unsw.edu.au> based
 on documentation by Jens Axboe.
diff --git a/fio.h b/fio.h
index 6b184c25399524994945ca63600968939abb9fdb..334f2036ac0b64646c6d30fdcc3085f0ce6099dd 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -208,7 +208,6 @@ struct thread_data {
        unsigned int files_index;
        unsigned int nr_open_files;
        unsigned int nr_done_files;
-       unsigned int nr_normal_files;
        union {
                unsigned int next_file;
                struct frand_state next_file_state;
@@ -506,6 +505,7 @@ extern uintptr_t page_mask, page_size;
 extern int read_only;
 extern int eta_print;
 extern int eta_new_line;
+extern unsigned int eta_interval_msec;
 extern unsigned long done_secs;
 extern int fio_gtod_offload;
 extern int fio_gtod_cpu;
@@ -526,6 +526,8 @@ extern char *aux_path;
 
 extern struct thread_data *threads;
 
+extern bool eta_time_within_slack(unsigned int time);
+
 static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u)
 {
        assert(!(io_u->ddir == DDIR_WRITE && !td_write(td)));
@@ -798,11 +800,6 @@ static inline void td_flags_set(struct thread_data *td, unsigned int *flags,
 extern const char *fio_get_arch_string(int);
 extern const char *fio_get_os_string(int);
 
-#ifdef FIO_INTERNAL
-#define ARRAY_SIZE(x)    (sizeof((x)) / (sizeof((x)[0])))
-#define FIELD_SIZE(s, f) (sizeof(((typeof(s))0)->f))
-#endif
-
 enum {
        __FIO_OUTPUT_TERSE      = 0,
        __FIO_OUTPUT_JSON       = 1,
diff --git a/init.c b/init.c
index c34bd1599661597b31b4701e9c8dfa00cb06e8fa..f7d79c1c8a210b0eb5530602b881f18178eccffb 100644 (file)
--- a/init.c
+++ b/init.c
@@ -11,6 +11,7 @@
 #include <sys/ipc.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <dlfcn.h>
 
 #include "fio.h"
 #ifndef FIO_NO_HAVE_SHM_H
@@ -51,6 +52,7 @@ static int nr_job_sections;
 int exitall_on_terminate = 0;
 int output_format = FIO_OUTPUT_NORMAL;
 int eta_print = FIO_ETA_AUTO;
+unsigned int eta_interval_msec = 1000;
 int eta_new_line = 0;
 FILE *f_out = NULL;
 FILE *f_err = NULL;
@@ -153,6 +155,11 @@ static struct option l_opts[FIO_NR_OPTIONS] = {
                .has_arg        = required_argument,
                .val            = 'e' | FIO_CLIENT_FLAG,
        },
+       {
+               .name           = (char *) "eta-interval",
+               .has_arg        = required_argument,
+               .val            = 'O' | FIO_CLIENT_FLAG,
+       },
        {
                .name           = (char *) "eta-newline",
                .has_arg        = required_argument,
@@ -1058,6 +1065,9 @@ int ioengine_load(struct thread_data *td)
        }
 
        if (td->io_ops) {
+               struct ioengine_ops *ops;
+               void *dlhandle;
+
                /* An engine is loaded, but the requested ioengine
                 * may have changed.
                 */
@@ -1066,6 +1076,22 @@ int ioengine_load(struct thread_data *td)
                        return 0;
                }
 
+               /*
+                * Name of file and engine may be different, load ops
+                * for this name and see if they match. If they do, then
+                * the engine is unchanged.
+                */
+               dlhandle = td->io_ops_dlhandle;
+               ops = load_ioengine(td);
+               if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle) {
+                       if (dlhandle)
+                               dlclose(dlhandle);
+                       return 0;
+               }
+
+               if (dlhandle && dlhandle != td->io_ops_dlhandle)
+                       dlclose(dlhandle);
+
                /* Unload the old engine. */
                free_ioengine(td);
        }
@@ -2142,9 +2168,7 @@ static void usage(const char *name)
        printf("  --trigger=cmd\t\tSet this command as local trigger\n");
        printf("  --trigger-remote=cmd\tSet this command as remote trigger\n");
        printf("  --aux-path=path\tUse this path for fio state generated files\n");
-       printf("\nFio was written by Jens Axboe <jens.axboe@oracle.com>");
-       printf("\n                   Jens Axboe <jaxboe@fusionio.com>");
-       printf("\n                   Jens Axboe <axboe@fb.com>\n");
+       printf("\nFio was written by Jens Axboe <axboe@kernel.dk>\n");
 }
 
 #ifdef FIO_INC_DEBUG
@@ -2506,8 +2530,31 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                                log_err("fio: failed parsing eta time %s\n", optarg);
                                exit_val = 1;
                                do_exit++;
+                               break;
                        }
                        eta_new_line = t / 1000;
+                       if (!eta_new_line) {
+                               log_err("fio: eta new line time too short\n");
+                               exit_val = 1;
+                               do_exit++;
+                       }
+                       break;
+                       }
+               case 'O': {
+                       long long t = 0;
+
+                       if (check_str_time(optarg, &t, 1)) {
+                               log_err("fio: failed parsing eta interval %s\n", optarg);
+                               exit_val = 1;
+                               do_exit++;
+                               break;
+                       }
+                       eta_interval_msec = t / 1000;
+                       if (eta_interval_msec < DISK_UTIL_MSEC) {
+                               log_err("fio: eta interval time too short (%umsec min)\n", DISK_UTIL_MSEC);
+                               exit_val = 1;
+                               do_exit++;
+                       }
                        break;
                        }
                case 'd':
diff --git a/io_u.c b/io_u.c
index 44933a185f7a780906e06edb3b0f422c28fe05e8..42d98ebfe1d6a0dc85193348a77de95667ff117f 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -759,11 +759,11 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
                        return odir;
 
                /*
-                * Both directions are ahead of rate. sleep the min
-                * switch if necissary
+                * Both directions are ahead of rate. sleep the min,
+                * switch if necessary
                 */
                if (td->rate_next_io_time[ddir] <=
-                       td->rate_next_io_time[odir]) {
+                   td->rate_next_io_time[odir]) {
                        usec = td->rate_next_io_time[ddir] - now;
                } else {
                        usec = td->rate_next_io_time[odir] - now;
@@ -775,8 +775,7 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
        if (td->o.io_submit_mode == IO_MODE_INLINE)
                io_u_quiesce(td);
 
-       usec = usec_sleep(td, usec);
-
+       usec_sleep(td, usec);
        return ddir;
 }
 
index 7951ff32e25c3e5090ebbc212731c6e0e86648a4..cec0c760f4a4a2c8c5cc089b8abc6d843dc492ea 100644 (file)
@@ -194,8 +194,10 @@ void free_ioengine(struct thread_data *td)
                td->eo = NULL;
        }
 
-       if (td->io_ops_dlhandle)
+       if (td->io_ops_dlhandle) {
                dlclose(td->io_ops_dlhandle);
+               td->io_ops_dlhandle = NULL;
+       }
 
        td->io_ops = NULL;
 }
index 3fa646c0f364c97c3671cb676e8f5ec830ac3a89..9a3431d8723147b31e783bcc60d423a589e2ae56 100644 (file)
--- a/options.c
+++ b/options.c
@@ -3459,6 +3459,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_RATE,
        },
+       {
+               .name   = "rate_ignore_thinktime",
+               .lname  = "Rate ignore thinktime",
+               .type   = FIO_OPT_BOOL,
+               .off1   = offsetof(struct thread_options, rate_ign_think),
+               .help   = "Rated IO ignores thinktime settings",
+               .parent = "rate",
+               .category = FIO_OPT_C_IO,
+               .group  = FIO_OPT_G_RATE,
+       },
        {
                .name   = "max_latency",
                .lname  = "Max Latency (usec)",
index 6dfe231d214f8790600b48f53c3a122883ed4aba..905addcb7038b25becba8ad8334ed58c7a7f5208 100755 (executable)
@@ -10,7 +10,7 @@
        <Product Id="*"
          Codepage="1252" Language="1033"
          Manufacturer="fio" Name="fio"
-         UpgradeCode="2338A332-5511-43CF-B9BD-5C60496CCFCC" Version="3.2">
+         UpgradeCode="2338A332-5511-43CF-B9BD-5C60496CCFCC" Version="3.3">
                <Package
                  Description="Flexible IO Tester"
                  InstallerVersion="301" Keywords="Installer,MSI,Database"
index 00f03355985077c08665a79e5036b60755507e40..17e18a1f77edef85a6a00f5eef8ac44fcea30ec8 100755 (executable)
@@ -228,12 +228,14 @@ void Time_tToSystemTime(time_t dosTime, SYSTEMTIME *systemTime)
 {
     FILETIME utcFT;
     LONGLONG jan1970;
+       SYSTEMTIME tempSystemTime;
 
     jan1970 = Int32x32To64(dosTime, 10000000) + 116444736000000000;
     utcFT.dwLowDateTime = (DWORD)jan1970;
     utcFT.dwHighDateTime = jan1970 >> 32;
 
-    FileTimeToSystemTime((FILETIME*)&utcFT, systemTime);
+    FileTimeToSystemTime((FILETIME*)&utcFT, &tempSystemTime);
+       SystemTimeToTzSpecificLocalTime(NULL, &tempSystemTime, systemTime);
 }
 
 char* ctime_r(const time_t *t, char *buf)
diff --git a/parse.c b/parse.c
index 68229d052d95b339f681bcde3e372b894ce50aa1..a9ee1cee42aa486deb11b504868f5763a23eecca 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -12,6 +12,7 @@
 #include <math.h>
 #include <float.h>
 
+#include "compiler/compiler.h"
 #include "parse.h"
 #include "debug.h"
 #include "options.h"
 #include "y.tab.h"
 #endif
 
+static const char *opt_type_names[] = {
+       "OPT_INVALID",
+       "OPT_STR",
+       "OPT_STR_MULTI",
+       "OPT_STR_VAL",
+       "OPT_STR_VAL_TIME",
+       "OPT_STR_STORE",
+       "OPT_RANGE",
+       "OPT_INT",
+       "OPT_BOOL",
+       "OPT_FLOAT_LIST",
+       "OPT_STR_SET",
+       "OPT_DEPRECATED",
+       "OPT_UNSUPPORTED",
+};
+
 static struct fio_option *__fio_options;
 
 static int vp_cmp(const void *p1, const void *p2)
@@ -469,6 +486,17 @@ static int str_match_len(const struct value_pair *vp, const char *str)
                        *ptr = (val);                   \
        } while (0)
 
+static const char *opt_type_name(struct fio_option *o)
+{
+       compiletime_assert(ARRAY_SIZE(opt_type_names) - 1 == FIO_OPT_UNSUPPORTED,
+                               "opt_type_names[] index");
+
+       if (o->type <= FIO_OPT_UNSUPPORTED)
+               return opt_type_names[o->type];
+
+       return "OPT_UNKNOWN?";
+}
+
 static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                           int first, int more, int curr)
 {
@@ -483,8 +511,8 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
        struct value_pair posval[PARSE_MAX_VP];
        int i, all_skipped = 1;
 
-       dprint(FD_PARSE, "__handle_option=%s, type=%d, ptr=%s\n", o->name,
-                                                       o->type, ptr);
+       dprint(FD_PARSE, "__handle_option=%s, type=%s, ptr=%s\n", o->name,
+                                                       opt_type_name(o), ptr);
 
        if (!ptr && o->type != FIO_OPT_STR_SET && o->type != FIO_OPT_STR) {
                log_err("Option %s requires an argument\n", o->name);
diff --git a/parse.h b/parse.h
index dfe7f1620c6aa762f217840dba89e663277fd7c2..d05236b07f96307ca92ead5e5d121c236e1ca07c 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -20,7 +20,7 @@ enum fio_opt_type {
        FIO_OPT_FLOAT_LIST,
        FIO_OPT_STR_SET,
        FIO_OPT_DEPRECATED,
-       FIO_OPT_UNSUPPORTED,
+       FIO_OPT_UNSUPPORTED,    /* keep this last */
 };
 
 /*
index 76d662d4ce143e1745e0749bcc69732dd30cfb2a..54d703d0b056f1b02a6baaf3d4e95011d3f0543e 100644 (file)
--- a/server.c
+++ b/server.c
@@ -844,25 +844,24 @@ static int handle_jobline_cmd(struct fio_net_cmd *cmd)
 static int handle_probe_cmd(struct fio_net_cmd *cmd)
 {
        struct cmd_client_probe_pdu *pdu = (struct cmd_client_probe_pdu *) cmd->payload;
-       struct cmd_probe_reply_pdu probe;
        uint64_t tag = cmd->tag;
+       struct cmd_probe_reply_pdu probe = {
+#ifdef CONFIG_BIG_ENDIAN
+               .bigendian      = 1,
+#endif
+               .os             = FIO_OS,
+               .arch           = FIO_ARCH,
+               .bpp            = sizeof(void *),
+               .cpus           = __cpu_to_le32(cpus_online()),
+       };
 
        dprint(FD_NET, "server: sending probe reply\n");
 
        strcpy(me, (char *) pdu->server);
 
-       memset(&probe, 0, sizeof(probe));
        gethostname((char *) probe.hostname, sizeof(probe.hostname));
-#ifdef CONFIG_BIG_ENDIAN
-       probe.bigendian = 1;
-#endif
        strncpy((char *) probe.fio_version, fio_version_string, sizeof(probe.fio_version) - 1);
 
-       probe.os        = FIO_OS;
-       probe.arch      = FIO_ARCH;
-       probe.bpp       = sizeof(void *);
-       probe.cpus      = __cpu_to_le32(cpus_online());
-
        /*
         * If the client supports compression and we do too, then enable it
         */
@@ -1826,13 +1825,12 @@ static int __fio_append_iolog_gz(struct sk_entry *first, struct io_log *log,
 
 static int fio_append_iolog_gz(struct sk_entry *first, struct io_log *log)
 {
+       z_stream stream = {
+               .zalloc = Z_NULL,
+               .zfree  = Z_NULL,
+               .opaque = Z_NULL,
+       };
        int ret = 0;
-       z_stream stream;
-
-       memset(&stream, 0, sizeof(stream));
-       stream.zalloc = Z_NULL;
-       stream.zfree = Z_NULL;
-       stream.opaque = Z_NULL;
 
        if (deflateInit(&stream, Z_DEFAULT_COMPRESSION) != Z_OK)
                return 1;
@@ -1928,16 +1926,16 @@ static int fio_append_text_log(struct sk_entry *first, struct io_log *log)
 
 int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
 {
-       struct cmd_iolog_pdu pdu;
+       struct cmd_iolog_pdu pdu = {
+               .nr_samples             = cpu_to_le64(iolog_nr_samples(log)),
+               .thread_number          = cpu_to_le32(td->thread_number),
+               .log_type               = cpu_to_le32(log->log_type),
+               .log_hist_coarseness    = cpu_to_le32(log->hist_coarseness),
+       };
        struct sk_entry *first;
        struct flist_head *entry;
        int ret = 0;
 
-       pdu.nr_samples = cpu_to_le64(iolog_nr_samples(log));
-       pdu.thread_number = cpu_to_le32(td->thread_number);
-       pdu.log_type = cpu_to_le32(log->log_type);
-       pdu.log_hist_coarseness = cpu_to_le32(log->hist_coarseness);
-
        if (!flist_empty(&log->chunk_list))
                pdu.compressed = __cpu_to_le32(STORE_COMPRESSED);
        else if (use_zlib)
@@ -1998,11 +1996,11 @@ int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
 
 void fio_server_send_add_job(struct thread_data *td)
 {
-       struct cmd_add_job_pdu pdu;
+       struct cmd_add_job_pdu pdu = {
+               .thread_number = cpu_to_le32(td->thread_number),
+               .groupid = cpu_to_le32(td->groupid),
+       };
 
-       memset(&pdu, 0, sizeof(pdu));
-       pdu.thread_number = cpu_to_le32(td->thread_number);
-       pdu.groupid = cpu_to_le32(td->groupid);
        convert_thread_options_to_net(&pdu.top, &td->o);
 
        fio_net_queue_cmd(FIO_NET_CMD_ADD_JOB, &pdu, sizeof(pdu), NULL,
@@ -2240,11 +2238,10 @@ int fio_server_parse_host(const char *host, int ipv6, struct in_addr *inp,
                ret = inet_pton(AF_INET, host, inp);
 
        if (ret != 1) {
-               struct addrinfo hints, *res;
-
-               memset(&hints, 0, sizeof(hints));
-               hints.ai_family = ipv6 ? AF_INET6 : AF_INET;
-               hints.ai_socktype = SOCK_STREAM;
+               struct addrinfo *res, hints = {
+                       .ai_family = ipv6 ? AF_INET6 : AF_INET,
+                       .ai_socktype = SOCK_STREAM,
+               };
 
                ret = getaddrinfo(host, NULL, &hints, &res);
                if (ret) {
@@ -2403,11 +2400,11 @@ static void sig_int(int sig)
 
 static void set_sig_handlers(void)
 {
-       struct sigaction act;
+       struct sigaction act = {
+               .sa_handler = sig_int,
+               .sa_flags = SA_RESTART,
+       };
 
-       memset(&act, 0, sizeof(act));
-       act.sa_handler = sig_int;
-       act.sa_flags = SA_RESTART;
        sigaction(SIGINT, &act, NULL);
 }
 
index 438a6c3eb1c8518803e4e2c5596b7793dfafdfc4..1a9b650d2577d295cae450c2e58ba52d5ada686b 100644 (file)
--- a/server.h
+++ b/server.h
@@ -49,7 +49,7 @@ struct fio_net_cmd_reply {
 };
 
 enum {
-       FIO_SERVER_VER                  = 68,
+       FIO_SERVER_VER                  = 69,
 
        FIO_SERVER_MAX_FRAGMENT_PDU     = 1024,
        FIO_SERVER_MAX_CMD_MB           = 2048,
index 793df8a587327d0224410f90e0db0e0ef36010e6..dc290b0ba197e8da091d65f4e711f5f4758f7ab5 100644 (file)
@@ -273,6 +273,7 @@ struct thread_options {
        unsigned int rate_iops[DDIR_RWDIR_CNT];
        unsigned int rate_iops_min[DDIR_RWDIR_CNT];
        unsigned int rate_process;
+       unsigned int rate_ign_think;
 
        char *ioscheduler;
 
@@ -547,6 +548,8 @@ struct thread_options_pack {
        uint32_t rate_iops[DDIR_RWDIR_CNT];
        uint32_t rate_iops_min[DDIR_RWDIR_CNT];
        uint32_t rate_process;
+       uint32_t rate_ign_think;
+       uint32_t pad;
 
        uint8_t ioscheduler[FIO_TOP_STR_MAX];
 
index 9e3c1ff9b493fbecfa95ddc210b9946be69451d7..92b24213be96ec6db493a12e1b09a62fe4dd60ea 100644 (file)
@@ -38,8 +38,7 @@ generated in the current directory.
 The script takes the title of the plot as only argument. It does
 not offer any additional options.
 .SH AUTHOR
-fio_generate_plots was written by Jens Axboe <jens.axboe@oracle.com>,
-now Jens Axboe <jaxboe@fusionio.com>.
+fio_generate_plots was written by Jens Axboe <axboe@kernel.dk>
 .PP
 This manual page was written by Martin Steigerwald <ms@teamix.de>,
 for the Debian project (but may be used by others).