From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp4ac-000253-7Y for qemu-devel@nongnu.org; Wed, 21 Oct 2015 21:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zp4aZ-0004ec-3S for qemu-devel@nongnu.org; Wed, 21 Oct 2015 21:22:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp4aY-0004eW-UO for qemu-devel@nongnu.org; Wed, 21 Oct 2015 21:22:43 -0400 Date: Thu, 22 Oct 2015 09:22:39 +0800 From: Fam Zheng Message-ID: <20151022012239.GB11063@ad.usersys.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Functions to intercept Disk IO information? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QuQ Edsel Cc: qemu-devel@nongnu.org On Thu, 10/22 01:13, QuQ Edsel wrote: > Hi, > My friends and I were assigned a task to find out a point to insert a > callback function to intercept Disk IO activities such as read/write a .txt > file. Our final goal is to generate a report for target process/file 's > Disk IO activities. We have QEMU 2.3 with KVM enabled. We have been looking > for such a point for long...but not so capable of such a task. > People who had this project last year done so with TEMU 1.0 (probably QEMU > 0.9), and the implementation point they had is dma_buf_rw(). The > information in their report shows pid, timestamps, disk sector, buffer size > and write/read for a target file (I am not even sure if such information is > meaningful or useful) > Currently I have tried to printf in functions such as dma_buf_rw / > dma_blk_io / bdrv_aio_readv...etc. to see if they print out message when I > open/edit/save a .txt or .jpeg file. The first one just don't print at all, > and the second and third one print a lot after booting up the guest.... > I can see that the dma_blk_io function call in ide_dma_cb (core.c) may be > related because it prints as I have activities on files. However it also > prints sometime when I am not doing any thing... so I not that certain > about it. (and I don't know if write/read activities invoke such > function..) Yes, dma_buf_rw should handle all your I/O unless you're doing PIO. I think the other activities you see when you're not doing anything is from guest system's background tasks. Thanks, Fam > > Is there a correct /better point to intercept disk IO information > ?(especially for activities such as read/write a .file) > Or what should I do to clearly get the needed information from Disk IO > functions? > I would be so grateful to have the information. > Thank you. > > The guest environment I have is 64bit Windows 7 with qcow2 image (not sure > if relative) >