From: Jens Axboe Date: Fri, 1 Dec 2006 09:52:20 +0000 (+0100) Subject: [PATCH] BTT patch: Fix problem with short runs X-Git-Tag: blktrace-0.99.2~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=e977fa915b278585aa63914bac03d79b955e8c1e;p=blktrace.git [PATCH] BTT patch: Fix problem with short runs Found a problem that if BTT took less than 1 second to execute, we'd get Ktps of - this fixes that... Signed-off-by: Alan D. Brunelle Signed-off-by: Jens Axboe --- diff --git a/btt/bt_timeline.c b/btt/bt_timeline.c index fa56780..e6522c9 100644 --- a/btt/bt_timeline.c +++ b/btt/bt_timeline.c @@ -94,7 +94,8 @@ int process(void) latency_clean(); if (verbose) { - double tps = (double)n_traces / (double)(time(NULL) - genesis); + double tps = (double)n_traces / + (double)((time(NULL) + 1) - genesis); printf("%10lu traces @ %.1lf Ktps\n", n_traces, tps/1000.0); }