From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTRw9-0000oZ-76 for qemu-devel@nongnu.org; Wed, 10 Feb 2016 05:23:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTRvw-00016r-Hn for qemu-devel@nongnu.org; Wed, 10 Feb 2016 05:23:53 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:38166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTRvw-00016R-AC for qemu-devel@nongnu.org; Wed, 10 Feb 2016 05:23:40 -0500 Received: by mail-wm0-x22b.google.com with SMTP id p63so19812074wmp.1 for ; Wed, 10 Feb 2016 02:23:40 -0800 (PST) Date: Wed, 10 Feb 2016 10:23:37 +0000 From: Stefan Hajnoczi Message-ID: <20160210102337.GE7317@stefanha-x1.localdomain> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="imjhCm/Pyz7Rq5F2" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Tracking the VM making an IO request List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aarian P. Aleahmad" Cc: qemu-devel@nongnu.org --imjhCm/Pyz7Rq5F2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 10, 2016 at 12:35:54PM +0330, Aarian P. Aleahmad wrote: > I'm a student, engaged in a project in which QEMU is a candidate to be used > to make some studies about IO usage etc. > I need to track the IO requests made to the block devices (e.g. HDD, SSD, > etc.). I check the source code but I was confused. What I want to know is > that when an IO request is made, find out that which on of the VMs has made > that request. I'll thank you if you help me on this issue. There are trace events that you can use. See docs/tracing.txt and trace-events. virtio_blk_handle_write and virtio_blk_handle_read can be used if your guest has virtio-blk. The QEMU block layer also has trace events named bdrv_aio_*. Or you could use blktrace(8) in the guest or on the host, depending on how you've set up storage. Finally, if you prefer you could set up an iSCSI or NBD target and simply use Wireshark to record and analyze the I/O request patterns. Stefan --imjhCm/Pyz7Rq5F2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWuw+pAAoJEJykq7OBq3PIeBoH/0YyK9qEyqPtK/cNGUUVz4fx 6QCQod8CWUK0RxLRxSp+6NmYUUgxFi8DozO+1/vHpfwCkvIiKft2H9Yi0E4YGs5h ZAHSbshMfNSk9zJq+XDyQgS6Ghy2Ylp99U0bn1YbRKQ12y7jmitoTFep4phSZtcP gMrupU0087Gdhcn4L1v5KFUS5j/yRLIbdOlZSXQDqlpoG+nRYzSatZRS37gUu4cL ArY1WNftDKjgb/oOuqbTd4qgWnGcsrArHk3hA5t7f/csYU/R4frdl3CBpGkLpCL/ fF61zJNo5IjUQSBbZD0Tbg1Y650rN/eIpFJ/B7PSkw/YcfgBec3QP+N+kANtdZ0= =dNbQ -----END PGP SIGNATURE----- --imjhCm/Pyz7Rq5F2--