From: Jens Axboe Date: Mon, 16 May 2016 16:53:44 +0000 (-0600) Subject: stat: add blocksize to averaged log, if it's consistent X-Git-Tag: fio-2.10~27 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=66b98c9fe942e8fd417525ace39d0e0b93bcb9e9;hp=5c8f0ba56837a0b848cbbbc5a8673589d099ded3 stat: add blocksize to averaged log, if it's consistent If we average over time, fio doesn't add the blocksize used. The reasoning behind that is that if we're using multiple block sizes, there's no right answer. But if we are not, we can add the blocksize that was used. Signed-off-by: Jens Axboe --- diff --git a/stat.c b/stat.c index 95f206e0..4d87c29a 100644 --- a/stat.c +++ b/stat.c @@ -2169,8 +2169,14 @@ static int add_bw_samples(struct thread_data *td, struct timeval *t) add_stat_sample(&ts->bw_stat[ddir], rate); - if (td->bw_log) - add_log_sample(td, td->bw_log, rate, ddir, 0, 0); + if (td->bw_log) { + unsigned int bs = 0; + + if (td->o.min_bs[ddir] == td->o.max_bs[ddir]) + bs = td->o.min_bs[ddir]; + + add_log_sample(td, td->bw_log, rate, ddir, bs, 0); + } td->stat_io_bytes[ddir] = td->this_io_bytes[ddir]; } @@ -2234,8 +2240,14 @@ static int add_iops_samples(struct thread_data *td, struct timeval *t) add_stat_sample(&ts->iops_stat[ddir], iops); - if (td->iops_log) - add_log_sample(td, td->iops_log, iops, ddir, 0, 0); + if (td->iops_log) { + unsigned int bs = 0; + + if (td->o.min_bs[ddir] == td->o.max_bs[ddir]) + bs = td->o.min_bs[ddir]; + + add_log_sample(td, td->iops_log, iops, ddir, bs, 0); + } td->stat_io_blocks[ddir] = td->this_io_blocks[ddir]; }