Fix confusion between terse and json output
It'd segfault trying to use json when it wasn't supposed to,
since we didn't have the parent set up appropriately.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/diskutil.c b/diskutil.c
index d98e39a..fbc4268 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -658,7 +658,7 @@
if (!terse)
log_info("\nDisk stats (read/write):\n");
- if (terse && terse_version == 4) {
+ if (output_format == FIO_OUTPUT_JSON) {
array = json_create_array();
json_object_add_value_array(parent, "disk_util", array);
}
@@ -667,7 +667,7 @@
du = flist_entry(entry, struct disk_util, list);
aggregate_slaves_stats(du);
- if (terse && terse_version == 4)
+ if (output_format == FIO_OUTPUT_JSON)
print_disk_util_json(du, array);
else
print_disk_util(&du->dus, &du->agg, terse);