[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 26/44] block: define 'clock_type' for the accounting
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 26/44] block: define 'clock_type' for the accounting code |
Date: |
Tue, 10 Nov 2015 14:14:21 +0000 |
From: Alberto Garcia <address@hidden>
Its value is still QEMU_CLOCK_REALTIME, but having it in a variable will
allow us to change its value easily in the future when running in qtest
mode.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/accounting.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/accounting.c b/block/accounting.c
index a423560..6f4c0f1 100644
--- a/block/accounting.c
+++ b/block/accounting.c
@@ -26,13 +26,15 @@
#include "block/block_int.h"
#include "qemu/timer.h"
+static QEMUClockType clock_type = QEMU_CLOCK_REALTIME;
+
void block_acct_start(BlockAcctStats *stats, BlockAcctCookie *cookie,
int64_t bytes, enum BlockAcctType type)
{
assert(type < BLOCK_MAX_IOTYPE);
cookie->bytes = bytes;
- cookie->start_time_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
+ cookie->start_time_ns = qemu_clock_get_ns(clock_type);
cookie->type = type;
}
@@ -43,7 +45,7 @@ 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] +=
- qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - cookie->start_time_ns;
+ qemu_clock_get_ns(clock_type) - cookie->start_time_ns;
}
--
2.5.0
- [Qemu-devel] [PULL 17/44] blockjob: Simplify block_job_finish_sync, (continued)
- [Qemu-devel] [PULL 17/44] blockjob: Simplify block_job_finish_sync, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 15/44] blockjob: Add .commit and .abort block job actions, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 19/44] block/backup: Rely on commit/abort for cleanup, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 20/44] block: Add BlockJobTxn support to backup_run, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 22/44] iotests: 124 - transactional failure test, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 21/44] block: add transactional properties, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 23/44] tests: add BlockJobTxn unit test, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 25/44] ide: Account for write operations correctly, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 24/44] xen_disk: Account for flush operations, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 26/44] block: define 'clock_type' for the accounting code,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 27/44] util: Infrastructure for computing recent averages, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 28/44] block: Add idle_time_ns to BlockDeviceStats, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 30/44] block: Allow configuring whether to account failed and invalid ops, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 29/44] block: Add statistics for failed and invalid I/O operations, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 32/44] block: Add average I/O queue depth to BlockDeviceTimedStats, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 34/44] qemu-io: Account for failed, invalid and flush operations, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 31/44] block: Compute minimum, maximum and average I/O latencies, Stefan Hajnoczi, 2015/11/10
- [Qemu-devel] [PULL 33/44] block: New option to define the intervals for collecting I/O statistics, Stefan Hajnoczi, 2015/11/10