Flexible I/O Tester development
 help / color / mirror / Atom feed
From: vincentfu@gmail.com
To: axboe@kernel.dk, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: [PATCH] stat: fix accumulation of latency buckets
Date: Thu, 21 Mar 2019 12:45:13 -0400	[thread overview]
Message-ID: <20190321164513.6475-1-vincentfu@gmail.com> (raw)

From: Vincent Fu <vincent.fu@wdc.com>

The numbers of buckets for nsec, usec, and msec latencies may differ
from each other. So we need to iterate separately over the three types
of buckets.
---
 stat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/stat.c b/stat.c
index 66a13bca..ecef1099 100644
--- a/stat.c
+++ b/stat.c
@@ -1684,7 +1684,11 @@ void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src,
 	}
 	for (k = 0; k < FIO_IO_U_LAT_N_NR; k++) {
 		dst->io_u_lat_n[k] += src->io_u_lat_n[k];
+	}
+	for (k = 0; k < FIO_IO_U_LAT_U_NR; k++) {
 		dst->io_u_lat_u[k] += src->io_u_lat_u[k];
+	}
+	for (k = 0; k < FIO_IO_U_LAT_M_NR; k++) {
 		dst->io_u_lat_m[k] += src->io_u_lat_m[k];
 	}
 	for (k = 0; k < FIO_IO_U_PLAT_NR; k++)
-- 
2.17.1



             reply	other threads:[~2019-03-21 16:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 16:45 vincentfu [this message]
2019-03-21 16:54 ` [PATCH] stat: fix accumulation of latency buckets Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190321164513.6475-1-vincentfu@gmail.com \
    --to=vincentfu@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=vincent.fu@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox