ZFS SET_ERROR dtrace probe possible under FreeBSD?

Matthew Ahrens mahrens at delphix.com
Tue Sep 16 03:19:06 UTC 2014


On Mon, Sep 15, 2014 at 8:13 PM, Mark Johnston <markj at freebsd.org> wrote:

> On Mon, Sep 15, 2014 at 07:59:50PM -0700, Matthew Ahrens wrote:
> > Disclaimer: I'm not an expert in FreeBSD dtrace.
> >
> > It looks like the FreeBSD kernel uses these declaration for kernel SDT
> > probes, in sdt.h:
> ...
> >
> > To do the equivalent "extra static" magic, you will need to expand out
> the
> > DTRACE_PROBE1 macro.  I think it should look something like:
> >
> > SDT_PROBE_DEFINE1(sdt, zfs, , set__error, "int");
> >
> > #define SET_ERROR(err) \
> >     ((sdt_sdt_zfs__set__error->id && \
> >     (*sdt_probe_func)(sdt_sdt_zfs__set__error->id, (uintptr_t)err, 0, 0,
> 0,
> > 0)), \
> >     err)
>
> I think it would need to be
>
>   SDT_PROBE_DECLARE(sdt, , , set__error);
>
>   #define SET_ERROR(err) ...
>
> in the compat sdt.h, and then kern_dtrace.c or so would contain
>
>   SDT_PROBE_DEFINE1(sdt, , , set__error, "int");
>
> Note that the module shouldn't be hard-coded - it'll be filled in when
> the probes are created by the SDT code.


Ah, yes, that makes sense.

--matt


More information about the freebsd-hackers mailing list