add significant_figures parameter
authorJeff Furlong <jeff.furlong@wdc.com>
Wed, 22 Nov 2017 18:38:33 +0000 (11:38 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 22 Nov 2017 18:38:33 +0000 (11:38 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
12 files changed:
HOWTO
cconv.c
client.c
eta.c
fio.1
gclient.c
init.c
options.c
server.c
stat.c
stat.h
thread_options.h

diff --git a/HOWTO b/HOWTO
index dce96bcd8103f075d56b21173659f3061f6600b1..90f755807d041541ebd420122b6bc9fb08392df8 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -2909,6 +2909,13 @@ Measurements and reporting
        completion latency below which 99.5% and 99.9% of the observed latencies
        fell, respectively.
 
+.. option:: significant_figures=int
+
+       If using :option:`--output-format` of `normal`, set the significant figures 
+       to this value. Higher values will yield more precise IOPS and throughput 
+       units, while lower values will round. Requires a minimum value of 1 and a 
+       maximum value of 10. Defaults to 4.
+
 
 Error handling
 ~~~~~~~~~~~~~~
diff --git a/cconv.c b/cconv.c
index dc3c4e674f5adbcfdf1377be6f1235e56b5a5af3..1a41dc3e6b10b187311b91cdaaac84b50229eca3 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -270,6 +270,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
        o->clat_percentiles = le32_to_cpu(top->clat_percentiles);
        o->lat_percentiles = le32_to_cpu(top->lat_percentiles);
        o->percentile_precision = le32_to_cpu(top->percentile_precision);
+       o->sig_figs = le32_to_cpu(top->sig_figs);
        o->continue_on_error = le32_to_cpu(top->continue_on_error);
        o->cgroup_weight = le32_to_cpu(top->cgroup_weight);
        o->cgroup_nodelete = le32_to_cpu(top->cgroup_nodelete);
@@ -458,6 +459,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->clat_percentiles = cpu_to_le32(o->clat_percentiles);
        top->lat_percentiles = cpu_to_le32(o->lat_percentiles);
        top->percentile_precision = cpu_to_le32(o->percentile_precision);
+       top->sig_figs = cpu_to_le32(o->sig_figs);
        top->continue_on_error = cpu_to_le32(o->continue_on_error);
        top->cgroup_weight = cpu_to_le32(o->cgroup_weight);
        top->cgroup_nodelete = cpu_to_le32(o->cgroup_nodelete);
index 779fb9d7f8d04f53bd56388d13f869d0760980e5..11fa262a6af9d2a5db68401d3d9c73ab86fc6272 100644 (file)
--- a/client.c
+++ b/client.c
@@ -942,6 +942,8 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        dst->kb_base            = le32_to_cpu(src->kb_base);
        dst->unit_base          = le32_to_cpu(src->unit_base);
 
+       dst->sig_figs           = le32_to_cpu(src->sig_figs);
+
        dst->latency_depth      = le32_to_cpu(src->latency_depth);
        dst->latency_target     = le64_to_cpu(src->latency_target);
        dst->latency_window     = le64_to_cpu(src->latency_window);
@@ -982,6 +984,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 
        dst->kb_base    = le32_to_cpu(src->kb_base);
        dst->unit_base  = le32_to_cpu(src->unit_base);
+       dst->sig_figs   = le32_to_cpu(src->sig_figs);
        dst->groupid    = le32_to_cpu(src->groupid);
        dst->unified_rw_rep     = le32_to_cpu(src->unified_rw_rep);
 }
@@ -1167,6 +1170,7 @@ static void convert_jobs_eta(struct jobs_eta *je)
        je->nr_threads          = le32_to_cpu(je->nr_threads);
        je->is_pow2             = le32_to_cpu(je->is_pow2);
        je->unit_base           = le32_to_cpu(je->unit_base);
+       je->sig_figs            = le32_to_cpu(je->sig_figs);
 }
 
 void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je)
diff --git a/eta.c b/eta.c
index baaa68151dff8c85d6b76c3f885e06a0c4ca102a..1b0b000df115d4b04ff0ed614d3f9a8660e7abfb 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -537,9 +537,9 @@ void display_thread_status(struct jobs_eta *je)
                char *tr, *mr;
 
                mr = num2str(je->m_rate[0] + je->m_rate[1] + je->m_rate[2],
-                               4, 0, je->is_pow2, N2S_BYTEPERSEC);
+                               je->sig_figs, 0, je->is_pow2, N2S_BYTEPERSEC);
                tr = num2str(je->t_rate[0] + je->t_rate[1] + je->t_rate[2],
-                               4, 0, je->is_pow2, N2S_BYTEPERSEC);
+                               je->sig_figs, 0, je->is_pow2, N2S_BYTEPERSEC);
 
                p += sprintf(p, ", %s-%s", mr, tr);
                free(tr);
diff --git a/fio.1 b/fio.1
index bd7670a95c493f991467ccac3c3a5b1f3f46bd09..2be64d28b308433736f754b993aa5858a66cd844 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -2586,6 +2586,12 @@ numbers, and list the numbers in ascending order. For example,
 `\-\-percentile_list=99.5:99.9' will cause fio to report the values of
 completion latency below which 99.5% and 99.9% of the observed latencies
 fell, respectively.
+.TP
+.BI significant_figures \fR=\fPint
+If using \fB\-\-output\-format\fR of `normal', set the significant figures 
+to this value. Higher values will yield more precise IOPS and throughput 
+units, while lower values will round. Requires a minimum value of 1 and a 
+maximum value of 10. Defaults to 4.
 .SS "Error handling"
 .TP
 .BI exitall_on_error
index daa91538fa498c5324161345a6110742cf080b16..ab7aa10d061c3600c75fb51a2aaf7206e97f1833 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -379,24 +379,24 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j
                        sprintf(output, "%3.1f%% done", perc);
                }
 
-               iops_str[0] = num2str(je->iops[0], 4, 1, 0, N2S_PERSEC);
-               iops_str[1] = num2str(je->iops[1], 4, 1, 0, N2S_PERSEC);
-               iops_str[2] = num2str(je->iops[2], 4, 1, 0, N2S_PERSEC);
+               iops_str[0] = num2str(je->iops[0], je->sig_figs, 1, 0, N2S_PERSEC);
+               iops_str[1] = num2str(je->iops[1], je->sig_figs, 1, 0, N2S_PERSEC);
+               iops_str[2] = num2str(je->iops[2], je->sig_figs, 1, 0, N2S_PERSEC);
 
-               rate_str[0] = num2str(je->rate[0], 4, 10, i2p, N2S_BYTEPERSEC);
-               rate_alt[0] = num2str(je->rate[0], 4, 10, !i2p, N2S_BYTEPERSEC);
+               rate_str[0] = num2str(je->rate[0], je->sig_figs, 10, i2p, N2S_BYTEPERSEC);
+               rate_alt[0] = num2str(je->rate[0], je->sig_figs, 10, !i2p, N2S_BYTEPERSEC);
                snprintf(tmp, sizeof(tmp), "%s (%s)", rate_str[0], rate_alt[0]);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.read_bw), tmp);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.read_iops), iops_str[0]);
 
-               rate_str[1] = num2str(je->rate[1], 4, 10, i2p, N2S_BYTEPERSEC);
-               rate_alt[1] = num2str(je->rate[1], 4, 10, !i2p, N2S_BYTEPERSEC);
+               rate_str[1] = num2str(je->rate[1], je->sig_figs, 10, i2p, N2S_BYTEPERSEC);
+               rate_alt[1] = num2str(je->rate[1], je->sig_figs, 10, !i2p, N2S_BYTEPERSEC);
                snprintf(tmp, sizeof(tmp), "%s (%s)", rate_str[1], rate_alt[1]);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.write_bw), tmp);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.write_iops), iops_str[1]);
 
-               rate_str[2] = num2str(je->rate[2], 4, 10, i2p, N2S_BYTEPERSEC);
-               rate_alt[2] = num2str(je->rate[2], 4, 10, !i2p, N2S_BYTEPERSEC);
+               rate_str[2] = num2str(je->rate[2], je->sig_figs, 10, i2p, N2S_BYTEPERSEC);
+               rate_alt[2] = num2str(je->rate[2], je->sig_figs, 10, !i2p, N2S_BYTEPERSEC);
                snprintf(tmp, sizeof(tmp), "%s (%s)", rate_str[2], rate_alt[2]);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_bw), tmp);
                gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_iops), iops_str[2]);
@@ -463,24 +463,24 @@ static void gfio_update_all_eta(struct jobs_eta *je)
                        sprintf(output, "%3.1f%% done", perc);
                }
 
-               iops_str[0] = num2str(je->iops[0], 4, 1, 0, N2S_PERSEC);
-               iops_str[1] = num2str(je->iops[1], 4, 1, 0, N2S_PERSEC);
-               iops_str[2] = num2str(je->iops[2], 4, 1, 0, N2S_PERSEC);
+               iops_str[0] = num2str(je->iops[0], je->sig_figs, 1, 0, N2S_PERSEC);
+               iops_str[1] = num2str(je->iops[1], je->sig_figs, 1, 0, N2S_PERSEC);
+               iops_str[2] = num2str(je->iops[2], je->sig_figs, 1, 0, N2S_PERSEC);
 
-               rate_str[0] = num2str(je->rate[0], 4, 10, i2p, N2S_BYTEPERSEC);
-               rate_alt[0] = num2str(je->rate[0], 4, 10, !i2p, N2S_BYTEPERSEC);
+               rate_str[0] = num2str(je->rate[0], je->sig_figs, 10, i2p, N2S_BYTEPERSEC);
+               rate_alt[0] = num2str(je->rate[0], je->sig_figs, 10, !i2p, N2S_BYTEPERSEC);
                snprintf(tmp, sizeof(tmp), "%s (%s)", rate_str[0], rate_alt[0]);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.read_bw), tmp);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.read_iops), iops_str[0]);
 
-               rate_str[1] = num2str(je->rate[1], 4, 10, i2p, N2S_BYTEPERSEC);
-               rate_alt[1] = num2str(je->rate[1], 4, 10, !i2p, N2S_BYTEPERSEC);
+               rate_str[1] = num2str(je->rate[1], je->sig_figs, 10, i2p, N2S_BYTEPERSEC);
+               rate_alt[1] = num2str(je->rate[1], je->sig_figs, 10, !i2p, N2S_BYTEPERSEC);
                snprintf(tmp, sizeof(tmp), "%s (%s)", rate_str[1], rate_alt[1]);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.write_bw), tmp);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.write_iops), iops_str[1]);
 
-               rate_str[2] = num2str(je->rate[2], 4, 10, i2p, N2S_BYTEPERSEC);
-               rate_alt[2] = num2str(je->rate[2], 4, 10, !i2p, N2S_BYTEPERSEC);
+               rate_str[2] = num2str(je->rate[2], je->sig_figs, 10, i2p, N2S_BYTEPERSEC);
+               rate_alt[2] = num2str(je->rate[2], je->sig_figs, 10, !i2p, N2S_BYTEPERSEC);
                snprintf(tmp, sizeof(tmp), "%s (%s)", rate_str[2], rate_alt[2]);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.trim_bw), tmp);
                gtk_entry_set_text(GTK_ENTRY(ui->eta.trim_iops), iops_str[2]);
@@ -587,10 +587,10 @@ static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd)
        multitext_add_entry(&ge->eta.iotype, tmp);
 
        i2p = is_power_of_2(o->kb_base);
-       c1 = num2str(o->min_bs[DDIR_READ], 4, 1, i2p, N2S_BYTE);
-       c2 = num2str(o->max_bs[DDIR_READ], 4, 1, i2p, N2S_BYTE);
-       c3 = num2str(o->min_bs[DDIR_WRITE], 4, 1, i2p, N2S_BYTE);
-       c4 = num2str(o->max_bs[DDIR_WRITE], 4, 1, i2p, N2S_BYTE);
+       c1 = num2str(o->min_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE);
+       c2 = num2str(o->max_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE);
+       c3 = num2str(o->min_bs[DDIR_WRITE], o->sig_figs, 1, i2p, N2S_BYTE);
+       c4 = num2str(o->max_bs[DDIR_WRITE], o->sig_figs, 1, i2p, N2S_BYTE);
 
        sprintf(tmp, "%s-%s,%s-%s", c1, c2, c3, c4);
        free(c1);
@@ -1183,7 +1183,7 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox,
        bw = (1000 * ts->io_bytes[ddir]) / runt;
 
        iops = (1000 * (uint64_t)ts->total_io_u[ddir]) / runt;
-       iops_p = num2str(iops, 4, 1, 0, N2S_PERSEC);
+       iops_p = num2str(iops, ts->sig_figs, 1, 0, N2S_PERSEC);
 
        box = gtk_hbox_new(FALSE, 3);
        gtk_box_pack_start(GTK_BOX(mbox), box, TRUE, FALSE, 3);
@@ -1198,14 +1198,14 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox,
        gtk_box_pack_start(GTK_BOX(main_vbox), box, TRUE, FALSE, 3);
 
        label = new_info_label_in_frame(box, "IO");
-       io_p = num2str(ts->io_bytes[ddir], 4, 1, i2p, N2S_BYTE);
-       io_palt = num2str(ts->io_bytes[ddir], 4, 1, !i2p, N2S_BYTE);
+       io_p = num2str(ts->io_bytes[ddir], ts->sig_figs, 1, i2p, N2S_BYTE);
+       io_palt = num2str(ts->io_bytes[ddir], ts->sig_figs, 1, !i2p, N2S_BYTE);
        snprintf(tmp, sizeof(tmp), "%s (%s)", io_p, io_palt);
        gtk_label_set_text(GTK_LABEL(label), tmp);
 
        label = new_info_label_in_frame(box, "Bandwidth");
-       bw_p = num2str(bw, 4, 1, i2p, ts->unit_base);
-       bw_palt = num2str(bw, 4, 1, !i2p, ts->unit_base);
+       bw_p = num2str(bw, ts->sig_figs, 1, i2p, ts->unit_base);
+       bw_palt = num2str(bw, ts->sig_figs, 1, !i2p, ts->unit_base);
        snprintf(tmp, sizeof(tmp), "%s (%s)", bw_p, bw_palt);
        gtk_label_set_text(GTK_LABEL(label), tmp);
 
diff --git a/init.c b/init.c
index 736c6ff83656849c94a4dec8ae2781be4079e0bd..b7e9c0e544ded76d86ccf1187f43676c7adc6f29 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1589,14 +1589,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                                char *c5 = NULL, *c6 = NULL;
                                int i2p = is_power_of_2(o->kb_base);
 
-                               c1 = num2str(o->min_bs[DDIR_READ], 4, 1, i2p, N2S_BYTE);
-                               c2 = num2str(o->max_bs[DDIR_READ], 4, 1, i2p, N2S_BYTE);
-                               c3 = num2str(o->min_bs[DDIR_WRITE], 4, 1, i2p, N2S_BYTE);
-                               c4 = num2str(o->max_bs[DDIR_WRITE], 4, 1, i2p, N2S_BYTE);
+                               c1 = num2str(o->min_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE);
+                               c2 = num2str(o->max_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE);
+                               c3 = num2str(o->min_bs[DDIR_WRITE], o->sig_figs, 1, i2p, N2S_BYTE);
+                               c4 = num2str(o->max_bs[DDIR_WRITE], o->sig_figs, 1, i2p, N2S_BYTE);
 
                                if (!o->bs_is_seq_rand) {
-                                       c5 = num2str(o->min_bs[DDIR_TRIM], 4, 1, i2p, N2S_BYTE);
-                                       c6 = num2str(o->max_bs[DDIR_TRIM], 4, 1, i2p, N2S_BYTE);
+                                       c5 = num2str(o->min_bs[DDIR_TRIM], o->sig_figs, 1, i2p, N2S_BYTE);
+                                       c6 = num2str(o->max_bs[DDIR_TRIM], o->sig_figs, 1, i2p, N2S_BYTE);
                                }
 
                                log_info("%s: (g=%d): rw=%s, ", td->o.name,
index a0fcd8f10b67fc72dda75d6e040470c4a9b3ff2e..7caccb331c1ec5be2a3de986208c44921db2db20 100644 (file)
--- a/options.c
+++ b/options.c
@@ -4127,6 +4127,19 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .category = FIO_OPT_C_STAT,
                .group  = FIO_OPT_G_INVALID,
        },
+       {
+               .name   = "significant_figures",
+               .lname  = "Significant figures",
+               .type   = FIO_OPT_INT,
+               .off1   = offsetof(struct thread_options, sig_figs),
+               .maxval = 10,
+               .minval = 1,
+               .help   = "Significant figures for output-format set to normal",
+               .def    = "4",
+               .interval = 1,
+               .category = FIO_OPT_C_STAT,
+               .group  = FIO_OPT_G_INVALID,
+       },
 
 #ifdef FIO_HAVE_DISK_UTIL
        {
index e6ea4cdbfdcabc911a97f0e96d1e99e92b8c520b..967cebe76937c4f03f04161ada8685e5a94fb0dd 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1538,6 +1538,8 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        p.ts.latency_window     = cpu_to_le64(ts->latency_window);
        p.ts.latency_percentile.u.i = cpu_to_le64(fio_double_to_uint64(ts->latency_percentile.u.f));
 
+       p.ts.sig_figs           = cpu_to_le32(ts->sig_figs);
+
        p.ts.nr_block_infos     = cpu_to_le64(ts->nr_block_infos);
        for (i = 0; i < p.ts.nr_block_infos; i++)
                p.ts.block_infos[i] = cpu_to_le32(ts->block_infos[i]);
diff --git a/stat.c b/stat.c
index 89e2e6cb8007b2375c3ba688aff7e72a477b5def..48d8e7daa59d38d863f53b3507bd1d9fe19379d1 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -299,14 +299,14 @@ void show_group_stats(struct group_run_stats *rs, struct buf_output *out)
                if (!rs->max_run[i])
                        continue;
 
-               io = num2str(rs->iobytes[i], 4, 1, i2p, N2S_BYTE);
-               ioalt = num2str(rs->iobytes[i], 4, 1, !i2p, N2S_BYTE);
-               agg = num2str(rs->agg[i], 4, 1, i2p, rs->unit_base);
-               aggalt = num2str(rs->agg[i], 4, 1, !i2p, rs->unit_base);
-               min = num2str(rs->min_bw[i], 4, 1, i2p, rs->unit_base);
-               minalt = num2str(rs->min_bw[i], 4, 1, !i2p, rs->unit_base);
-               max = num2str(rs->max_bw[i], 4, 1, i2p, rs->unit_base);
-               maxalt = num2str(rs->max_bw[i], 4, 1, !i2p, rs->unit_base);
+               io = num2str(rs->iobytes[i], rs->sig_figs, 1, i2p, N2S_BYTE);
+               ioalt = num2str(rs->iobytes[i], rs->sig_figs, 1, !i2p, N2S_BYTE);
+               agg = num2str(rs->agg[i], rs->sig_figs, 1, i2p, rs->unit_base);
+               aggalt = num2str(rs->agg[i], rs->sig_figs, 1, !i2p, rs->unit_base);
+               min = num2str(rs->min_bw[i], rs->sig_figs, 1, i2p, rs->unit_base);
+               minalt = num2str(rs->min_bw[i], rs->sig_figs, 1, !i2p, rs->unit_base);
+               max = num2str(rs->max_bw[i], rs->sig_figs, 1, i2p, rs->unit_base);
+               maxalt = num2str(rs->max_bw[i], rs->sig_figs, 1, !i2p, rs->unit_base);
                log_buf(out, "%s: bw=%s (%s), %s-%s (%s-%s), io=%s (%s), run=%llu-%llumsec\n",
                                rs->unified_rw_rep ? "  MIXED" : str[i],
                                agg, aggalt, min, max, minalt, maxalt, io, ioalt,
@@ -435,12 +435,12 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
        runt = ts->runtime[ddir];
 
        bw = (1000 * ts->io_bytes[ddir]) / runt;
-       io_p = num2str(ts->io_bytes[ddir], 4, 1, i2p, N2S_BYTE);
-       bw_p = num2str(bw, 4, 1, i2p, ts->unit_base);
-       bw_p_alt = num2str(bw, 4, 1, !i2p, ts->unit_base);
+       io_p = num2str(ts->io_bytes[ddir], ts->sig_figs, 1, i2p, N2S_BYTE);
+       bw_p = num2str(bw, ts->sig_figs, 1, i2p, ts->unit_base);
+       bw_p_alt = num2str(bw, ts->sig_figs, 1, !i2p, ts->unit_base);
 
        iops = (1000 * (uint64_t)ts->total_io_u[ddir]) / runt;
-       iops_p = num2str(iops, 4, 1, 0, N2S_NONE);
+       iops_p = num2str(iops, ts->sig_figs, 1, 0, N2S_NONE);
 
        log_buf(out, "  %s: IOPS=%s, BW=%s (%s)(%s/%llumsec)\n",
                        rs->unified_rw_rep ? "mixed" : str[ddir],
@@ -738,9 +738,9 @@ static void show_ss_normal(struct thread_stat *ts, struct buf_output *out)
        bw_mean = steadystate_bw_mean(ts);
        iops_mean = steadystate_iops_mean(ts);
 
-       p1 = num2str(bw_mean / ts->kb_base, 4, ts->kb_base, i2p, ts->unit_base);
-       p1alt = num2str(bw_mean / ts->kb_base, 4, ts->kb_base, !i2p, ts->unit_base);
-       p2 = num2str(iops_mean, 4, 1, 0, N2S_NONE);
+       p1 = num2str(bw_mean / ts->kb_base, ts->sig_figs, ts->kb_base, i2p, ts->unit_base);
+       p1alt = num2str(bw_mean / ts->kb_base, ts->sig_figs, ts->kb_base, !i2p, ts->unit_base);
+       p2 = num2str(iops_mean, ts->sig_figs, 1, 0, N2S_NONE);
 
        log_buf(out, "  steadystate  : attained=%s, bw=%s (%s), iops=%s, %s%s=%.3f%s\n",
                ts->ss_state & __FIO_SS_ATTAINED ? "yes" : "no",
@@ -1690,6 +1690,7 @@ void __show_run_stats(void)
 
                        ts->kb_base = td->o.kb_base;
                        ts->unit_base = td->o.unit_base;
+                       ts->sig_figs = td->o.sig_figs;
                        ts->unified_rw_rep = td->o.unified_rw_rep;
                } else if (ts->kb_base != td->o.kb_base && !kb_base_warned) {
                        log_info("fio: kb_base differs for jobs in group, using"
@@ -1752,6 +1753,7 @@ void __show_run_stats(void)
                rs = &runstats[ts->groupid];
                rs->kb_base = ts->kb_base;
                rs->unit_base = ts->unit_base;
+               rs->sig_figs = ts->sig_figs;
                rs->unified_rw_rep += ts->unified_rw_rep;
 
                for (j = 0; j < DDIR_RWDIR_CNT; j++) {
diff --git a/stat.h b/stat.h
index 6ddcad25505b134b2e970c14666ca4cba412d4b9..ba66c407a71a4cb1ba6f254900eee2b95ce25135 100644 (file)
--- a/stat.h
+++ b/stat.h
@@ -11,6 +11,7 @@ struct group_run_stats {
        uint64_t agg[DDIR_RWDIR_CNT];
        uint32_t kb_base;
        uint32_t unit_base;
+       uint32_t sig_figs;
        uint32_t groupid;
        uint32_t unified_rw_rep;
 } __attribute__((packed));
@@ -221,6 +222,8 @@ struct thread_stat {
        fio_fp64_t latency_percentile;
        uint64_t latency_window;
 
+       uint32_t sig_figs;
+
        uint64_t ss_dur;
        uint32_t ss_state;
        uint32_t ss_head;
@@ -257,6 +260,8 @@ struct jobs_eta {
        uint32_t is_pow2;
        uint32_t unit_base;
 
+       uint32_t sig_figs;
+
        uint32_t files_open;
 
        /*
index 5a037bfe63775d0fd69cfbf86ac01c16ed9f5ba1..ca549b542703de11c32f5958fa6947a3a6c4d916 100644 (file)
@@ -309,6 +309,8 @@ struct thread_options {
        unsigned long long latency_window;
        fio_fp64_t latency_percentile;
 
+       unsigned int sig_figs;
+
        unsigned block_error_hist;
 
        unsigned int replay_align;
@@ -584,6 +586,8 @@ struct thread_options_pack {
        uint64_t latency_window;
        fio_fp64_t latency_percentile;
 
+       uint32_t sig_figs;
+
        uint32_t block_error_hist;
 
        uint32_t replay_align;