From aba6c951a6ecfa7f5471fa0c53ccf85afa32e9a5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 13 Feb 2014 19:59:56 -0700 Subject: [PATCH] Don't compute iops samples for gtod_reduce=1 Signed-off-by: Jens Axboe --- io_u.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/io_u.c b/io_u.c index acc1a7b1..5f39987a 100644 --- a/io_u.c +++ b/io_u.c @@ -1521,13 +1521,19 @@ void io_u_log_error(struct thread_data *td, struct io_u *io_u) td_verror(td, io_u->error, "io_u error"); } +static inline int gtod_reduce(struct thread_data *td) +{ + return !td->o.disable_clat || !td->o.disable_lat || + !td->o.disable_slat || !td->o.disable_bw; +} + static void account_io_completion(struct thread_data *td, struct io_u *io_u, struct io_completion_data *icd, const enum fio_ddir idx, unsigned int bytes) { unsigned long lusec = 0; - if (!td->o.disable_clat || !td->o.disable_bw) + if (!gtod_reduce(td)) lusec = utime_since(&io_u->issue_time, &icd->time); if (!td->o.disable_lat) { @@ -1559,7 +1565,8 @@ 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, bytes, &icd->time); + if (!gtod_reduce(td)) + add_iops_sample(td, idx, bytes, &icd->time); if (td->o.number_ios && !--td->o.number_ios) td->done = 1; @@ -1680,7 +1687,8 @@ static void init_icd(struct thread_data *td, struct io_completion_data *icd, int nr) { int ddir; - if (!td->o.disable_clat || !td->o.disable_bw) + + if (!gtod_reduce(td)) fio_gettime(&icd->time, NULL); icd->nr = nr; -- 2.25.1