aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-01-22 14:02:41 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2018-02-07 14:09:24 +0100
commit0750b060216de69ed1f14bc08181bf4ad27fc622 (patch)
treee0ef7e6b2cb58054e972333a305902ddc7a8f7e6 /hw/virtio/vhost.c
parentd83414e1fd1941ca8228b5cf6a06697bd1ff7f83 (diff)
vhost: add traces for memory listeners
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 <peterx@redhat.com> Message-Id: <20180122060244.29368-2-peterx@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r--hw/virtio/vhost.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 386aef85be..c4f654c704 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) {