From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSIC-0000Vp-En for qemu-devel@nongnu.org; Thu, 26 Jan 2012 11:35:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqSI7-0003TQ-IM for qemu-devel@nongnu.org; Thu, 26 Jan 2012 11:35:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSI7-0003T3-0x for qemu-devel@nongnu.org; Thu, 26 Jan 2012 11:35:15 -0500 From: Kevin Wolf Date: Thu, 26 Jan 2012 17:38:12 +0100 Message-Id: <1327595896-19623-19-git-send-email-kwolf@redhat.com> In-Reply-To: <1327595896-19623-1-git-send-email-kwolf@redhat.com> References: <1327595896-19623-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 18/22] virtio-blk: add virtio_blk_handle_read trace event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: 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 Signed-off-by: Kevin Wolf --- 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 5b416c3..a5a4396 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -346,6 +346,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 ad77e0a..75f6e17 100644 --- a/trace-events +++ b/trace-events @@ -83,6 +83,7 @@ qmp_block_stream(void *bs, void *job) "bs %p job %p" 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.6.5