[PATCH] BTT patch: Fix problem with short runs
authorJens Axboe <jens.axboe@oracle.com>
Fri, 1 Dec 2006 09:52:20 +0000 (10:52 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 1 Dec 2006 09:52:20 +0000 (10:52 +0100)
Found a problem that if BTT took less than 1 second to execute, we'd get
Ktps of <nan> - this fixes that...

Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
btt/bt_timeline.c

index fa5678087b69de800007aa5326a5cd4ffc61f37c..e6522c9d69df1e6cdaac7bf69b01d177b3d4ae15 100644 (file)
@@ -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);
        }