From 0a839f308177e95c4c45c41ee1d4fa2b8f231f24 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 26 Apr 2007 09:02:34 +0200 Subject: [PATCH] Disk stat improvements Add an option to disable the disk stats. And only dump the disk stat header, if we actually have stats to show. Signed-off-by: Jens Axboe --- HOWTO | 3 +++ diskutil.c | 3 +++ init.c | 4 ---- options.c | 9 +++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/HOWTO b/HOWTO index 5fdc1f79..0b438714 100644 --- a/HOWTO +++ b/HOWTO @@ -648,6 +648,9 @@ cpuload=int If the job is a CPU cycle eater, attempt to use the specified cpuchunks=int If the job is a CPU cycle eater, split the load into cycles of the given time. In milliseconds. +disk_util=bool Generate disk utilization statistics, if the platform + supports it. Defaults to on. + 6.0 Interpreting the output --------------------------- diff --git a/diskutil.c b/diskutil.c index 11d676fc..bbaa22d5 100644 --- a/diskutil.c +++ b/diskutil.c @@ -313,6 +313,9 @@ void show_disk_util(void) struct disk_util *du; double util; + if (list_empty(&disk_list)) + return; + log_info("\nDisk stats (read/write):\n"); list_for_each(entry, &disk_list) { diff --git a/init.c b/init.c index e8b94d6b..1e4432ec 100644 --- a/init.c +++ b/init.c @@ -669,10 +669,6 @@ static int fill_def_thread(void) def_thread.o.write_bw_log = write_bw_log; def_thread.o.write_lat_log = write_lat_log; -#ifdef FIO_HAVE_DISK_UTIL - def_thread.o.do_disk_util = 1; -#endif - return 0; } diff --git a/options.c b/options.c index 230c47dd..54ceaeed 100644 --- a/options.c +++ b/options.c @@ -852,6 +852,15 @@ static struct fio_option options[] = { .off1 = td_var_offset(zero_buffers), .help = "Init IO buffers to all zeroes", }, +#ifdef FIO_HAVE_DISK_UTIL + { + .name = "disk_util", + .type = FIO_OPT_BOOL, + .off1 = td_var_offset(do_disk_util), + .help = "Log disk utilization stats", + .def = "1", + }, +#endif { .name = NULL, }, -- 2.25.1