Disk stat improvements
authorJens Axboe <jens.axboe@oracle.com>
Thu, 26 Apr 2007 07:02:34 +0000 (09:02 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 26 Apr 2007 07:02:34 +0000 (09:02 +0200)
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 <jens.axboe@oracle.com>
HOWTO
diskutil.c
init.c
options.c

diff --git a/HOWTO b/HOWTO
index 5fdc1f7..0b43871 100644 (file)
--- 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
 ---------------------------
index 11d676f..bbaa22d 100644 (file)
@@ -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 e8b94d6..1e4432e 100644 (file)
--- 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;
 }
 
index 230c47d..54ceaee 100644 (file)
--- 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,
        },