From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Kevin Wolf 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> Subject: [Qemu-devel] [PULL v2 08/26] raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev() 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: 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); } -- 1.8.1.4