git: fd80208a5f92 - main - Add SDT probes virtqueue::enqueue_segments:{entry, return}

Stephen J. Kiernan stevek at FreeBSD.org
Fri Aug 27 17:09:10 UTC 2021


The branch main has been updated by stevek:

URL: https://cgit.FreeBSD.org/src/commit/?id=fd80208a5f92a60381d7bb7b5225bcdc38ab6fd5

commit fd80208a5f92a60381d7bb7b5225bcdc38ab6fd5
Author:     Stephen J. Kiernan <stevek at FreeBSD.org>
AuthorDate: 2021-08-27 17:08:59 +0000
Commit:     Stephen J. Kiernan <stevek at FreeBSD.org>
CommitDate: 2021-08-27 17:08:59 +0000

    Add SDT probes virtqueue::enqueue_segments:{entry,return}
    
    This allows one to be able to map the sglist entries passed into the
    vq_ring_enqueue_segments() function to the segment indexes used in
    the virtqueue.
    
    This function normally gets inlined and may not available via FBT
    probes.
    
    Differential Revision: https://reviews.freebsd.org/D31620
---
 sys/dev/virtio/virtqueue.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sys/dev/virtio/virtqueue.c b/sys/dev/virtio/virtqueue.c
index 14c2088b70a8..59aefb31d9ac 100644
--- a/sys/dev/virtio/virtqueue.c
+++ b/sys/dev/virtio/virtqueue.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
+#include <sys/sdt.h>
 #include <sys/sglist.h>
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -137,6 +138,11 @@ static int	vq_ring_must_notify_host(struct virtqueue *);
 static void	vq_ring_notify_host(struct virtqueue *);
 static void	vq_ring_free_chain(struct virtqueue *, uint16_t);
 
+SDT_PROVIDER_DEFINE(virtqueue);
+SDT_PROBE_DEFINE6(virtqueue, , enqueue_segments, entry, "struct virtqueue *",
+    "struct vring_desc *", "uint16_t", "struct sglist *", "int", "int");
+SDT_PROBE_DEFINE1(virtqueue, , enqueue_segments, return, "uint16_t");
+
 #define vq_modern(_vq) 		(((_vq)->vq_flags & VIRTQUEUE_FLAG_MODERN) != 0)
 #define vq_htog16(_vq, _val) 	virtio_htog16(vq_modern(_vq), _val)
 #define vq_htog32(_vq, _val) 	virtio_htog32(vq_modern(_vq), _val)
@@ -703,6 +709,9 @@ vq_ring_enqueue_segments(struct virtqueue *vq, struct vring_desc *desc,
 	int i, needed;
 	uint16_t idx;
 
+	SDT_PROBE6(virtqueue, , enqueue_segments, entry, vq, desc, head_idx,
+	    sg, readable, writable);
+
 	needed = readable + writable;
 
 	for (i = 0, idx = head_idx, seg = sg->sg_segs;
@@ -722,6 +731,7 @@ vq_ring_enqueue_segments(struct virtqueue *vq, struct vring_desc *desc,
 			dp->flags |= vq_gtoh16(vq, VRING_DESC_F_WRITE);
 	}
 
+	SDT_PROBE1(virtqueue, , enqueue_segments, return, idx);
 	return (idx);
 }
 


More information about the dev-commits-src-main mailing list