Fix percentile_list option
Commit 802ad4a8 broke the parsing of the percentile list,
by neglecting to change the parser type fo a fio_fp64_t.
Also get rid of the def_percentile_list, just set the
default percentile list as the option default.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/fio.h b/fio.h
index d18029a..370ddaa 100644
--- a/fio.h
+++ b/fio.h
@@ -248,7 +248,6 @@
unsigned int trim_zero;
unsigned long long trim_backlog;
unsigned int clat_percentiles;
- unsigned int overwrite_plist;
fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
char *read_iolog_file;
@@ -606,7 +605,6 @@
extern int nr_clients;
extern int log_syslog;
extern const char fio_version_string[];
-extern const fio_fp64_t def_percentile_list[FIO_IO_U_LIST_MAX_LEN];
extern struct thread_data *threads;
diff --git a/init.c b/init.c
index dfc5a8f..52665f0 100644
--- a/init.c
+++ b/init.c
@@ -67,26 +67,6 @@
static char cmd_optstr[256];
static int did_arg;
-const fio_fp64_t def_percentile_list[FIO_IO_U_LIST_MAX_LEN] = {
- { .u.f = 1.00 },
- { .u.f = 5.00 },
- { .u.f = 10.00 },
- { .u.f = 20.00 },
- { .u.f = 30.00 },
- { .u.f = 40.00 },
- { .u.f = 50.00 },
- { .u.f = 60.00 },
- { .u.f = 70.00 },
- { .u.f = 80.00 },
- { .u.f = 90.00 },
- { .u.f = 95.00 },
- { .u.f = 99.00 },
- { .u.f = 99.50 },
- { .u.f = 99.90 },
- { .u.f = 99.95 },
- { .u.f = 99.99 },
-};
-
#define FIO_CLIENT_FLAG (1 << 16)
/*
@@ -887,10 +867,7 @@
td->mutex = fio_mutex_init(FIO_MUTEX_LOCKED);
td->ts.clat_percentiles = td->o.clat_percentiles;
- if (td->o.overwrite_plist)
- memcpy(td->ts.percentile_list, td->o.percentile_list, sizeof(td->o.percentile_list));
- else
- memcpy(td->ts.percentile_list, def_percentile_list, sizeof(def_percentile_list));
+ memcpy(td->ts.percentile_list, td->o.percentile_list, sizeof(td->o.percentile_list));
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
td->ts.clat_stat[i].min_val = ULONG_MAX;
diff --git a/options.c b/options.c
index 799e77a..4522fe4 100644
--- a/options.c
+++ b/options.c
@@ -2434,8 +2434,8 @@
.name = "percentile_list",
.type = FIO_OPT_FLOAT_LIST,
.off1 = td_var_offset(percentile_list),
- .off2 = td_var_offset(overwrite_plist),
.help = "Specify a custom list of percentiles to report",
+ .def = "1:5:10:20:30:40:50:60:70:80:90:95:99:99.5:99.9:99.95:99.99",
.maxlen = FIO_IO_U_LIST_MAX_LEN,
.minfp = 0.0,
.maxfp = 100.0,
diff --git a/parse.c b/parse.c
index d15d22b..3fda69c 100644
--- a/parse.c
+++ b/parse.c
@@ -15,6 +15,7 @@
#include "debug.h"
#include "options.h"
#include "minmax.h"
+#include "lib/ieee754.h"
static struct fio_option *fio_options;
extern unsigned int fio_get_kb_base(void *);
@@ -362,7 +363,7 @@
int first, int more, int curr)
{
int il, *ilp;
- double* flp;
+ fio_fp64_t *flp;
long long ull, *ullp;
long ul1, ul2;
double uf;
@@ -500,12 +501,6 @@
break;
}
case FIO_OPT_FLOAT_LIST: {
-
- if (first) {
- ul2 = 1;
- ilp = td_var(data, o->off2);
- *ilp = ul2;
- }
if (curr >= o->maxlen) {
log_err("the list exceeding max length %d\n",
o->maxlen);
@@ -527,7 +522,7 @@
}
flp = td_var(data, o->off1);
- flp[curr] = uf;
+ flp[curr].u.f = uf;
break;
}
diff --git a/stat.c b/stat.c
index 62eee9a..fb5ff64 100644
--- a/stat.c
+++ b/stat.c
@@ -1210,10 +1210,7 @@
ts = &threadstats[j];
ts->clat_percentiles = td->o.clat_percentiles;
- if (td->o.overwrite_plist)
- memcpy(ts->percentile_list, td->o.percentile_list, sizeof(td->o.percentile_list));
- else
- memcpy(ts->percentile_list, def_percentile_list, sizeof(def_percentile_list));
+ memcpy(ts->percentile_list, td->o.percentile_list, sizeof(td->o.percentile_list));
idx++;
ts->members++;