From 9b7e600ddb531fd359322bbc14e358c10761fe57 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Fri, 2 Aug 2013 16:39:40 +0200 Subject: [PATCH] iolog: Logging blocksize in IOPS traces 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 | 2 +- iolog.h | 3 ++- stat.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/io_u.c b/io_u.c index 6537c90c..a35aafd2 100644 --- 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 70990975..8fedc192 100644 --- 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 442caa0c..10d9efea 100644 --- 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]; } -- 2.25.1