[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 09/22] hw/virtio: add some vhost-user trace events
From: |
Alex Bennée |
Subject: |
[PATCH v4 09/22] hw/virtio: add some vhost-user trace events |
Date: |
Tue, 2 Aug 2022 10:49:57 +0100 |
These are useful for tracing the lifetime of vhost-user connections.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
hw/virtio/vhost.c | 6 ++++++
hw/virtio/trace-events | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index f758f177bb..5185c15295 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1477,6 +1477,8 @@ void vhost_dev_cleanup(struct vhost_dev *hdev)
{
int i;
+ trace_vhost_dev_cleanup(hdev);
+
for (i = 0; i < hdev->nvqs; ++i) {
vhost_virtqueue_cleanup(hdev->vqs + i);
}
@@ -1783,6 +1785,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev)
/* should only be called after backend is connected */
assert(hdev->vhost_ops);
+ trace_vhost_dev_start(hdev, vdev->name);
+
vdev->vhost_started = true;
hdev->started = true;
hdev->vdev = vdev;
@@ -1869,6 +1873,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice
*vdev)
/* should only be called after backend is connected */
assert(hdev->vhost_ops);
+ trace_vhost_dev_stop(hdev, vdev->name);
+
if (hdev->vhost_ops->vhost_dev_start) {
hdev->vhost_ops->vhost_dev_start(hdev, false);
}
diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 20af2e7ebd..887ca7afa8 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -8,6 +8,10 @@ vhost_region_add_section_aligned(const char *name, uint64_t
gpa, uint64_t size,
vhost_section(const char *name) "%s"
vhost_reject_section(const char *name, int d) "%s:%d"
vhost_iotlb_miss(void *dev, int step) "%p step %d"
+vhost_dev_cleanup(void *dev) "%p"
+vhost_dev_start(void *dev, const char *name) "%p:%s"
+vhost_dev_stop(void *dev, const char *name) "%p:%s"
+
# vhost-user.c
vhost_user_postcopy_end_entry(void) ""
--
2.30.2
- [PATCH v4 for 7.2 00/22] virtio-gpio and various virtio cleanups, Alex Bennée, 2022/08/02
- [PATCH v4 09/22] hw/virtio: add some vhost-user trace events,
Alex Bennée <=
- [PATCH v4 03/22] hw/virtio: handle un-configured shutdown in virtio-pci, Alex Bennée, 2022/08/02
- [PATCH v4 06/22] include/hw: document vhost_dev feature life-cycle, Alex Bennée, 2022/08/02
- [PATCH v4 01/22] hw/virtio: incorporate backend features in features, Alex Bennée, 2022/08/02
- [PATCH v4 07/22] hw/virtio: fix some coding style issues, Alex Bennée, 2022/08/02
- [PATCH v4 05/22] include/hw/virtio: more comment for VIRTIO_F_BAD_FEATURE, Alex Bennée, 2022/08/02
- [PATCH v4 17/22] tests/qtest: catch unhandled vhost-user messages, Alex Bennée, 2022/08/02
- [PATCH v4 18/22] tests/qtest: plain g_assert for VHOST_USER_F_PROTOCOL_FEATURES, Alex Bennée, 2022/08/02
- [PATCH v4 02/22] hw/virtio: gracefully handle unset vhost_dev vdev, Alex Bennée, 2022/08/02
- [PATCH v4 10/22] hw/virtio: move vm_running check to virtio_device_started, Alex Bennée, 2022/08/02
- [PATCH v4 04/22] hw/virtio: fix vhost_user_read tracepoint, Alex Bennée, 2022/08/02