Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Sep 2014 20:19:03 -0700
From:      Matthew Ahrens <mahrens@delphix.com>
To:        Mark Johnston <markj@freebsd.org>
Cc:        Steven Hartland <smh@freebsd.org>, hackers@freebsd.org, freebsd-dtrace@freebsd.org
Subject:   Re: ZFS SET_ERROR dtrace probe possible under FreeBSD?
Message-ID:  <CAJjvXiFwFp2d1mNGdbq1hSukNbNq0UPiu8tN4sXDexwHO7kgEQ@mail.gmail.com>
In-Reply-To: <20140916031318.GB26720@charmander.picturesperfect.net>
References:  <AEC968EBE6DE4E56A76DD7578DC25483@multiplay.co.uk> <CAJjvXiF4kPFW--SioqAvR%2BF1kwMgYUkfGqtLd4ZHh0jWhrNN5Q@mail.gmail.com> <20140916031318.GB26720@charmander.picturesperfect.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 15, 2014 at 8:13 PM, Mark Johnston <markj@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJjvXiFwFp2d1mNGdbq1hSukNbNq0UPiu8tN4sXDexwHO7kgEQ>