#include "fio.h"
#include "smalloc.h"
#include "diskutil.h"
+#include "helper_thread.h"
static int last_majdev, last_mindev;
static struct disk_util *last_du;
fio_mutex_down(disk_util_mutex);
- if (!helper_exit) {
+ if (!helper_should_exit()) {
flist_for_each(entry, &disk_list) {
du = flist_entry(entry, struct disk_util, list);
update_io_tick_disk(du);
{
struct flist_head *entry;
struct disk_util *du;
+ bool do_json;
if (!disk_util_mutex)
return;
return;
}
- if (output_format & FIO_OUTPUT_JSON)
- assert(parent);
+ if ((output_format & FIO_OUTPUT_JSON) && parent)
+ do_json = true;
+ else
+ do_json = false;
- if (!terse && !(output_format & FIO_OUTPUT_JSON))
+ if (!terse && !do_json)
log_buf(out, "\nDisk stats (read/write):\n");
- if (output_format & FIO_OUTPUT_JSON)
+ if (do_json)
json_object_add_disk_utils(parent, &disk_list);
- if (output_format & ~(FIO_OUTPUT_JSON)) {
+ else if (output_format & ~(FIO_OUTPUT_JSON | FIO_OUTPUT_JSON_PLUS)) {
flist_for_each(entry, &disk_list) {
du = flist_entry(entry, struct disk_util, list);