diff options
Diffstat (limited to 'block/accounting.c')
-rw-r--r-- | block/accounting.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/block/accounting.c b/block/accounting.c index edbb1cc89f..18102f015d 100644 --- a/block/accounting.c +++ b/block/accounting.c @@ -24,6 +24,7 @@ #include "block/accounting.h" #include "block/block_int.h" +#include "qemu/timer.h" void block_acct_start(BlockAcctStats *stats, BlockAcctCookie *cookie, int64_t bytes, enum BlockAcctType type) @@ -31,7 +32,7 @@ void block_acct_start(BlockAcctStats *stats, BlockAcctCookie *cookie, assert(type < BLOCK_MAX_IOTYPE); cookie->bytes = bytes; - cookie->start_time_ns = get_clock(); + cookie->start_time_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); cookie->type = type; } @@ -41,7 +42,8 @@ void block_acct_done(BlockAcctStats *stats, BlockAcctCookie *cookie) stats->nr_bytes[cookie->type] += cookie->bytes; stats->nr_ops[cookie->type]++; - stats->total_time_ns[cookie->type] += get_clock() - cookie->start_time_ns; + stats->total_time_ns[cookie->type] += + qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - cookie->start_time_ns; } |