From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6MYb-0004jH-Rx for qemu-devel@nongnu.org; Mon, 05 Aug 2013 11:18:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6MYT-0002aR-2L for qemu-devel@nongnu.org; Mon, 05 Aug 2013 11:18:49 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:63664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6MYS-0002Zc-Uc for qemu-devel@nongnu.org; Mon, 05 Aug 2013 11:18:41 -0400 From: Don Slutz Message-ID: <51FFC24C.6010300@terremark.com> Date: Mon, 5 Aug 2013 11:18:36 -0400 MIME-Version: 1.0 References: <1375014954-31916-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1375014954-31916-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-1.6] memory: add tracepoints for MMIO reads/writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 07/28/13 08:35, Paolo Bonzini wrote: > This is quite handy to debug softmmu targets. > > Signed-off-by: Paolo Bonzini > --- > memory.c | 5 +++++ > trace-events | 4 ++++ > 2 files changed, 9 insertions(+) > > diff --git a/memory.c b/memory.c > index 1494e95..ac6f3c6 100644 > --- a/memory.c > +++ b/memory.c > @@ -19,6 +19,7 @@ > #include "qemu/bitops.h" > #include "qom/object.h" > #include "sysemu/kvm.h" > +#include "trace.h" > #include > > #include "exec/memory-internal.h" > @@ -388,6 +389,7 @@ static void memory_region_oldmmio_read_accessor(MemoryRegion *mr, > uint64_t tmp; > > tmp = mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr); > + trace_memory_region_ops_read(mr, addr, tmp, size); > *value |= (tmp & mask) << shift; > } > > @@ -404,6 +406,7 @@ static void memory_region_read_accessor(MemoryRegion *mr, > qemu_flush_coalesced_mmio_buffer(); > } > tmp = mr->ops->read(mr->opaque, addr, size); > + trace_memory_region_ops_read(mr, addr, tmp, size); > *value |= (tmp & mask) << shift; > } > > @@ -417,6 +420,7 @@ static void memory_region_oldmmio_write_accessor(MemoryRegion *mr, > uint64_t tmp; > > tmp = (*value >> shift) & mask; > + trace_memory_region_ops_write(mr, addr, tmp, size); > mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, tmp); > } > > @@ -433,6 +437,7 @@ static void memory_region_write_accessor(MemoryRegion *mr, > qemu_flush_coalesced_mmio_buffer(); > } > tmp = (*value >> shift) & mask; > + trace_memory_region_ops_write(mr, addr, tmp, size); > mr->ops->write(mr->opaque, addr, tmp, size); > } > > diff --git a/trace-events b/trace-events > index 002df83..3e0dd74 100644 > --- a/trace-events > +++ b/trace-events > @@ -1165,6 +1165,10 @@ kvm_vm_ioctl(int type, void *arg) "type %d, arg %p" > kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p" > kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d" > > +# memory.c > +memory_region_ops_read(void *mr, uint64_t addr, uint64_t value, unsigned size) "mr %p addr %#"PRIx64" value %#"PRIx64" size %d" > +memory_region_ops_write(void *mr, uint64_t addr, uint64_t value, unsigned size) "mr %p addr %#"PRIx64" value %#"PRIx64" size %d" > + Sorry about the late mail. Did you mean to have the stderr trace text to be the same? -Don Slutz > # qom/object.c > object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)" > object_class_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"