X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=options.c;h=b8ce5a763ce427cc733c7738cca59125e6ec7c62;hb=22f80458a520d0c5371c64bf91d24cdd21dff825;hp=fcf427037f77f0ab456efc055b725a485fbe2512;hpb=29df29eaf88958c8741103d2056a4773d4959d9d;p=fio.git diff --git a/options.c b/options.c index fcf42703..b8ce5a76 100644 --- a/options.c +++ b/options.c @@ -868,20 +868,6 @@ static int str_verify_pattern_cb(void *data, const char *input) return 0; } -static int str_lockfile_cb(void *data, const char *str) -{ - struct thread_data *td = data; - char *nr = get_opt_postfix(str); - - td->o.lockfile_batch = 1; - if (nr) { - td->o.lockfile_batch = atoi(nr); - free(nr); - } - - return 0; -} - static int str_gtod_reduce_cb(void *data, int *il) { struct thread_data *td = data; @@ -963,6 +949,25 @@ static int kb_base_verify(struct fio_option *o, void *data) return 0; } +static int unit_base_verify(struct fio_option *o, void *data) +{ + struct thread_data *td = data; + + /* 0 = default, pick based on engine + * 1 = use bits + * 8 = use bytes + */ + if (td->o.unit_base != 0 && + td->o.unit_base != 1 && + td->o.unit_base != 8) { + log_err("fio: unit_base set to nonsensical value: %u\n", + td->o.unit_base); + return 1; + } + + return 0; +} + /* * Option grouping */ @@ -1161,11 +1166,36 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_FILE, .group = FIO_OPT_G_FILENAME, }, + { + .name = "filename_format", + .type = FIO_OPT_STR_STORE, + .off1 = td_var_offset(filename_format), + .prio = -1, /* must come after "directory" */ + .help = "Override default $jobname.$jobnum.$filenum naming", + .def = "$jobname.$jobnum.$filenum", + }, + { + .name = "kb_base", + .type = FIO_OPT_INT, + .off1 = td_var_offset(kb_base), + .verify = kb_base_verify, + .prio = 1, + .def = "1024", + .help = "How many bytes per KB for reporting (1000 or 1024)", + }, + { + .name = "unit_base", + .type = FIO_OPT_INT, + .off1 = td_var_offset(unit_base), + .verify = unit_base_verify, + .prio = 1, + .def = "0", + .help = "Bit multiple of result summary data (8 for byte, 1 for bit)", + }, { .name = "lockfile", .lname = "Lockfile", .type = FIO_OPT_STR, - .cb = str_lockfile_cb, .off1 = td_var_offset(file_lock_mode), .help = "Lock file when doing IO to it", .parent = "filename",