diskutil: make it clear that parent != NULL for json output
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/diskutil.c b/diskutil.c
index d97c5ca..3ee5c6c 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -6,6 +6,7 @@
#include <dirent.h>
#include <libgen.h>
#include <math.h>
+#include <assert.h>
#include "fio.h"
#include "smalloc.h"
@@ -686,12 +687,15 @@
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);