[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 11/21] qemu-io: Account for failed, invalid and f
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH v4 11/21] qemu-io: Account for failed, invalid and flush operations |
Date: |
Wed, 28 Oct 2015 17:33:08 +0200 |
Signed-off-by: Alberto Garcia <address@hidden>
---
qemu-io-cmds.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 6e5d1e4..0cac623 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -1364,6 +1364,7 @@ static void aio_write_done(void *opaque, int ret)
if (ret < 0) {
printf("aio_write failed: %s\n", strerror(-ret));
+ block_acct_failed(blk_get_stats(ctx->blk), &ctx->acct);
goto out;
}
@@ -1392,6 +1393,7 @@ static void aio_read_done(void *opaque, int ret)
if (ret < 0) {
printf("readv failed: %s\n", strerror(-ret));
+ block_acct_failed(blk_get_stats(ctx->blk), &ctx->acct);
goto out;
}
@@ -1505,6 +1507,7 @@ static int aio_read_f(BlockBackend *blk, int argc, char
**argv)
if (ctx->offset & 0x1ff) {
printf("offset %" PRId64 " is not sector aligned\n",
ctx->offset);
+ block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_READ);
g_free(ctx);
return 0;
}
@@ -1512,6 +1515,7 @@ static int aio_read_f(BlockBackend *blk, int argc, char
**argv)
nr_iov = argc - optind;
ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov, 0xab);
if (ctx->buf == NULL) {
+ block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_READ);
g_free(ctx);
return 0;
}
@@ -1600,6 +1604,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char
**argv)
if (ctx->offset & 0x1ff) {
printf("offset %" PRId64 " is not sector aligned\n",
ctx->offset);
+ block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_WRITE);
g_free(ctx);
return 0;
}
@@ -1607,6 +1612,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char
**argv)
nr_iov = argc - optind;
ctx->buf = create_iovec(blk, &ctx->qiov, &argv[optind], nr_iov, pattern);
if (ctx->buf == NULL) {
+ block_acct_invalid(blk_get_stats(blk), BLOCK_ACCT_WRITE);
g_free(ctx);
return 0;
}
@@ -1621,7 +1627,10 @@ static int aio_write_f(BlockBackend *blk, int argc, char
**argv)
static int aio_flush_f(BlockBackend *blk, int argc, char **argv)
{
+ BlockAcctCookie cookie;
+ block_acct_start(blk_get_stats(blk), &cookie, 0, BLOCK_ACCT_FLUSH);
blk_drain_all();
+ block_acct_done(blk_get_stats(blk), &cookie);
return 0;
}
--
2.6.1
- [Qemu-devel] [PATCH v4 05/21] block: Add idle_time_ns to BlockDeviceStats, (continued)
- [Qemu-devel] [PATCH v4 05/21] block: Add idle_time_ns to BlockDeviceStats, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 04/21] util: Infrastructure for computing recent averages, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 01/21] xen_disk: Account for flush operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 03/21] block: define 'clock_type' for the accounting code, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 07/21] block: Allow configuring whether to account failed and invalid ops, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 16/21] xen_disk: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 08/21] block: Compute minimum, maximum and average I/O latencies, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 15/21] virtio-blk: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 21/21] block: Update copyright of the accounting code, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 11/21] qemu-io: Account for failed, invalid and flush operations,
Alberto Garcia <=
- [Qemu-devel] [PATCH v4 20/21] scsi-disk: Account for failed operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 17/21] atapi: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 13/21] iotests: Add test for the block device statistics, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 14/21] nvme: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 18/21] ide: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 19/21] macio: Account for failed operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 12/21] block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 10/21] block: New option to define the intervals for collecting I/O statistics, Alberto Garcia, 2015/10/28