From patchwork Thu Dec 22 13:17:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 132844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 506E7B713F for ; Fri, 23 Dec 2011 00:17:35 +1100 (EST) Received: from localhost ([::1]:52249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdiWa-0001LW-Tr for incoming@patchwork.ozlabs.org; Thu, 22 Dec 2011 08:17:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdiWS-0001LC-4B for qemu-devel@nongnu.org; Thu, 22 Dec 2011 08:17:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdiWM-0002oJ-Cw for qemu-devel@nongnu.org; Thu, 22 Dec 2011 08:17:24 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:47300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdiWM-0002o5-1u for qemu-devel@nongnu.org; Thu, 22 Dec 2011 08:17:18 -0500 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Dec 2011 13:17:09 -0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com ([9.149.38.233]) by e06smtp11.uk.ibm.com ([192.168.101.141]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 22 Dec 2011 13:17:08 -0000 Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBMDH7HG2662526 for ; Thu, 22 Dec 2011 13:17:07 GMT Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBMDGwhU017203 for ; Thu, 22 Dec 2011 06:16:59 -0700 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.31]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pBMDGwSW017195; Thu, 22 Dec 2011 06:16:58 -0700 From: Stefan Hajnoczi To: Date: Thu, 22 Dec 2011 13:17:02 +0000 Message-Id: <1324559822-6553-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.3 x-cbid: 11122213-5024-0000-0000-0000012B801A X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.107 Cc: Stefan Hajnoczi Subject: [Qemu-devel] [PATCH] virtio-blk: add virtio_blk_handle_read trace event X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Acked-by: Paolo Bonzini --- 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"