[PATCH v3 09/21] hw/virtio: fix vhost_user_read tracepoint

Alex Bennée posted 21 patches 3 years, 6 months ago
Maintainers: Coiby Xu <Coiby.Xu@gmail.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
[PATCH v3 09/21] hw/virtio: fix vhost_user_read tracepoint
Posted by Alex Bennée 3 years, 6 months ago
As reads happen in the callback we were never seeing them. We only
really care about the header so move the tracepoint to when the header
is complete.

Fixes: 6ca6d8ee9d (hw/virtio: add vhost_user_[read|write] trace points)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 hw/virtio/vhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index a96a586ebf..b7c13e7e16 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -296,6 +296,8 @@ static int vhost_user_read_header(struct vhost_dev *dev, VhostUserMsg *msg)
         return -EPROTO;
     }
 
+    trace_vhost_user_read(msg->hdr.request, msg->hdr.flags);
+
     return 0;
 }
 
@@ -545,8 +547,6 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
         }
     }
 
-    trace_vhost_user_read(msg.hdr.request, msg.hdr.flags);
-
     return 0;
 }
 
-- 
2.30.2


Re: [PATCH v3 09/21] hw/virtio: fix vhost_user_read tracepoint
Posted by Jason Wang 3 years, 6 months ago
在 2022/7/27 03:21, Alex Bennée 写道:
> As reads happen in the callback we were never seeing them. We only
> really care about the header so move the tracepoint to when the header
> is complete.
>
> Fixes: 6ca6d8ee9d (hw/virtio: add vhost_user_[read|write] trace points)
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   hw/virtio/vhost-user.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
> index a96a586ebf..b7c13e7e16 100644
> --- a/hw/virtio/vhost-user.c
> +++ b/hw/virtio/vhost-user.c
> @@ -296,6 +296,8 @@ static int vhost_user_read_header(struct vhost_dev *dev, VhostUserMsg *msg)
>           return -EPROTO;
>       }
>   
> +    trace_vhost_user_read(msg->hdr.request, msg->hdr.flags);
> +
>       return 0;
>   }
>   
> @@ -545,8 +547,6 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
>           }
>       }
>   
> -    trace_vhost_user_read(msg.hdr.request, msg.hdr.flags);
> -
>       return 0;
>   }
>