[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/47] vhost: add traces for memory listeners
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 21/47] vhost: add traces for memory listeners |
Date: |
Mon, 5 Feb 2018 20:28:35 +0100 |
From: Peter Xu <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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 775461a..2b8f81e 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 386aef8..c4f654c 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) {
--
1.8.3.1
- [Qemu-devel] [PULL 08/47] scsi-generic: Simplify error handling code, (continued)
- [Qemu-devel] [PULL 08/47] scsi-generic: Simplify error handling code, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 09/47] chardev: fix incorrect unref of source, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 11/47] scripts/qemu-gdb/timers.py: define encoding in header comment, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 12/47] memory-internal.h: Remove obsolete claim that header is obsolete, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 13/47] i2c: Add a CONFIG_I2C master switch to the configuration files, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 14/47] Add missing hvdos public domain attribution:, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 15/47] hvf: ept_emulation_fault() needs NetApp BSD attribution, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 18/47] exynos4210: workaround UBSAN compilation error, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 16/47] Drop remaining bits of ia64 host support, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 19/47] build-sys: add --enable-sanitizers, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 21/47] vhost: add traces for memory listeners,
Paolo Bonzini <=
- [Qemu-devel] [PULL 20/47] ucontext: annotate coroutine stack for ASAN, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 17/47] sockets: fix parsing of ipv4/ipv6 opts in parse_socket_addr, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 23/47] vfio: listener unregister before unset container, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 22/47] arm: postpone device listener unregister, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 25/47] chardev/char-socket: add POLLHUP handler, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 24/47] memory: do explicit cleanup when remove listeners, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 28/47] ivshmem: Improve MSI irqfd error handling, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 29/47] ivshmem: Disable irqfd on device reset, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 27/47] ivshmem: Always remove irqfd notifiers, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 32/47] cpus: dummy: unregister thread with RCU, exit loop on unplug, Paolo Bonzini, 2018/02/05