The following changes since commit efcd9dcc5e93fc313b0cd37e267bbf141675826c: Optimize pattern filling by limiting small calls to memcpy (2012-02-02 20:22:04 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (2): Avoid divide-by-zero for disk util on 0 msec runtime Use CLOCK_MONOTONIC if we can diskutil.c | 5 +++-- gettime.c | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) --- Diff of recent changes: diff --git a/diskutil.c b/diskutil.c index 3168b59..4ddaa33 100644 --- a/diskutil.c +++ b/diskutil.c @@ -533,9 +533,10 @@ void free_disk_util(void) void print_disk_util(struct disk_util_stat *dus, struct disk_util_agg *agg, int terse) { - double util; + double util = 0; - util = (double) 100 * dus->io_ticks / (double) dus->msec; + if (dus->msec) + util = (double) 100 * dus->io_ticks / (double) dus->msec; if (util > 100.0) util = 100.0; diff --git a/gettime.c b/gettime.c index 72fda3f..15356b1 100644 --- a/gettime.c +++ b/gettime.c @@ -140,7 +140,11 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller) case CS_CGETTIME: { struct timespec ts; +#ifdef FIO_HAVE_CLOCK_MONOTONIC + if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) { +#else if (clock_gettime(CLOCK_REALTIME, &ts) < 0) { +#endif log_err("fio: clock_gettime fails\n"); assert(0); } -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html