aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio-pmem.c
diff options
context:
space:
mode:
authorPankaj Gupta <pankaj.gupta.linux@gmail.com>2020-11-17 12:57:05 +0100
committerMichael S. Tsirkin <mst@redhat.com>2021-02-05 08:52:58 -0500
commit73b123073d5e74f948eac9a2492e0b367006cd87 (patch)
tree4422643efb837dad061f2d4beb255e0b50fd9a77 /hw/virtio/virtio-pmem.c
parentf6ab64c05f8a6229bf6569d3791c23abb9f6eee4 (diff)
virtio-pmem: add trace events
This patch adds trace events for virtio-pmem functionality. Adding trace events for virtio pmem request, reponse and host side fsync functionality. Signed-off-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com> Message-Id: <20201117115705.32195-1-pankaj.gupta.linux@gmail.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/virtio-pmem.c')
-rw-r--r--hw/virtio/virtio-pmem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
index ddb0125901..d83e973bf2 100644
--- a/hw/virtio/virtio-pmem.c
+++ b/hw/virtio/virtio-pmem.c
@@ -24,6 +24,7 @@
#include "sysemu/hostmem.h"
#include "block/aio.h"
#include "block/thread-pool.h"
+#include "trace.h"
typedef struct VirtIODeviceRequest {
VirtQueueElement elem;
@@ -41,6 +42,7 @@ static int worker_cb(void *opaque)
/* flush raw backing image */
err = fsync(req_data->fd);
+ trace_virtio_pmem_flush_done(err);
if (err != 0) {
err = 1;
}
@@ -59,6 +61,7 @@ static void done_cb(void *opaque, int ret)
/* Callbacks are serialized, so no need to use atomic ops. */
virtqueue_push(req_data->pmem->rq_vq, &req_data->elem, len);
virtio_notify((VirtIODevice *)req_data->pmem, req_data->pmem->rq_vq);
+ trace_virtio_pmem_response();
g_free(req_data);
}
@@ -69,6 +72,7 @@ static void virtio_pmem_flush(VirtIODevice *vdev, VirtQueue *vq)
HostMemoryBackend *backend = MEMORY_BACKEND(pmem->memdev);
ThreadPool *pool = aio_get_thread_pool(qemu_get_aio_context());
+ trace_virtio_pmem_flush_request();
req_data = virtqueue_pop(vq, sizeof(VirtIODeviceRequest));
if (!req_data) {
virtio_error(vdev, "virtio-pmem missing request data");