[RFC] reworking FreeBSD's SDT implementation

markj at freebsd.org markj at freebsd.org
Mon Jul 22 02:28:34 UTC 2013


On Sun, Jul 14, 2013 at 10:56:34AM +0300, Mikolaj Golub wrote:
> On Sat, Jul 13, 2013 at 07:42:00PM -0400, Mark Johnston wrote:
> 
> > Thanks for pointing this out - I've fixed these problems in the
> > following diff:
> > 
> > http://people.freebsd.org/~markj/patches/sdt-module-info/20130713-sdt-module-info.diff
> > 
> > It turns out that we typedef modctl_t to struct linker_file, so I don't
> > need to have separate cases for defined(sun) and !defined(sun) in a few
> > places.
> 
> Then in dtrace.h: 
> 
>   -extern void (*dtrace_modload)(modctl_t *);
>   -extern void (*dtrace_modunload)(modctl_t *);
>   +extern void (*dtrace_modload)(struct linker_file *);
>   +extern int (*dtrace_modunload)(struct linker_file *);
> 
> you might also want to return modctl_t back? I suppose
> dtrace_modunload also requires '#if defined(sun)' here.
> 
> Also, is there some reason you choose to return 1 on modunload
> failure? Usually we return -1 on error, it would be nice to follow the
> convention.
> 
> In sdt_disable(), before decreasing nenabled, it might be useful to
> add an assertion that nenabled is not going to reach negative value.

Thanks for the comments, and sorry for the slow reply. I uploaded a new
patch containing changes for all the suggestions above:

http://people.freebsd.org/~markj/patches/sdt-module-info/20130721-sdt-module-info.diff

-Mark


More information about the freebsd-dtrace mailing list