From: Jens Axboe Date: Mon, 22 Aug 2016 19:23:29 +0000 (-0600) Subject: stat: don't trust per_unit_log() if log is NULL X-Git-Tag: fio-2.14~21 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9e4438fecd1d92b4d5221f35d5e73546f52c6ebf;p=fio.git stat: don't trust per_unit_log() if log is NULL We return 'false' for that case, but it's not really false. Fixes a sigbus error on sparc, without logging. Signed-off-by: Jens Axboe --- diff --git a/stat.c b/stat.c index 552d88dd..74c2686c 100644 --- a/stat.c +++ b/stat.c @@ -2457,12 +2457,12 @@ int calc_log_samples(void) next = min(td->o.iops_avg_time, td->o.bw_avg_time); continue; } - if (!per_unit_log(td->bw_log)) { + if (td->bw_log && !per_unit_log(td->bw_log)) { tmp = add_bw_samples(td, &now); if (tmp < next) next = tmp; } - if (!per_unit_log(td->iops_log)) { + if (td->iops_log && !per_unit_log(td->iops_log)) { tmp = add_iops_samples(td, &now); if (tmp < next) next = tmp;