Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] t/zbd: Fix I/O bytes rounding errors
@ 2019-08-09  3:28 Shin'ichiro Kawasaki
  2019-08-09  3:36 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2019-08-09  3:28 UTC (permalink / raw)
  To: fio, Jens Axboe; +Cc: Damien Le Moal, Shinichiro Kawasaki

When fio reports write bytes or read bytes, it rounds the number with
units MiB or KiB to fit the number within limited number of digits.
This results in rounding errors of the reported bytes and sometimes
causes test failures for test case #17 in test-zbd-support
which reports incorrect total I/O bytes in case both of write bytes
and read bytes are rounded up.

To avoid the rounding error, increase the number of digits from default
value 4 to 10 to keep precision. For example, a number "256MiB" will be
reported as "267911168B" with this change.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 t/zbd/test-zbd-support | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
index 10c78e9a..6fb48ef0 100755
--- a/t/zbd/test-zbd-support
+++ b/t/zbd/test-zbd-support
@@ -85,7 +85,8 @@ run_fio() {
 
     fio=$(dirname "$0")/../../fio
 
-    opts=("--aux-path=/tmp" "--allow_file_create=0" "$@")
+    opts=("--aux-path=/tmp" "--allow_file_create=0" \
+			    "--significant_figures=10" "$@")
     { echo; echo "fio ${opts[*]}"; echo; } >>"${logfile}.${test_number}"
 
     "${dynamic_analyzer[@]}" "$fio" "${opts[@]}"
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] t/zbd: Fix I/O bytes rounding errors
  2019-08-09  3:28 [PATCH] t/zbd: Fix I/O bytes rounding errors Shin'ichiro Kawasaki
@ 2019-08-09  3:36 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-08-09  3:36 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki, fio; +Cc: Damien Le Moal

On 8/8/19 8:28 PM, Shin'ichiro Kawasaki wrote:
> When fio reports write bytes or read bytes, it rounds the number with
> units MiB or KiB to fit the number within limited number of digits.
> This results in rounding errors of the reported bytes and sometimes
> causes test failures for test case #17 in test-zbd-support
> which reports incorrect total I/O bytes in case both of write bytes
> and read bytes are rounded up.
> 
> To avoid the rounding error, increase the number of digits from default
> value 4 to 10 to keep precision. For example, a number "256MiB" will be
> reported as "267911168B" with this change.

Thanks, applied.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-09  3:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-09  3:28 [PATCH] t/zbd: Fix I/O bytes rounding errors Shin'ichiro Kawasaki
2019-08-09  3:36 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox