Date: Mon, 29 Jul 2013 11:47:15 -0700 From: Matthew Ahrens <mahrens@delphix.com> To: Andriy Gapon <avg@freebsd.org> Cc: freebsd-arch@freebsd.org Subject: Re: translate INVARIANTS to DEBUG for code from OpenSolaris Message-ID: <CAJjvXiH0Y_4D_AnXPOwnuAdDxhLHUqiEOBsggHPLaNDj3tg0nw@mail.gmail.com> In-Reply-To: <51F67B2A.3040302@FreeBSD.org> References: <51F67B2A.3040302@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
>From my perspective (working primarily with the OpenSolaris / illumos code), this approach makes sense. --matt On Mon, Jul 29, 2013 at 7:24 AM, Andriy Gapon <avg@freebsd.org> wrote: > [zfs-devel@, fs@, dtrace@ are Bcc-ed] > > In OpenSolaris and its descendants DEBUG is used in a fashion similar to > our > INVARIANTS. For example, ASSERT macros are enabled by it. > In our kernel code DEBUG has a different meaning and enables far too > verbose or > far too obscure code and, as such, it is very rarely enabled. > > The idea of a change that I would like to propose is to translate > INVARIANTS > kernel option into DEBUG for the files that originated from OpenSolaris > (and > hopefully only for them). > > The change: > opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG > > do this by forcing inclusion of > sys/cddl/compat/opensolaris/sys/debug_compat.h > via -include option into all source files from OpenSolaris. > Note that this -include option must always be after -include > opt_global.h. > > Additionally, remove forced definition of DEBUG for some modules and > fix > their build without DEBUG. > > Also, meaning of DEBUG was overloaded to enable WITNESS support for > some > OpenSolaris (primarily ZFS) locks. Now this overloading is removed and > that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS. > > http://people.freebsd.org/~avg/osol-invariants-debug.diff > > I would like to ask for your feedback on the soundness of the whole idea. > Also on the name, location and style of inclusion for > sys/cddl/compat/opensolaris/sys/debug_compat.h. > And on any other details of the proposed change. > > Testing is also welcome, of course. > > Thank you very much. > -- > Andriy Gapon > > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJjvXiH0Y_4D_AnXPOwnuAdDxhLHUqiEOBsggHPLaNDj3tg0nw>