qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points
Date: Mon, 21 Mar 2022 23:29:10 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 21/3/22 16:30, Alex Bennée wrote:
These are useful when trying to debug the initial vhost-user
negotiation, especially when it hard to get logging from the low level
library on the other side.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
   - fixed arguments
---
  hw/virtio/vhost-user.c | 4 ++++
  hw/virtio/trace-events | 2 ++
  2 files changed, 6 insertions(+)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 6abbc9da32..b27b8c56e2 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -489,6 +489,8 @@ static int vhost_user_write(struct vhost_dev *dev, 
VhostUserMsg *msg,
          return ret < 0 ? -saved_errno : -EIO;
      }
+ trace_vhost_user_write(msg->hdr.request, msg->hdr.flags);
+
      return 0;
  }
@@ -542,6 +544,8 @@ 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;
  }
diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 46851a7cd1..fd213e2a27 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -21,6 +21,8 @@ vhost_user_set_mem_table_withfd(int index, const char *name, 
uint64_t memory_siz
  vhost_user_postcopy_waker(const char *rb, uint64_t rb_offset) "%s + 0x%"PRIx64
  vhost_user_postcopy_waker_found(uint64_t client_addr) "0x%"PRIx64
  vhost_user_postcopy_waker_nomatch(const char *rb, uint64_t rb_offset) "%s + 
0x%"PRIx64
+vhost_user_read(uint32_t req, uint32_t flags) "req:%d flags:0x%"PRIx32""
+vhost_user_write(uint32_t req, uint32_t flags) "req:%d flags:0x%"PRIx32""

"req:%u", otherwise:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]