@@ -29,6 +29,8 @@
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qnum.h"
#include "user.h"
+#include "trace.h"
+
/*
* These are to defend against a malign server trying
@@ -111,6 +113,8 @@ static int vfio_user_send_qio(VFIOProxy *proxy, VFIOUserMsg *msg)
vfio_user_shutdown(proxy);
error_report_err(local_err);
}
+ trace_vfio_user_send_write(msg->hdr->id, ret);
+
return ret;
}
@@ -227,6 +231,7 @@ static int vfio_user_complete(VFIOProxy *proxy, Error **errp)
}
return ret;
}
+ trace_vfio_user_recv_read(msg->hdr->id, ret);
msgleft -= ret;
data += ret;
@@ -334,6 +339,8 @@ static int vfio_user_recv_one(VFIOProxy *proxy)
error_setg(&local_err, "unknown message type");
goto fatal;
}
+ trace_vfio_user_recv_hdr(proxy->sockname, hdr.id, hdr.command, hdr.size,
+ hdr.flags);
/*
* For replies, find the matching pending request.
@@ -410,6 +417,7 @@ static int vfio_user_recv_one(VFIOProxy *proxy)
if (ret <= 0) {
goto fatal;
}
+ trace_vfio_user_recv_read(hdr.id, ret);
msgleft -= ret;
data += ret;
@@ -165,3 +165,8 @@ vfio_load_state_device_data(const char *name, uint64_t data_offset, uint64_t dat
vfio_load_cleanup(const char *name) " (%s)"
vfio_get_dirty_bitmap(int fd, uint64_t iova, uint64_t size, uint64_t bitmap_size, uint64_t start) "container fd=%d, iova=0x%"PRIx64" size= 0x%"PRIx64" bitmap_size=0x%"PRIx64" start=0x%"PRIx64
vfio_iommu_map_dirty_notify(uint64_t iova_start, uint64_t iova_end) "iommu dirty @ 0x%"PRIx64" - 0x%"PRIx64
+
+# user.c
+vfio_user_recv_hdr(const char *name, uint16_t id, uint16_t cmd, uint32_t size, uint32_t flags) " (%s) id %x cmd %x size %x flags %x"
+vfio_user_recv_read(uint16_t id, int read) " id %x read %x"
+vfio_user_send_write(uint16_t id, int wrote) " id %x wrote %x"