X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=593f717149050fac1d5b206b53a27b7139e44af3;hp=3a3321f7b9d6a3d9b0b5bbf4b8da1d283182c3e3;hb=e6f735f0f0e402ca43f589224ccfa2fdf37fa583;hpb=b26317c97b8bcca7cc9144ea6e1d4ed753f2311a diff --git a/options.c b/options.c index 3a3321f7..593f7171 100644 --- a/options.c +++ b/options.c @@ -133,7 +133,7 @@ static int bssplit_ddir(struct thread_options *o, int ddir, char *str) perc += bsp->perc; } - if (perc > 100) { + if (perc > 100 && perc_missing > 1) { log_err("fio: bssplit percentages add to more than 100%%\n"); free(bssplit); return 1; @@ -143,6 +143,8 @@ static int bssplit_ddir(struct thread_options *o, int ddir, char *str) * them. */ if (perc_missing) { + if (perc_missing == 1) + perc = 100; for (i = 0; i < o->bssplit_nr[ddir]; i++) { struct bssplit *bsp = &bssplit[i]; @@ -672,7 +674,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: @@ -930,6 +932,29 @@ static int pattern_cb(char *pattern, unsigned int max_size, uint32_t pattern_length; char *loc1, *loc2; + /* + * Check if it's a string input + */ + loc1 = strchr(input, '\"'); + if (loc1) { + do { + loc1++; + if (*loc1 == '\0' || *loc1 == '\"') + break; + + pattern[i] = *loc1; + i++; + } while (i < max_size); + + if (!i) + return 1; + + goto fill; + } + + /* + * No string, find out if it's decimal or hexidecimal + */ loc1 = strstr(input, "0x"); loc2 = strstr(input, "0X"); if (loc1 || loc2) @@ -966,6 +991,7 @@ static int pattern_cb(char *pattern, unsigned int max_size, * Fill the pattern all the way to the end. This greatly reduces * the number of memcpy's we have to do when verifying the IO. */ +fill: pattern_length = i; while (i > 1 && i * 2 <= max_size) { memcpy(&pattern[i], &pattern[0], i); @@ -985,8 +1011,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 +1029,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; @@ -1021,6 +1050,16 @@ static int str_buffer_compress_cb(void *data, unsigned long long *il) return 0; } +static int str_dedupe_cb(void *data, unsigned long long *il) +{ + struct thread_data *td = data; + + td->flags |= TD_F_COMPRESS; + td->o.dedupe_percentage = *il; + td->o.refill_buffers = 1; + return 0; +} + static int str_verify_pattern_cb(void *data, const char *input) { struct thread_data *td = data; @@ -1541,7 +1580,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)", }, @@ -3223,6 +3266,18 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_IO, .group = FIO_OPT_G_IO_BUF, }, + { + .name = "dedupe_percentage", + .lname = "Dedupe percentage", + .type = FIO_OPT_INT, + .cb = str_dedupe_cb, + .maxval = 100, + .minval = 0, + .help = "Percentage of buffers that are dedupable", + .interval = 1, + .category = FIO_OPT_C_IO, + .group = FIO_OPT_G_IO_BUF, + }, { .name = "clat_percentiles", .lname = "Completion latency percentiles",