t/io_uring: don't print partial IOPS etc output if exit signal was received
authorJens Axboe <axboe@kernel.dk>
Mon, 4 Oct 2021 22:16:01 +0000 (16:16 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 4 Oct 2021 22:16:01 +0000 (16:16 -0600)
The run always terminates with what looks like a much slower cycle than
the previous seconds. That's not really the case, it's just that the
sleep() got interrupted by the signal and we slept less than we thought
we did, yet we still account it as a full second.

Just make it cleaner and break if finish is set.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index c0e571bd7e39186fe9755418f411ae231cf48b23..5132927e47141ebfe39a28de811ebc09d5baa81e 100644 (file)
@@ -1277,6 +1277,10 @@ int main(int argc, char *argv[])
                unsigned long iops, bw;
 
                sleep(1);
+
+               /* don't print partial run, if interrupted by signal */
+               if (finish)
+                       break;
                for (j = 0; j < nthreads; j++) {
                        this_done += s->done;
                        this_call += s->calls;