options: warn if we fail to make sense of buffer_pattern
[fio.git] / options.c
index 74347f3554e02b027d42f8012ebe96cbb9cbc716..5f4a8ec2923040ed35c89aaecacb906867cda47d 100644 (file)
--- a/options.c
+++ b/options.c
@@ -672,7 +672,7 @@ static int str_numa_mpol_cb(void *data, char *input)
                }
                td->o.numa_memnodes = strdup(nodelist);
                numa_free_nodemask(verify_bitmask);
-                
+
                break;
        case MPOL_LOCAL:
        case MPOL_DEFAULT:
@@ -985,8 +985,8 @@ static int pattern_cb(char *pattern, unsigned int max_size,
 
        if (i == 1) {
                /*
-                * The code in verify_io_u_pattern assumes a single byte pattern
-                * fills the whole verify pattern buffer.
+                * The code in verify_io_u_pattern assumes a single byte
+                * pattern fills the whole verify pattern buffer.
                 */
                memset(pattern, pattern[0], max_size);
        }
@@ -1003,10 +1003,13 @@ static int str_buffer_pattern_cb(void *data, const char *input)
        ret = pattern_cb(td->o.buffer_pattern, MAX_PATTERN_SIZE, input,
                                &td->o.buffer_pattern_bytes);
 
-       if (!ret) {
+       if (!ret && td->o.buffer_pattern_bytes) {
                td->o.refill_buffers = 0;
                td->o.scramble_buffers = 0;
                td->o.zero_buffers = 0;
+       } else {
+               log_err("fio: failed parsing pattern `%s`\n", input);
+               ret = 1;
        }
 
        return ret;
@@ -1541,7 +1544,11 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .help = "Glusterfs libgfapi(async) based engine"
                          },
 #endif
-
+#ifdef CONFIG_LIBHDFS
+                         { .ival = "libhdfs",
+                           .help = "Hadoop Distributed Filesystem (HDFS) engine"
+                         },
+#endif
                          { .ival = "external",
                            .help = "Load external engine (append name)",
                          },
@@ -3094,6 +3101,38 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_LOG,
                .group  = FIO_OPT_G_INVALID,
        },
+       {
+               .name   = "log_offset",
+               .lname  = "Log offset of IO",
+               .type   = FIO_OPT_BOOL,
+               .off1   = td_var_offset(log_offset),
+               .help   = "Include offset of IO for each log entry",
+               .def    = "0",
+               .category = FIO_OPT_C_LOG,
+               .group  = FIO_OPT_G_INVALID,
+       },
+#ifdef CONFIG_ZLIB
+       {
+               .name   = "log_compression",
+               .lname  = "Log compression",
+               .type   = FIO_OPT_INT,
+               .off1   = td_var_offset(log_gz),
+               .help   = "Log in compressed chunks of this size",
+               .minval = 32 * 1024 * 1024ULL,
+               .maxval = 512 * 1024 * 1024ULL,
+               .category = FIO_OPT_C_LOG,
+               .group  = FIO_OPT_G_INVALID,
+       },
+       {
+               .name   = "log_store_compressed",
+               .lname  = "Log store compressed",
+               .type   = FIO_OPT_BOOL,
+               .off1   = td_var_offset(log_gz_store),
+               .help   = "Store logs in a compressed format",
+               .category = FIO_OPT_C_LOG,
+               .group  = FIO_OPT_G_INVALID,
+       },
+#endif
        {
                .name   = "bwavgtime",
                .lname  = "Bandwidth average time",