From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJIx-00063e-Cg for qemu-devel@nongnu.org; Sun, 20 May 2012 23:29:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWJIv-0003DE-KF for qemu-devel@nongnu.org; Sun, 20 May 2012 23:29:06 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:57474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJIv-0003Cx-CA for qemu-devel@nongnu.org; Sun, 20 May 2012 23:29:05 -0400 Received: by dadv2 with SMTP id v2so7685958dad.4 for ; Sun, 20 May 2012 20:29:02 -0700 (PDT) Message-ID: <4FB9B67A.2020409@gmail.com> Date: Mon, 21 May 2012 08:58:58 +0530 From: Jaspal MIME-Version: 1.0 References: <4FB53E20.40600@gmail.com> <20120517184744.GA4377@amd.home.annexia.org> In-Reply-To: <20120517184744.GA4377@amd.home.annexia.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Memory Tracking API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 05/18/2012 12:17 AM, Richard W.M. Jones wrote: > On Thu, May 17, 2012 at 11:36:24PM +0530, Jaspal wrote: >> Hi , >> >> Is it possible to keep a count of reads / writes taking place in a >> vm using qemu ( using kvm as hypervisor ) ? Is there a api ( or any >> patch ) for it ? > Memory reads and writes is surely going to generate a huge > amount of output! > > There are various DEBUG_* symbols at the top of exec.c and ioport.c. > I've only used a few of these: > > DEBUG_UNASSIGNED - prints a message when an unmapped page is > referenced (TCG only, presumably?) > > DEBUG_IOPORT - prints a message when any I/O port is referenced > > DEBUG_UNUSED_IOPORT - prints a message when a non-emulated I/O port > is referenced > > There are several more if you look at the code. > > Rich. > When are these functions called : kvm_read_guest_page , kvm_read_guest_atomic , kvm_write_guest_page present in kvm_main.c ? When qemu wants to read/write to a page ? If qemu has to read/write on the vm's memory ( RAM ) , does the process always involve kvm ? Thanks , Jaspal