* [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event
@ 2011-12-22 13:17 Stefan Hajnoczi
2011-12-22 13:30 ` Paolo Bonzini
2012-01-23 11:31 ` Kevin Wolf
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2011-12-22 13:17 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
There already exists a virtio_blk_handle_write trace event as well as
completion events. Add the virtio_blk_handle_read event so it's easy to
trace virtio-blk requests for both read and write operations.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
hw/virtio-blk.c | 2 ++
trace-events | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index ef27421..cf275e4 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -340,6 +340,8 @@ static void virtio_blk_handle_read(VirtIOBlockReq *req)
bdrv_acct_start(req->dev->bs, &req->acct, req->qiov.size, BDRV_ACCT_READ);
+ trace_virtio_blk_handle_read(req, sector, req->qiov.size / 512);
+
if (sector & req->dev->sector_mask) {
virtio_blk_rw_complete(req, -EIO);
return;
diff --git a/trace-events b/trace-events
index 514849a..2875ea8f6 100644
--- a/trace-events
+++ b/trace-events
@@ -73,6 +73,7 @@ bdrv_co_copy_on_readv(void *bs, int64_t sector_num, int nb_sectors, int64_t clus
virtio_blk_req_complete(void *req, int status) "req %p status %d"
virtio_blk_rw_complete(void *req, int ret) "req %p ret %d"
virtio_blk_handle_write(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu"
+virtio_blk_handle_read(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu"
# posix-aio-compat.c
paio_submit(void *acb, void *opaque, int64_t sector_num, int nb_sectors, int type) "acb %p opaque %p sector_num %"PRId64" nb_sectors %d type %d"
--
1.7.7.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event
2011-12-22 13:17 [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event Stefan Hajnoczi
@ 2011-12-22 13:30 ` Paolo Bonzini
2012-01-23 11:31 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2011-12-22 13:30 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel
On 12/22/2011 02:17 PM, Stefan Hajnoczi wrote:
> There already exists a virtio_blk_handle_write trace event as well as
> completion events. Add the virtio_blk_handle_read event so it's easy to
> trace virtio-blk requests for both read and write operations.
>
> Signed-off-by: Stefan Hajnoczi<stefanha@linux.vnet.ibm.com>
> ---
> hw/virtio-blk.c | 2 ++
> trace-events | 1 +
> 2 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
> index ef27421..cf275e4 100644
> --- a/hw/virtio-blk.c
> +++ b/hw/virtio-blk.c
> @@ -340,6 +340,8 @@ static void virtio_blk_handle_read(VirtIOBlockReq *req)
>
> bdrv_acct_start(req->dev->bs,&req->acct, req->qiov.size, BDRV_ACCT_READ);
>
> + trace_virtio_blk_handle_read(req, sector, req->qiov.size / 512);
> +
> if (sector& req->dev->sector_mask) {
> virtio_blk_rw_complete(req, -EIO);
> return;
> diff --git a/trace-events b/trace-events
> index 514849a..2875ea8f6 100644
> --- a/trace-events
> +++ b/trace-events
> @@ -73,6 +73,7 @@ bdrv_co_copy_on_readv(void *bs, int64_t sector_num, int nb_sectors, int64_t clus
> virtio_blk_req_complete(void *req, int status) "req %p status %d"
> virtio_blk_rw_complete(void *req, int ret) "req %p ret %d"
> virtio_blk_handle_write(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu"
> +virtio_blk_handle_read(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu"
>
> # posix-aio-compat.c
> paio_submit(void *acb, void *opaque, int64_t sector_num, int nb_sectors, int type) "acb %p opaque %p sector_num %"PRId64" nb_sectors %d type %d"
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event
2011-12-22 13:17 [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event Stefan Hajnoczi
2011-12-22 13:30 ` Paolo Bonzini
@ 2012-01-23 11:31 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2012-01-23 11:31 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel
Am 22.12.2011 14:17, schrieb Stefan Hajnoczi:
> There already exists a virtio_blk_handle_write trace event as well as
> completion events. Add the virtio_blk_handle_read event so it's easy to
> trace virtio-blk requests for both read and write operations.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-23 11:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 13:17 [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event Stefan Hajnoczi
2011-12-22 13:30 ` Paolo Bonzini
2012-01-23 11:31 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).