X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=stat.c;h=fd3ad5aa248b2caf6e78c08e8ed330ac2cdf0eb3;hb=5ccdfd74e2e13c61eec307e53a50f3f73f0afe7a;hp=6e47c34cbbcaf528a4951519c8383b0e8e6b9c96;hpb=71cb78c10a80f448b912dc20d24ea731f6a102d9;p=fio.git diff --git a/stat.c b/stat.c index 6e47c34c..fd3ad5aa 100644 --- a/stat.c +++ b/stat.c @@ -919,7 +919,8 @@ static void add_ddir_status_json(struct thread_stat *ts, iops = (1000.0 * (uint64_t) ts->total_io_u[ddir]) / runt; } - json_object_add_value_int(dir_object, "io_bytes", ts->io_bytes[ddir] >> 10); + json_object_add_value_int(dir_object, "io_bytes", ts->io_bytes[ddir]); + json_object_add_value_int(dir_object, "io_kbytes", ts->io_bytes[ddir] >> 10); json_object_add_value_int(dir_object, "bw", bw); json_object_add_value_float(dir_object, "iops", iops); json_object_add_value_int(dir_object, "runtime", ts->runtime[ddir]); @@ -1825,8 +1826,10 @@ void __show_run_stats(void) } for (i = 0; i < FIO_OUTPUT_NR; i++) { - buf_output_flush(&output[i]); - buf_output_free(&output[i]); + struct buf_output *out = &output[i]; + + log_info_buf(out->buf, out->buflen); + buf_output_free(out); } log_info_flush(); @@ -2465,7 +2468,7 @@ static int __add_samples(struct thread_data *td, struct timeval *parent_tv, add_stat_sample(&stat[ddir], rate); - if (td->bw_log) { + if (log) { unsigned int bs = 0; if (td->o.min_bs[ddir] == td->o.max_bs[ddir]) @@ -2541,12 +2544,14 @@ int calc_log_samples(void) next = min(td->o.iops_avg_time, td->o.bw_avg_time); continue; } - if (td->bw_log && !per_unit_log(td->bw_log)) { + if (!td->bw_log || + (td->bw_log && !per_unit_log(td->bw_log))) { tmp = add_bw_samples(td, &now); if (tmp < next) next = tmp; } - if (td->iops_log && !per_unit_log(td->iops_log)) { + if (!td->iops_log || + (td->iops_log && !per_unit_log(td->iops_log))) { tmp = add_iops_samples(td, &now); if (tmp < next) next = tmp;