Fix runtime of terse output
authorshoichi.sawada@toshiba.co.jp <shoichi.sawada@toshiba.co.jp>
Tue, 22 Dec 2015 08:16:24 +0000 (08:16 +0000)
committerJens Axboe <axboe@fb.com>
Wed, 23 Dec 2015 16:02:50 +0000 (09:02 -0700)
commit6c041a8880a8993e037a417ba4c6548030da5f12
tree8cfec38926a538fbf090348ad22426750358e4eb
parent5c74fc767600f75cd6d53bdc5926962b75a614ae
Fix runtime of terse output

Hi,

When I used fio with option of '--status-interval=1 --minimal' and 'random_distribution=zipf:1.2',
'runtime' of 2nd line was 18446744073709551345.
This value is -271 in int_64.

This is because 'runtime' was subtracted in function '__show_running_run_stats'.
If 'td->io_bytes' is 0 when this function was called,
and 'td->io_bytes' is not 0 when '__show_run_stats' returned,
'runtime' is subtracted by 'rt' even though 'runtime' have not added.

I fixed the problem by applying this patch to fio-2.2.13.

Regards
Shoichi

----

Signed-off-by: Jens Axboe <axboe@fb.com>
stat.c