Fix startdelay option with s/m/h/d postfix
[fio.git] / options.c
index 2369191ca748fe3572a3b816c597431c58aac987..923076752b6f6c03b979e52682c5de3c4dbf518f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -16,6 +16,8 @@
 #include "lib/fls.h"
 #include "options.h"
 
+#include "crc/crc32c.h"
+
 /*
  * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
  */
@@ -225,6 +227,21 @@ static int str_mem_cb(void *data, const char *mem)
        return 0;
 }
 
+static int str_verify_cb(void *data, const char *mem)
+{
+       struct thread_data *td = data;
+
+       if (td->o.verify != VERIFY_CRC32C_INTEL)
+               return 0;
+
+       if (!crc32c_intel_works()) {
+               log_info("fio: System does not support hw accelerated crc32c. Falling back to sw crc32c.\n");
+               td->o.verify = VERIFY_CRC32C;
+       }
+
+       return 0;
+}
+
 static int fio_clock_source_cb(void *data, const char *str)
 {
        struct thread_data *td = data;
@@ -693,6 +710,7 @@ static int str_gtod_reduce_cb(void *data, int *il)
        struct thread_data *td = data;
        int val = *il;
 
+       td->o.disable_lat = !!val;
        td->o.disable_clat = !!val;
        td->o.disable_slat = !!val;
        td->o.disable_bw = !!val;
@@ -1200,7 +1218,7 @@ static struct fio_option options[FIO_MAX_OPTS] = {
        },
        {
                .name   = "startdelay",
-               .type   = FIO_OPT_INT,
+               .type   = FIO_OPT_STR_VAL_TIME,
                .off1   = td_var_offset(start_delay),
                .help   = "Only start job when this period has passed",
                .def    = "0",
@@ -1298,6 +1316,7 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .type   = FIO_OPT_STR,
                .off1   = td_var_offset(verify),
                .help   = "Verify data written",
+               .cb     = str_verify_cb,
                .def    = "0",
                .posval = {
                          { .ival = "0",
@@ -1410,6 +1429,20 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .help   = "Number of async verifier threads to use",
                .parent = "verify",
        },
+       {
+               .name   = "verify_backlog",
+               .type   = FIO_OPT_STR_VAL,
+               .off1   = td_var_offset(verify_backlog),
+               .help   = "Verify after this number of blocks are written",
+               .parent = "verify",
+       },
+       {
+               .name   = "verify_backlog_batch",
+               .type   = FIO_OPT_INT,
+               .off1   = td_var_offset(verify_batch),
+               .help   = "Verify this number of IO blocks",
+               .parent = "verify_backlog",
+       },
 #ifdef FIO_HAVE_CPU_AFFINITY
        {
                .name   = "verify_async_cpus",
@@ -1759,6 +1792,14 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .cb     = str_gtod_reduce_cb,
                .def    = "0",
        },
+       {
+               .name   = "disable_lat",
+               .type   = FIO_OPT_BOOL,
+               .off1   = td_var_offset(disable_lat),
+               .help   = "Disable latency numbers",
+               .parent = "gtod_reduce",
+               .def    = "0",
+       },
        {
                .name   = "disable_clat",
                .type   = FIO_OPT_BOOL,