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--