Date: Sun, 14 Jul 2013 10:56:34 +0300 From: Mikolaj Golub <trociny@FreeBSD.org> To: Mark Johnston <markj@freebsd.org> Cc: freebsd-dtrace@freebsd.org Subject: Re: [RFC] reworking FreeBSD's SDT implementation Message-ID: <20130714075634.GC2832@gmail.com> In-Reply-To: <20130713234200.GA40803@raichu> References: <20130703041023.GA82673@raichu> <20130711024500.GA67976@raichu> <20130711210215.GB7506@gmail.com> <20130713234200.GA40803@raichu>
next in thread | previous in thread | raw e-mail | index | archive | help
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. -- Mikolaj Golub
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130714075634.GC2832>