From patchwork Mon Sep 2 08:49:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 271774 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5B2AC2C0097 for ; Mon, 2 Sep 2013 18:56:23 +1000 (EST) Received: from localhost ([::1]:38008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGPvp-0007n5-1B for incoming@patchwork.ozlabs.org; Mon, 02 Sep 2013 04:56:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGPqO-0007b7-Ro for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGPqI-0005HU-26 for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:50:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGPqH-0005H5-Lx for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:50:37 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r828oYku023819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Sep 2013 04:50:36 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r828o7mb016887; Mon, 2 Sep 2013 04:50:34 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 2 Sep 2013 10:49:34 +0200 Message-Id: <1378111792-20436-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1378111792-20436-1-git-send-email-kwolf@redhat.com> References: <1378111792-20436-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL v2 08/26] raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev() 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 From: Laszlo Ersek On 08/05/13 15:03, Paolo Bonzini wrote: > > [...] > > 1) BlockDriver is a struct in which these function members are > interesting: > > .bdrv_reopen_prepare > .bdrv_co_readv > .bdrv_co_writev > .bdrv_co_is_allocated > .bdrv_co_write_zeroes > .bdrv_co_discard > .bdrv_getlength > .bdrv_get_info > .bdrv_truncate > .bdrv_is_inserted > .bdrv_media_changed > .bdrv_eject > .bdrv_lock_medium > .bdrv_ioctl > .bdrv_aio_ioctl > .bdrv_has_zero_init > > They should be implemented as simple forwarders (see above). There are > 16 functions listed here, you can easily see how this already accounts > for 100+ SLOC roughly... > > The implementations of bdrv_co_readv and bdrv_co_writev should also call > BLKDBG_EVENT on bs->file too, before forwarding to bs->file. The events > to be generated are BLKDBG_READ_AIO and BLKDBG_WRITE_AIO. Signed-off-by: Laszlo Ersek Signed-off-by: Kevin Wolf --- block/raw_bsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/raw_bsd.c b/block/raw_bsd.c index 5c17d53..19091a3 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -33,11 +33,13 @@ static TYPE raw_reopen_prepare(BlockDriverState *bs) static TYPE raw_co_readv(BlockDriverState *bs) { + BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); return bdrv_co_readv(bs->file); } static TYPE raw_co_writev(BlockDriverState *bs) { + BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); return bdrv_co_writev(bs->file); }