X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=ea1ffb13dd8bf95dd0f8c0bb1bbb0a8f257921c0;hp=05a6a5081fa576810c9071506e634077ec27a401;hb=925fee33e47f7eb755ee893e87f0de2bd405a8cc;hpb=5ffb051d716725b7c39cf115af779a29d09b62a5 diff --git a/options.c b/options.c index 05a6a508..ea1ffb13 100644 --- a/options.c +++ b/options.c @@ -734,19 +734,25 @@ static int str_random_distribution_cb(void *data, const char *str) double val; char *nr; - if (td->o.random_distribution == FIO_RAND_DIST_RANDOM) + if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) + val = 1.1; + else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) + val = 0.2; + else return 0; nr = get_opt_postfix(str); - if (!nr) - val = 0.6; - else if (!str_to_float(nr, &val)) { + if (nr && !str_to_float(nr, &val)) { log_err("fio: random postfix parsing failed\n"); free(nr); return 1; } - td->o.zipf_theta = val; + if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) + td->o.zipf_theta = val; + else + td->o.pareto_h = val; + free(nr); return 0; } @@ -1511,6 +1517,10 @@ static struct fio_option options[FIO_MAX_OPTS] = { .oval = FIO_RAND_DIST_ZIPF, .help = "Zipf distribution", }, + { .ival = "pareto", + .oval = FIO_RAND_DIST_PARETO, + .help = "Pareto distribution", + }, }, }, {