From: Jens Axboe Date: Mon, 8 Oct 2012 19:34:31 +0000 (-0600) Subject: Fix confusion between terse and json output X-Git-Tag: fio-2.0.10~9 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=aeb32dfccbd052965b0e50714c12265551f61a00;p=fio.git 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 --- diff --git a/diskutil.c b/diskutil.c index d98e39a5..fbc4268e 100644 --- a/diskutil.c +++ b/diskutil.c @@ -658,7 +658,7 @@ void show_disk_util(int terse, struct json_object *parent) 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 @@ void show_disk_util(int terse, struct json_object *parent) 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);