[RFC] reworking FreeBSD's SDT implementation
Mark Johnston
markj at freebsd.org
Sat Jul 6 14:23:10 UTC 2013
On Sat, Jul 06, 2013 at 08:58:59AM -0400, George Neville-Neil wrote:
>
> On Jul 4, 2013, at 23:25 , Mark Johnston <markj at freebsd.org> wrote:
>
> > On Wed, Jul 03, 2013 at 12:10:23AM -0400, Mark Johnston wrote:
> >> Hello,
> >>
> >> There are a few problems with the way SDT is currently implemented in
> >> FreeBSD. First, the DTrace framework isn't notified when modules are
> >> unloaded, so any probes created by these modules are never destroyed
> >> (this problem isn't specific to SDT though, FBT probes have the same
> >> problem). Second, there is currently nothing preventing one from
> >> unloading a module while some of its SDT probes are enabled; doing this
> >> will generally cause a panic. Finally, providers are "tied" to modules
> >> in the sense that dtrace_unregister() is called on each provider
> >> declared in a module when that module is unloaded. This is inflexible -
> >> probes already have a "module" field to indicate which module they're
> >> defined in, and it would restrict the implementation of, say, a
> >> hypothetical GEOM or netgraph provider, which would probably contain
> >> some common probes for each GEOM or netgraph module. Plus a panic will
> >> occur if a probe from one module is enabled and a second module
> >> declaring the provider of the probe is unloaded.
> >>
> >> I have a patch at [1] which tries to solve all of these problems. It
> >> more or less completely reworks FreeBSD's SDT implementation (currently
> >> contained in kern/kern_sdt.c and cddl/dev/sdt/sdt.c) and changes a
> >> number of things:
> >>
> >> [...]
> >>
> >> I'm also writing a man page for the SDT macros so that there's some
> >> guidance on how to create SDT probes and providers.
> >
> > I've copied a draft SDT man page below. Any
> > suggestions/corrections/comments/criticisms are most welcome.
> >
> > I would also like to have man pages for individual providers, but this
> > is a start. :)
>
> Hello Mark,
>
> Sorry to take to long to reply. I think your approach to SDTs is sound and we should
> move forward with that, in particular as you say it brings us closer to the implementation
> ideas in Solaris. I will try to test your patch on HEAD today and let you know if I have
> any problems with it. In the meantime feel free to test and commit it on your own,
> don't wait for me. The man page also looks good.
Thanks! I've added an updated patch here:
http://people.freebsd.org/~markj/patches/20130706-sdt-module-info.diff
There aren't any functional differences, just diff reduction and the man
page.
Thanks,
-Mark
More information about the freebsd-dtrace
mailing list