From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef7fZ-0007TF-33 for qemu-devel@nongnu.org; Fri, 26 Jan 2018 12:20:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ef7fU-00088Y-1J for qemu-devel@nongnu.org; Fri, 26 Jan 2018 12:20:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40598) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ef7fT-00087j-M4 for qemu-devel@nongnu.org; Fri, 26 Jan 2018 12:19:59 -0500 Date: Fri, 26 Jan 2018 18:44:25 +0200 From: "Michael S. Tsirkin" Message-ID: <20180126184359-mutt-send-email-mst@kernel.org> References: <20180122060244.29368-1-peterx@redhat.com> <20180122060244.29368-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180122060244.29368-2-peterx@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/4] vhost: add traces for memory listeners List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: qemu-devel@nongnu.org, David Gibson , Paolo Bonzini , Peter Maydell , Alex Williamson , Alexey Kardashevskiy On Mon, Jan 22, 2018 at 02:02:41PM +0800, Peter Xu wrote: > Trace these operations on two memory listeners. It helps to verify the > new memory listener fix, and good to keep them there. > > Signed-off-by: Peter Xu I'm not sure what this have to do with vfio, but anyway: Acked-by: Michael S. Tsirkin > --- > hw/virtio/trace-events | 6 ++++++ > hw/virtio/vhost.c | 7 +++++++ > 2 files changed, 13 insertions(+) > > diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events > index 775461ae98..2b8f81eb25 100644 > --- a/hw/virtio/trace-events > +++ b/hw/virtio/trace-events > @@ -25,3 +25,9 @@ virtio_balloon_handle_output(const char *name, uint64_t gpa) "section name: %s g > virtio_balloon_get_config(uint32_t num_pages, uint32_t actual) "num_pages: %d actual: %d" > virtio_balloon_set_config(uint32_t actual, uint32_t oldactual) "actual: %d oldactual: %d" > virtio_balloon_to_target(uint64_t target, uint32_t num_pages) "balloon target: 0x%"PRIx64" num_pages: %d" > + > +# hw/virtio/vhost.c > +vhost_region_add(void *p, const char *mr) "dev %p mr %s" > +vhost_region_del(void *p, const char *mr) "dev %p mr %s" > +vhost_iommu_region_add(void *p, const char *mr) "dev %p mr %s" > +vhost_iommu_region_del(void *p, const char *mr) "dev %p mr %s" > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index e4290ce93d..19a7a3cb37 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -27,6 +27,7 @@ > #include "hw/virtio/virtio-access.h" > #include "migration/blocker.h" > #include "sysemu/dma.h" > +#include "trace.h" > > /* enabled until disconnected backend stabilizes */ > #define _VHOST_DEBUG 1 > @@ -687,6 +688,7 @@ static void vhost_region_add(MemoryListener *listener, > return; > } > > + trace_vhost_region_add(dev, section->mr->name ?: NULL); > ++dev->n_mem_sections; > dev->mem_sections = g_renew(MemoryRegionSection, dev->mem_sections, > dev->n_mem_sections); > @@ -706,6 +708,7 @@ static void vhost_region_del(MemoryListener *listener, > return; > } > > + trace_vhost_region_del(dev, section->mr->name ?: NULL); > vhost_set_memory(listener, section, false); > memory_region_unref(section->mr); > for (i = 0; i < dev->n_mem_sections; ++i) { > @@ -743,6 +746,8 @@ static void vhost_iommu_region_add(MemoryListener *listener, > return; > } > > + trace_vhost_iommu_region_add(dev, section->mr->name ?: NULL); > + > iommu = g_malloc0(sizeof(*iommu)); > end = int128_add(int128_make64(section->offset_within_region), > section->size); > @@ -771,6 +776,8 @@ static void vhost_iommu_region_del(MemoryListener *listener, > return; > } > > + trace_vhost_iommu_region_del(dev, section->mr->name ?: NULL); > + > QLIST_FOREACH(iommu, &dev->iommu_list, iommu_next) { > if (iommu->mr == section->mr && > iommu->n.start == section->offset_within_region) { > -- > 2.14.3