Skip to contentSkip to conversation

stat: fix accumulation of latency buckets

PATCH In review [email protected] 2 participants 2 messages Mar 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stat: fix accumulation of latency buckets

From: Vincent Fu <[email protected]>

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(+)
stat.c +4 -0
index 66a13bca..ecef1099 100644
@@ -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++)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · On 3/21/19 10:45 AM, [email protected] wrote:

From: Vincent Fu <[email protected]>

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.

Good catch! Thanks Vincent, applied.

Signature · 1 line
Jens Axboe