summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorStefan Hajnoczi2010-05-22 19:15:08 +0200
committerAnthony Liguori2010-09-09 23:22:45 +0200
commit6d519a5f95960176039baf0af8799fa289915534 (patch)
treec3ede0800ba02c527e99b40382881803fa3305a8 /block.c
parenttrace: Trace qemu_malloc() and qemu_vmalloc() (diff)
downloadqemu-6d519a5f95960176039baf0af8799fa289915534.tar.gz
qemu-6d519a5f95960176039baf0af8799fa289915534.tar.xz
qemu-6d519a5f95960176039baf0af8799fa289915534.zip
trace: Trace virtio-blk, multiwrite, and paio_submit
This patch adds trace events that make it possible to observe virtio-blk. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block.c b/block.c
index 66bba875dd..ebbc376b0c 100644
--- a/block.c
+++ b/block.c
@@ -23,6 +23,7 @@
*/
#include "config-host.h"
#include "qemu-common.h"
+#include "trace.h"
#include "monitor.h"
#include "block_int.h"
#include "module.h"
@@ -2063,6 +2064,8 @@ static void multiwrite_cb(void *opaque, int ret)
{
MultiwriteCB *mcb = opaque;
+ trace_multiwrite_cb(mcb, ret);
+
if (ret < 0 && !mcb->error) {
mcb->error = ret;
}
@@ -2203,6 +2206,8 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
// Check for mergable requests
num_reqs = multiwrite_merge(bs, reqs, num_reqs, mcb);
+ trace_bdrv_aio_multiwrite(mcb, mcb->num_callbacks, num_reqs);
+
/*
* Run the aio requests. As soon as one request can't be submitted
* successfully, fail all requests that are not yet submitted (we must
@@ -2224,6 +2229,7 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
*/
mcb->num_requests = 1;
+ // Run the aio requests
for (i = 0; i < num_reqs; i++) {
mcb->num_requests++;
acb = bdrv_aio_writev(bs, reqs[i].sector, reqs[i].qiov,
@@ -2234,8 +2240,10 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
// submitted yet. Otherwise we'll wait for the submitted AIOs to
// complete and report the error in the callback.
if (i == 0) {
+ trace_bdrv_aio_multiwrite_earlyfail(mcb);
goto fail;
} else {
+ trace_bdrv_aio_multiwrite_latefail(mcb, i);
multiwrite_cb(mcb, -EIO);
break;
}