From: Erwan Velu Date: Fri, 2 Aug 2013 14:39:40 +0000 (+0200) Subject: iolog: Logging blocksize in IOPS traces X-Git-Tag: fio-2.1.2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=9b7e600ddb531fd359322bbc14e358c10761fe57 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. --- 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]; }