[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/55] hw/virtio: add some vhost-user trace events
From: |
Michael S. Tsirkin |
Subject: |
[PULL 06/55] hw/virtio: add some vhost-user trace events |
Date: |
Mon, 10 Oct 2022 13:29:02 -0400 |
From: Alex Bennée <alex.bennee@linaro.org>
These are useful for tracing the lifetime of vhost-user connections.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220802095010.3330793-10-alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.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) ""
--
MST
- [PULL 00/55] pc,virtio: features, tests, fixes, cleanups, Michael S. Tsirkin, 2022/10/10
- [PULL 01/55] hw/virtio: incorporate backend features in features, Michael S. Tsirkin, 2022/10/10
- [PULL 02/55] include/hw/virtio: more comment for VIRTIO_F_BAD_FEATURE, Michael S. Tsirkin, 2022/10/10
- [PULL 03/55] include/hw: document vhost_dev feature life-cycle, Michael S. Tsirkin, 2022/10/10
- [PULL 04/55] hw/virtio: fix some coding style issues, Michael S. Tsirkin, 2022/10/10
- [PULL 05/55] hw/virtio: log potentially buggy guest drivers, Michael S. Tsirkin, 2022/10/10
- [PULL 06/55] hw/virtio: add some vhost-user trace events,
Michael S. Tsirkin <=
- [PULL 07/55] hw/virtio: move vm_running check to virtio_device_started, Michael S. Tsirkin, 2022/10/10
- Re: Regression save/restore of vsock: (was [PULL 07/55] hw/virtio: move vm_running check to virtio_device_started), Alex Bennée, 2022/10/14
- Re: Regression save/restore of vsock: (was [PULL 07/55] hw/virtio: move vm_running check to virtio_device_started), Christian Borntraeger, 2022/10/14
[PULL 08/55] hw/virtio: move vhd->started check into helper and add FIXME, Michael S. Tsirkin, 2022/10/10
[PULL 09/55] hw/virtio: add boilerplate for vhost-user-gpio device, Michael S. Tsirkin, 2022/10/10
[PULL 10/55] hw/virtio: add vhost-user-gpio-pci boilerplate, Michael S. Tsirkin, 2022/10/10