From: Jens Axboe Date: Mon, 14 Apr 2014 19:19:13 +0000 (-0600) Subject: diskutil: make it clear that parent != NULL for json output X-Git-Tag: fio-2.1.9~26 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=9edf7b3ed581a61433ad620d457b4d0349115e52 diskutil: make it clear that parent != NULL for json output Signed-off-by: Jens Axboe --- diff --git a/diskutil.c b/diskutil.c index d97c5ca1..3ee5c6c8 100644 --- a/diskutil.c +++ b/diskutil.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "fio.h" #include "smalloc.h" @@ -686,12 +687,15 @@ void show_disk_util(int terse, struct json_object *parent) return; } - if (!terse && !parent) + if (output_format == FIO_OUTPUT_JSON) + assert(parent); + + if (!terse && output_format != FIO_OUTPUT_JSON) log_info("\nDisk stats (read/write):\n"); - if (output_format == FIO_OUTPUT_JSON) { + if (output_format == FIO_OUTPUT_JSON) json_object_add_disk_utils(parent, &disk_list); - } else + else flist_for_each(entry, &disk_list) { du = flist_entry(entry, struct disk_util, list);