ZFS_DEBUG + enable ZFS ASSERTS with INVARIANTS any objections?
Steven Hartland
killing at multiplay.co.uk
Fri Jul 26 14:08:40 UTC 2013
I tried an alternative version (attached) based on Justin's feedback,
which but enables DEBUG in all opensolaris modules when INVARIANTS is in
effect.
Unfortunately it results in all the LOR being printed so I'm not a fan
TBH, I prefer the option to enable ASSERTS ony by changing debug.h
Regards
Steve
----- Original Message -----
From: "Andriy Gapon" <avg at FreeBSD.org>
> Justin, Steven, all,
>
> do you have any news on this topic?
> I think that having something in the tree would be better than having nothing at
> all (as it is now), unless that something would make future work very hard.
>
> BTW, I've thought just a little bit about this issue and here is how I would
> implement INVARIANTS support for code that has come and will come from
> OpenSolaris and its descendants. However, I am not sure how feasible and hard
> this approach would be in a technical sense.
>
> So, add something like the following at the end of auto-generated opt_global.h:
> #if defined(INVARIANTS) && defined(OPENSOLARIS_FILE)
> #ifndef DEBUG
> #define DEBUG
> #endif
> #ifndef ZFS_DEBUG
> #define ZFS_DEBUG
> #endif
> #endif
>
> Then all that remains to be done is to tag each file that uses OpenSolaris DEBUG
> semantics with OPENSOLARIS_FILE. That's easy, right? :-)
> Seriously though, there is already ZFS_C / ZFS_CFLAGS defined to be used with
> files that compiled into kernel. We could just add -DOPENSOLARIS_FILE there.
> For all the modules, we'd have to amend CFLAGS with -DOPENSOLARIS_FILE.
> Tedious, but doable.
>
> Alternatively, we could have a special header file that would contain:
> #if defined(INVARIANTS)
> #ifndef DEBUG
> #define DEBUG
> #endif
> #ifndef ZFS_DEBUG
> #define ZFS_DEBUG
> #endif
> #endif
>
> And then pass -include the/special/file.h in CFLAGS for all the relevant
> files/modules.
>
> What do you think?
>
> --
> Andriy Gapon
>
================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it.
In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster at multiplay.co.uk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zfs-debug2.patch
Type: application/octet-stream
Size: 1364 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/zfs-devel/attachments/20130726/ad148a57/attachment.obj>
More information about the zfs-devel
mailing list