Skip to contentSkip to conversation

virtio-blk: add virtio_blk_handle_read trace event

PATCH Applied Stefan Hajnoczi 3 participants 3 messages Dec 22, 2011 – Jan 23, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-blk: add virtio_blk_handle_read trace event

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.

---
 hw/virtio-blk.c |    2 ++
 trace-events    |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
hw/virtio-blk.c +2 -0
index ef27421..cf275e4 100644
@@ -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;
trace-events +1 -0
index 514849a..2875ea8f6 100644
@@ -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"
Signature · 1 line
1.7.7.3
Acked-by on v1 1/1
#1 lore raw
Quoted 28 lines · 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.

---
  hw/virtio-blk.c |    2 ++
  trace-events    |    1 +
  2 files changed, 3 insertions(+), 0 deletions(-)
hw/virtio-blk.c +2 -0
index ef27421..cf275e4 100644
@@ -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;
trace-events +0 -0
index 514849a..2875ea8f6 100644

trace-events bdrv_co_copy_on_readv(void *bs, int64_t sector_num, int nb_sectors, int64_t clus · line 79

Quoted 7 lines
trace-events +1 -0
@@ -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"
Applied
#2 lore raw
In reply to Stefan Hajnoczi

Am 22.12.2011 14:17, schrieb Stefan Hajnoczi:

Quoted 5 lines

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.

Thanks, applied to the block branch.

Kevin