Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2023 11:58:07 +0000
From:      Domagoj Stolfa <domagoj.stolfa@gmail.com>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, dtrace@FreeBSD.org
Subject:   Re: USDT support (in build framework)?
Message-ID:  <a0af6775-9338-ea25-5491-2bcf2fe467ca@gmail.com>
In-Reply-To: <q902483-11q3-pq41-1oo0-sn5s543r533@mnoonqbm.arg>
References:  <q902483-11q3-pq41-1oo0-sn5s543r533@mnoonqbm.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a0af6775-9338-ea25-5491-2bcf2fe467ca>