On Wed, Aug 13, 2025 at 12:58 PM Vladimir Sementsov-Ogievskiy
<[email protected]> wrote:
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
> ---
>  hw/virtio/trace-events |  8 ++++++++
>  hw/virtio/vhost.c      | 16 ++++++++++++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
> index e5142c27f9..bd595fcd91 100644
> --- a/hw/virtio/trace-events
> +++ b/hw/virtio/trace-events
> @@ -10,7 +10,15 @@ 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, bool vrings) "%p:%s vrings:%d"
> +vhost_dev_start_finish(const char *name) "%s"
>  vhost_dev_stop(void *dev, const char *name, bool vrings) "%p:%s vrings:%d"
> +vhost_dev_stop_finish(const char *name) "%s"
> +vhost_virtque_start(const char *name, int idx) "%s %d"
> +vhost_virtque_start_finish(const char *name, int idx) "%s %d"
> +vhost_virtque_stop(const char *name, int idx) "%s %d"
> +vhost_virtque_stop_finish(const char *name, int idx) "%s %d"
> +vhost_dev_init(void) ""
> +vhost_dev_init_finish(void) ""

Ditto here - I would think this should also have the VirtIODevice/vdev pointer.


>
>
>  # vhost-user.c
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index e796ad347d..e7c809400b 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -1329,6 +1329,8 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
>      };
>      struct VirtQueue *vvq = virtio_get_queue(vdev, idx);
>
> +    trace_vhost_virtque_start(vdev->name, idx);
> +
>      r = vhost_vrings_map(dev, vdev, vq, idx);
>      if (r <= 0) {
>          return r;
> @@ -1390,6 +1392,8 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
>          }
>      }
>
> +    trace_vhost_virtque_start_finish(vdev->name, idx);
> +
>      return 0;
>
>  fail:
> @@ -1408,6 +1412,8 @@ static int do_vhost_virtqueue_stop(struct vhost_dev 
> *dev,
>      };
>      int r = 0;
>
> +    trace_vhost_virtque_stop(vdev->name, idx);
> +
>      if (virtio_queue_get_desc_addr(vdev, idx) == 0) {
>          /* Don't stop the virtqueue which might have not been started */
>          return 0;
> @@ -1441,6 +1447,8 @@ static int do_vhost_virtqueue_stop(struct vhost_dev 
> *dev,
>      }
>
>      vhost_vrings_unmap(dev, vq, true);
> +
> +    trace_vhost_virtque_stop_finish(vdev->name, idx);
>      return r;
>  }
>
> @@ -1598,6 +1606,8 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
>  {
>      int i, r, n_initialized_vqs = 0;
>
> +    trace_vhost_dev_init();
> +
>      hdev->vdev = NULL;
>      hdev->migration_blocker = NULL;
>
> @@ -1682,6 +1692,8 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
>          goto fail;
>      }
>
> +    trace_vhost_dev_init_finish();
> +
>      return 0;
>
>  fail:
> @@ -2132,6 +2144,8 @@ int vhost_dev_start(struct vhost_dev *hdev, 
> VirtIODevice *vdev, bool vrings)
>          }
>      }
>      vhost_start_config_intr(hdev);
> +
> +    trace_vhost_dev_start_finish(vdev->name);
>      return 0;
>  fail_iotlb:
>      if (vhost_dev_has_iommu(hdev) &&
> @@ -2210,6 +2224,8 @@ static int do_vhost_dev_stop(struct vhost_dev *hdev, 
> VirtIODevice *vdev,
>      hdev->started = false;
>      vdev->vhost_started = false;
>      hdev->vdev = NULL;
> +
> +    trace_vhost_dev_stop_finish(vdev->name);
>      return rc;
>  }
>
> --
> 2.48.1
>
>

Reply via email to