Blame fio-eliminate-extra-log-samples.patch

Eric Sandeen 1e8b40
From 640150c1b2c3cdbdd8baa5f1f3e7214a5c9a6533 Mon Sep 17 00:00:00 2001
Eric Sandeen 1e8b40
From: Vincent Fu <vincent.fu@wdc.com>
Eric Sandeen 1e8b40
Date: Tue, 31 Mar 2020 07:26:16 -0400
Eric Sandeen 1e8b40
Subject: [PATCH] stat: eliminate extra log samples
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40
b2a432bfbb6d inadvertently added extra log samples.
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40
$ ./fio-canonical/fio --name=test --time_based --runtime=10s --write_lat_log=fio-07-b2a432 --log_avg_msec=1000 --size=1G --rw=rw
Eric Sandeen 1e8b40
test: (g=0): rw=rw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
Eric Sandeen 1e8b40
fio-3.17-93-gb2a4
Eric Sandeen 1e8b40
Starting 1 process
Eric Sandeen 1e8b40
...
Eric Sandeen 1e8b40
$ cat fio-07-b2a432_clat.1.log
Eric Sandeen 1e8b40
1000, 5851, 0, 0, 0
Eric Sandeen 1e8b40
1000, 2551, 1, 0, 0
Eric Sandeen 1e8b40
1000, 5028, 1, 0, 0
Eric Sandeen 1e8b40
2000, 4175, 0, 0, 0
Eric Sandeen 1e8b40
2000, 3214, 1, 0, 0
Eric Sandeen 1e8b40
2000, 60619, 0, 0, 0
Eric Sandeen 1e8b40
...
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40
There should only be two lines at each timestamp (one for reads, one for
Eric Sandeen 1e8b40
writes), but the first two timestamps have three lines each.
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40
The cause is an inadvertent change in stat.c:add_log_sample() of
Eric Sandeen 1e8b40
__add_stat_to_log to _add_stat_to_log. Reverting to the two-underscore
Eric Sandeen 1e8b40
version resolves this issue.
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40
Fixes: https://github.com/axboe/fio/issues/947
Eric Sandeen 1e8b40
Fixes: b2a432bfbb6d ("Per-command priority: Priority logging and libaio/io_uring cmdprio_percentage")
Eric Sandeen 1e8b40
Signed-off-by: Vincent Fu <vincent.fu@wdc.com>
Eric Sandeen 1e8b40
---
Eric Sandeen 1e8b40
 stat.c | 2 +-
Eric Sandeen 1e8b40
 1 file changed, 1 insertion(+), 1 deletion(-)
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40
diff --git a/stat.c b/stat.c
Eric Sandeen 1e8b40
index d8c01d14..efa811d2 100644
Eric Sandeen 1e8b40
--- a/stat.c
Eric Sandeen 1e8b40
+++ b/stat.c
Eric Sandeen 1e8b40
@@ -2749,7 +2749,7 @@ static unsigned long add_log_sample(struct thread_data *td,
Eric Sandeen 1e8b40
 			return diff;
Eric Sandeen 1e8b40
 	}
Eric Sandeen 1e8b40
 
Eric Sandeen 1e8b40
-	_add_stat_to_log(iolog, elapsed, td->o.log_max != 0, priority_bit);
Eric Sandeen 1e8b40
+	__add_stat_to_log(iolog, ddir, elapsed, td->o.log_max != 0, priority_bit);
Eric Sandeen 1e8b40
 
Eric Sandeen 1e8b40
 	iolog->avg_last[ddir] = elapsed - (this_window - iolog->avg_msec);
Eric Sandeen 1e8b40
 	return iolog->avg_msec;
Eric Sandeen 1e8b40
-- 
Eric Sandeen 1e8b40
2.17.1
Eric Sandeen 1e8b40
Eric Sandeen 1e8b40