Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Aug 2006 17:46:55 +0200
From:      Ulrich Spoerlein <uspoerlein@gmail.com>
To:        Jun Kuriyama <kuriyama@imgsrc.co.jp>, Current <freebsd-current@FreeBSD.org>
Subject:   Re: INVARIANTS in sys/sys/sx.h
Message-ID:  <20060828154655.GH1082@roadrunner.aventurien.local>
In-Reply-To: <20060828144358.GA46108@owl.midgard.homeip.net>
References:  <7m3bbhx6vc.wl%kuriyama@imgsrc.co.jp> <20060828144358.GA46108@owl.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Erik Trulsson wrote:
> On Mon, Aug 28, 2006 at 11:38:47PM +0900, Jun Kuriyama wrote:
> > 
> > I found this when I compiled my kernel with INVARIANTS without
> > INVARIANT_SUPPORT.
> 
> It says in /usr/src/syc/conf/NOTES that INVARIANT_SUPPORT is a prerequisite
> for INVARIANTS.  I.e. having a kernel with INVARIANTS without
> INVARIANT_SUPPORT is not expected to work.

I once was bitten by this, since I forgot this in my kernel conf and
wondered about build breakage in the ata subsystem. I read the part
about kernel+module debugging in NOTES, but I truly wonder: is this used
regularly by developers?

There are only 7 files under /src that do "ifdef INVARIANT_SUPPORT",
couldn't we just merge the too?

List of affected files under /src:

./kern/kern_mutex.c:#ifdef INVARIANT_SUPPORT
./kern/kern_sx.c:#ifdef INVARIANT_SUPPORT
./kern/kern_sx.c:#endif /* INVARIANT_SUPPORT */
./kern/subr_witness.c:#ifdef INVARIANT_SUPPORT
./kern/subr_witness.c:#endif    /* INVARIANT_SUPPORT */
./sys/filedesc.h:#ifdef INVARIANT_SUPPORT
./sys/lock.h:#if defined(KLD_MODULE) || defined(WITNESS) || defined(INVARIANTS) || defined(INVARIANT_SUPPORT) || defined(KTR) || defined(MUTEX_PROFILING)
./sys/mutex.h:#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
./sys/mutex.h: * The constants need to be defined for INVARIANT_SUPPORT infrastructure
./sys/mutex.h:#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
./sys/sx.h:#ifdef INVARIANT_SUPPORT
./sys/sx.h:#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)


As you can see, lock.h and mutex.h work with both names and sx.h only
has one out of two places, where it actually matters.

Ulrich Spoerlein

PS: The color of this bikeshed is blue. This is not negotiable!
-- 
A: Yes.
>Q: Are you sure?
> >A: Because it reverses the logical flow of conversation.
> >>Q: Why is top posting frowned upon?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060828154655.GH1082>