iolog: Logging blocksize in IOPS traces
authorErwan Velu <erwan@enovance.com>
Fri, 2 Aug 2013 14:39:40 +0000 (16:39 +0200)
committerErwan Velu <erwan@enovance.com>
Mon, 5 Aug 2013 15:10:00 +0000 (17:10 +0200)
When saving bandwidth's with write_bw_log option, the last column
provides the blocksize used during the run.

When doing the same with write_io_log option, the last column was always
set to 0 which is confusing when reading the log file later.

This patch put both write_bw_log & write_io_log using the same semantic
by reporting the blocksize for every sample.

io_u.c
iolog.h
stat.c

diff --git a/io_u.c b/io_u.c
index 6537c90cf0a0b8208fbc101c460ca9fef559844c..a35aafd2d947617f4da588c11752f3e849f71a54 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1412,7 +1412,7 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u,
        if (!td->o.disable_bw)
                add_bw_sample(td, idx, bytes, &icd->time);
 
-       add_iops_sample(td, idx, &icd->time);
+       add_iops_sample(td, idx, bytes, &icd->time);
 }
 
 static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
diff --git a/iolog.h b/iolog.h
index 70990975f132578a5c2d949a15341d9be7de1be0..8fedc192cd6298be13c229b955b7d651fae2da96 100644 (file)
--- a/iolog.h
+++ b/iolog.h
@@ -118,7 +118,8 @@ extern void add_slat_sample(struct thread_data *, enum fio_ddir, unsigned long,
                                unsigned int);
 extern void add_bw_sample(struct thread_data *, enum fio_ddir, unsigned int,
                                struct timeval *);
-extern void add_iops_sample(struct thread_data *, enum fio_ddir, struct timeval *);
+extern void add_iops_sample(struct thread_data *, enum fio_ddir, unsigned int,
+                               struct timeval *);
 extern void init_disk_util(struct thread_data *);
 extern void update_rusage_stat(struct thread_data *);
 extern void setup_log(struct io_log **, unsigned long, int);
diff --git a/stat.c b/stat.c
index 442caa0cd1973400d5323a7202b6350155a6ae1d..10d9efead57176bee8aeba9abfbccc617520e2c4 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1691,7 +1691,7 @@ void add_bw_sample(struct thread_data *td, enum fio_ddir ddir, unsigned int bs,
        fio_gettime(&td->bw_sample_time, NULL);
 }
 
-void add_iops_sample(struct thread_data *td, enum fio_ddir ddir,
+void add_iops_sample(struct thread_data *td, enum fio_ddir ddir, unsigned int bs,
                     struct timeval *t)
 {
        struct thread_stat *ts = &td->ts;
@@ -1718,7 +1718,7 @@ void add_iops_sample(struct thread_data *td, enum fio_ddir ddir,
                add_stat_sample(&ts->iops_stat[ddir], iops);
 
                if (td->iops_log)
-                       add_log_sample(td, td->iops_log, iops, ddir, 0);
+                       add_log_sample(td, td->iops_log, iops, ddir, bs);
 
                td->stat_io_blocks[ddir] = td->this_io_blocks[ddir];
        }