From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtIkI-0005Dx-Kl for qemu-devel@nongnu.org; Mon, 02 Nov 2015 12:18:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtIkD-0006d9-BO for qemu-devel@nongnu.org; Mon, 02 Nov 2015 12:18:14 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:43770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtIkD-0006ZW-5U for qemu-devel@nongnu.org; Mon, 02 Nov 2015 12:18:09 -0500 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1ZtIk7-0005It-UO from Hollis_Blanchard@mentor.com for qemu-devel@nongnu.org; Mon, 02 Nov 2015 09:18:03 -0800 From: Hollis Blanchard Message-ID: <56379ACB.3010905@mentor.com> Date: Mon, 2 Nov 2015 09:18:03 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------010800020806030901080704" Subject: [Qemu-devel] anybody using MMIO tracing? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --------------010800020806030901080704 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit I'm trying to use the memory_region_ops_read/write tracepoints. They produce output like this: memory_region_ops_write 0.000 pid=8861 mr=0x185b1e8 addr=0x0 value=0x3 size=0x4 memory_region_ops_write 165.000 pid=8861 mr=0x185b1e8 addr=0x80 value=0xffffffff size=0x4 memory_region_ops_write 155.000 pid=8861 mr=0x1914240 addr=0x0 value=0x3 size=0x4 memory_region_ops_write 2.000 pid=8861 mr=0x185b320 addr=0x0 value=0x3 size=0x4 memory_region_ops_write 134.000 pid=8861 mr=0x1914240 addr=0x4 value=0x80 size=0x4 How do I discover which devices are represented by MemoryRegions 0x185b1e8 and 0x1914240? Or alternatively how do I discover the full addresses? Thanks. -- Hollis Blanchard Mentor Graphics Emulation Division --------------010800020806030901080704 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit I'm trying to use the memory_region_ops_read/write tracepoints. They produce output like this:
memory_region_ops_write 0.000 pid=8861 mr=0x185b1e8 addr=0x0 value=0x3 size=0x4
memory_region_ops_write 165.000 pid=8861 mr=0x185b1e8 addr=0x80 value=0xffffffff size=0x4
memory_region_ops_write 155.000 pid=8861 mr=0x1914240 addr=0x0 value=0x3 size=0x4
memory_region_ops_write 2.000 pid=8861 mr=0x185b320 addr=0x0 value=0x3 size=0x4
memory_region_ops_write 134.000 pid=8861 mr=0x1914240 addr=0x4 value=0x80 size=0x4
How do I discover which devices are represented by MemoryRegions 0x185b1e8 and 0x1914240? Or alternatively how do I discover the full addresses? Thanks.

--
Hollis Blanchard
Mentor Graphics Emulation Division

--------------010800020806030901080704-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuewD-0008NE-HP for qemu-devel@nongnu.org; Fri, 06 Nov 2015 06:12:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuewA-0001Ai-As for qemu-devel@nongnu.org; Fri, 06 Nov 2015 06:12:09 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuewA-0001Ae-58 for qemu-devel@nongnu.org; Fri, 06 Nov 2015 06:12:06 -0500 Received: by wmll128 with SMTP id l128so37819702wml.0 for ; Fri, 06 Nov 2015 03:12:05 -0800 (PST) Date: Fri, 6 Nov 2015 11:12:03 +0000 From: Stefan Hajnoczi Message-ID: <20151106111203.GF12285@stefanha-x1.localdomain> References: <56379ACB.3010905@mentor.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Il7n/DHsA0sMLmDu" Content-Disposition: inline In-Reply-To: <56379ACB.3010905@mentor.com> Subject: Re: [Qemu-devel] anybody using MMIO tracing? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hollis Blanchard Cc: qemu-devel@nongnu.org --Il7n/DHsA0sMLmDu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 02, 2015 at 09:18:03AM -0800, Hollis Blanchard wrote: > I'm trying to use the memory_region_ops_read/write tracepoints. They prod= uce > output like this: >=20 > memory_region_ops_write 0.000 pid=3D8861 mr=3D0x185b1e8 addr=3D0x0 > value=3D0x3 size=3D0x4 > memory_region_ops_write 165.000 pid=3D8861 mr=3D0x185b1e8 addr=3D0x80 > value=3D0xffffffff size=3D0x4 > memory_region_ops_write 155.000 pid=3D8861 mr=3D0x1914240 addr=3D0x0 > value=3D0x3 size=3D0x4 > memory_region_ops_write 2.000 pid=3D8861 mr=3D0x185b320 addr=3D0x0 > value=3D0x3 size=3D0x4 > memory_region_ops_write 134.000 pid=3D8861 mr=3D0x1914240 addr=3D0x4 > value=3D0x80 size=3D0x4 >=20 > How do I discover which devices are represented by MemoryRegions 0x185b1e8 > and 0x1914240? Or alternatively how do I discover the full addresses? As a KVM user I use the kvm:kvm_mmio and kvm:kvm_pio kernel trace events. I'm not sure of the best way but you could look at memory.c:mtree_info() (aka "info mtree" monitor command) and print out all MemoryRegion pointers so you can correlate them with the trace output. Stefan --Il7n/DHsA0sMLmDu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWPIrwAAoJEJykq7OBq3PItzIH/j3MTHPdfWjxdZh205yKVBHX +XMt5HPe39UEB0qJvkOEstFqq0fXFqUyAsPLkJi79JjMdUQKWxXxgfo1TMrfy0FZ GL18SX31u1G2fWpDvHU4pDekpnxZEih+6TiTz5KT96H2G3Wc0SvKj2AfgzFqNwB7 esAUn1fAq8jOLrksk1zPraVU8vEQ3HiPbzQ56YSnfqLYKNuZT9NjIBatheWHkuCD gdSf6B6Sp69Dl/ZcBmM5rBZX1Yjx/oaFE3pMcF7c+YMm/fzeYynp0sJ4PkXQTdrK AEnq0PrDckxzbl6FP5wlnA7GYiZMC6maNqt3idBQovCz0wbEbSYkWnhf1RjMvGQ= =+uLD -----END PGP SIGNATURE----- --Il7n/DHsA0sMLmDu-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zuezg-0000xL-FR for qemu-devel@nongnu.org; Fri, 06 Nov 2015 06:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zuezf-00024I-GO for qemu-devel@nongnu.org; Fri, 06 Nov 2015 06:15:44 -0500 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:34365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zuezf-00024E-39 for qemu-devel@nongnu.org; Fri, 06 Nov 2015 06:15:43 -0500 Received: by vkgs66 with SMTP id s66so11782807vkg.1 for ; Fri, 06 Nov 2015 03:15:42 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20151106111203.GF12285@stefanha-x1.localdomain> References: <56379ACB.3010905@mentor.com> <20151106111203.GF12285@stefanha-x1.localdomain> From: Peter Maydell Date: Fri, 6 Nov 2015 11:15:23 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] anybody using MMIO tracing? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Hollis Blanchard , QEMU Developers On 6 November 2015 at 11:12, Stefan Hajnoczi wrote: > On Mon, Nov 02, 2015 at 09:18:03AM -0800, Hollis Blanchard wrote: >> I'm trying to use the memory_region_ops_read/write tracepoints. They produce >> output like this: >> >> memory_region_ops_write 0.000 pid=8861 mr=0x185b1e8 addr=0x0 >> value=0x3 size=0x4 >> memory_region_ops_write 165.000 pid=8861 mr=0x185b1e8 addr=0x80 >> value=0xffffffff size=0x4 >> memory_region_ops_write 155.000 pid=8861 mr=0x1914240 addr=0x0 >> value=0x3 size=0x4 >> memory_region_ops_write 2.000 pid=8861 mr=0x185b320 addr=0x0 >> value=0x3 size=0x4 >> memory_region_ops_write 134.000 pid=8861 mr=0x1914240 addr=0x4 >> value=0x80 size=0x4 >> >> How do I discover which devices are represented by MemoryRegions 0x185b1e8 >> and 0x1914240? Or alternatively how do I discover the full addresses? > > As a KVM user I use the kvm:kvm_mmio and kvm:kvm_pio kernel trace > events. Is there a reason why we can't print the mr->name in this tracing? thanks -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zul7B-0006nI-Lt for qemu-devel@nongnu.org; Fri, 06 Nov 2015 12:47:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zul76-0006YS-Mg for qemu-devel@nongnu.org; Fri, 06 Nov 2015 12:47:53 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:52234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zul76-0006X2-DR for qemu-devel@nongnu.org; Fri, 06 Nov 2015 12:47:48 -0500 References: <56379ACB.3010905@mentor.com> <20151106111203.GF12285@stefanha-x1.localdomain> From: Hollis Blanchard Message-ID: <563CE7C1.4020504@mentor.com> Date: Fri, 6 Nov 2015 09:47:45 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------020900040401070307070508" Subject: Re: [Qemu-devel] anybody using MMIO tracing? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Stefan Hajnoczi Cc: Paolo Bonzini , QEMU Developers --------------020900040401070307070508 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit On 11/06/2015 03:15 AM, Peter Maydell wrote: > On 6 November 2015 at 11:12, Stefan Hajnoczi wrote: >> On Mon, Nov 02, 2015 at 09:18:03AM -0800, Hollis Blanchard wrote: >>> I'm trying to use the memory_region_ops_read/write tracepoints. They produce >>> output like this: >>> >>> memory_region_ops_write 0.000 pid=8861 mr=0x185b1e8 addr=0x0 >>> value=0x3 size=0x4 >>> memory_region_ops_write 165.000 pid=8861 mr=0x185b1e8 addr=0x80 >>> value=0xffffffff size=0x4 >>> memory_region_ops_write 155.000 pid=8861 mr=0x1914240 addr=0x0 >>> value=0x3 size=0x4 >>> memory_region_ops_write 2.000 pid=8861 mr=0x185b320 addr=0x0 >>> value=0x3 size=0x4 >>> memory_region_ops_write 134.000 pid=8861 mr=0x1914240 addr=0x4 >>> value=0x80 size=0x4 >>> >>> How do I discover which devices are represented by MemoryRegions 0x185b1e8 >>> and 0x1914240? Or alternatively how do I discover the full addresses? >> As a KVM user I use the kvm:kvm_mmio and kvm:kvm_pio kernel trace >> events. > Is there a reason why we can't print the mr->name in this tracing? That works, and I was going to suggest it if there's no better answer. I'm not sure however if it's possible to disambiguate the trace messages if you have multiple instances of the same device type. Other improvements could be important too, like displaying which core was performing the access. So maybe just displaying the name first is a good step forward for now, and separately there's an improvement wishlist for the future. I was just confused because Paolo's original patch said "This is quite handy to debug softmmu targets", so I figured I must be missing something that would make it handy. :-) By the way, docs/tracing.txt says: The "simple" backend currently does not capture string arguments, it simply records the char* pointer value instead of the string that is pointed to. This seems no longer to be the case, because string arguments display fine for me... Hollis Blanchard Mentor Graphics Emulation Division --------------020900040401070307070508 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit On 11/06/2015 03:15 AM, Peter Maydell wrote:
On 6 November 2015 at 11:12, Stefan Hajnoczi <stefanha@gmail.com> wrote:
On Mon, Nov 02, 2015 at 09:18:03AM -0800, Hollis Blanchard wrote:
I'm trying to use the memory_region_ops_read/write tracepoints. They produce
output like this:

   memory_region_ops_write 0.000 pid=8861 mr=0x185b1e8 addr=0x0
   value=0x3 size=0x4
   memory_region_ops_write 165.000 pid=8861 mr=0x185b1e8 addr=0x80
   value=0xffffffff size=0x4
   memory_region_ops_write 155.000 pid=8861 mr=0x1914240 addr=0x0
   value=0x3 size=0x4
   memory_region_ops_write 2.000 pid=8861 mr=0x185b320 addr=0x0
   value=0x3 size=0x4
   memory_region_ops_write 134.000 pid=8861 mr=0x1914240 addr=0x4
   value=0x80 size=0x4

How do I discover which devices are represented by MemoryRegions 0x185b1e8
and 0x1914240? Or alternatively how do I discover the full addresses?
As a KVM user I use the kvm:kvm_mmio and kvm:kvm_pio kernel trace
events.
Is there a reason why we can't print the mr->name in this tracing?

That works, and I was going to suggest it if there's no better answer. I'm not sure however if it's possible to disambiguate the trace messages if you have multiple instances of the same device type. Other improvements could be important too, like displaying which core was performing the access. So maybe just displaying the name first is a good step forward for now, and separately there's an improvement wishlist for the future.

I was just confused because Paolo's original patch said "This is quite handy to debug softmmu targets", so I figured I must be missing something that would make it handy. :-)

By the way, docs/tracing.txt says:
The "simple" backend currently does not capture string arguments, it simply
records the char* pointer value instead of the string that is pointed to.
This seems no longer to be the case, because string arguments display fine for me...

Hollis Blanchard
Mentor Graphics Emulation Division

--------------020900040401070307070508-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxAk8-00084Z-Kv for qemu-devel@nongnu.org; Fri, 13 Nov 2015 04:34:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxAk5-0007wo-F9 for qemu-devel@nongnu.org; Fri, 13 Nov 2015 04:34:04 -0500 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:36056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxAk5-0007wi-8O for qemu-devel@nongnu.org; Fri, 13 Nov 2015 04:34:01 -0500 Received: by pacdm15 with SMTP id dm15so95175811pac.3 for ; Fri, 13 Nov 2015 01:34:00 -0800 (PST) Date: Fri, 13 Nov 2015 17:33:57 +0800 From: Stefan Hajnoczi Message-ID: <20151113093356.GC6650@stefanha-x1.localdomain> References: <56379ACB.3010905@mentor.com> <20151106111203.GF12285@stefanha-x1.localdomain> <563CE7C1.4020504@mentor.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IpbVkmxF4tDyP/Kb" Content-Disposition: inline In-Reply-To: <563CE7C1.4020504@mentor.com> Subject: Re: [Qemu-devel] anybody using MMIO tracing? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hollis Blanchard Cc: Peter Maydell , QEMU Developers , Paolo Bonzini --IpbVkmxF4tDyP/Kb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 06, 2015 at 09:47:45AM -0800, Hollis Blanchard wrote: > By the way, docs/tracing.txt says: >=20 > The "simple" backend currently does not capture string arguments, it > simply > records the char* pointer value instead of the string that is > pointed to. >=20 > This seems no longer to be the case, because string arguments display fine > for me... You are right, thanks for spotting it! Stefan --IpbVkmxF4tDyP/Kb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWRa6EAAoJEJykq7OBq3PI5FoIAIkPoV8Kf1fERlsjBMjMHQ8u 5DXyzy9nCH1ogfZqUO8fUABAHyE1xrj4Zglp2SmmFbHTbX70xeuSGnd3CyGTJbtW 4WOs+n9ZP0MnRGM5SZpmbwCel3OO26dCoMYE8Ax7gkEOlrJjpaal+C8HEF/uAeyX ilbxkYj6XFEglHXhOElTM5hSAnPVHZ7NcZ88nytYSDz3D3eqLklA8Vs3jTQAudEl SU3Ym/62v6i7HVUq/UN5jIaJWW/f1TlgrBbHmc8p68E1V40KGrJ/gNaA7VUgjisJ OLCXATEcFgM+JBgHtWFDgU0NLSrhaZQ3t/mPHqIJlIqny5GvNYk9nZuIKzv/8Nc= =rfR4 -----END PGP SIGNATURE----- --IpbVkmxF4tDyP/Kb--