Hi:

I've done this for bhyve, specifically for virtio-net. I believe this is the whole patch I needed:


+OBJS:=bhyve_provider.o ${OBJS}
+DTRACE_OBJS=${SRCS:C/\.c/.o/}
+
+beforelinking:
+       dtrace -G -s ${BHYVE_SRCDIR}/bhyve_provider.d ${DTRACE_OBJS}
+


however, it has been a while and I don't 100% recall if anything else was necessary. I had to create a helper DTRACE_OBJS because using OBJS would cause linking to fail later on. I'm sure there are better ways of doing it, but this seems to work for me. Let me know if it fails!


The provider itself is:


provider netbe {
        probe tap__recv(char *, void *);
        probe tap__send(char *, void *);
};


and the probes can be called as follows:


                DTRACE_PROBE2(netbe, tap__recv, g_vmname, mbufidp);


Hope this helps!


--

Domagoj



On 3/23/2023 1:09 AM, Bjoern A. Zeeb wrote:
Hi,

https://wiki.freebsd.org/DTrace/userland says it is outdated.

Do we have any description on how one we would add USDT support to base
system applications?  Or do we support this at all?

/bz


Reply via email to