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 5fdc1f79773cefea0b3ba6196408155c0b44bdcd..0b438714c56cba93b9f319178231b258bb2ee47e 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 11d676fcb00c18eaf881abb82e8eae3d0cf573ed..bbaa22d56b2a7cab19960c94349e02e385e5af0c 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 e8b94d6b24ce57bbf442d255ae36004b8b893854..1e4432ec7131f4f4e850761a9475bf914be3b05a 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 230c47dd22b48171277bc62392f98267c930a501..54ceaeed706cbaa110eff416375cbe5f5beb7393 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,
        },