From owner-freebsd-hackers Tue Feb 10 07:54:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA14995 for hackers-outgoing; Tue, 10 Feb 1998 07:54:46 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from elvis.vnet.net (elvis.vnet.net [166.82.1.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA14985; Tue, 10 Feb 1998 07:54:39 -0800 (PST) (envelope-from rivers@dignus.com) Received: from ponds.dignus.com (ponds.vnet.net [166.82.177.48]) by elvis.vnet.net (8.8.8/8.8.4) with ESMTP id KAA08184; Tue, 10 Feb 1998 10:55:44 -0500 (EST) Received: from lakes.dignus.com (lakes [10.0.0.3]) by ponds.dignus.com (8.8.5/8.8.5) with ESMTP id LAA14654; Tue, 10 Feb 1998 11:17:13 -0500 (EST) Received: (from rivers@localhost) by lakes.dignus.com (8.8.7/8.6.9) id KAA05589; Tue, 10 Feb 1998 10:59:38 -0500 (EST) Date: Tue, 10 Feb 1998 10:59:38 -0500 (EST) From: Thomas David Rivers Message-Id: <199802101559.KAA05589@lakes.dignus.com> To: eivind@FreeBSD.ORG, michaelh@cet.co.jp Subject: Re: DIAGNOSTICS and DEBUG LOGGING (was Re: cvs commit: src/sys/conf options) Cc: Hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > On Mon, Feb 09, 1998 at 03:23:45PM +0900, Michael Hancock wrote: > > Eivind, > > > > I'd like to see "sanity checks" (assertions) and diagnostic logging > > separated. DIAGNOSTICS turns on both, but I'd like to be able to run an > > assertion checking kernel without all the logging. > > Absolutely agreed. I was thinking of > > _INVARIANTS - Enable invariant/postcondition checking (expensive) > _ASSERTS - Enable precondition and other cheap assertions > INVARIANT_CODE - Compile in invariant functions. > DIAGNOSTIC - Messages to help tracing errors; non-overwhelming amount. > > The difference between _INVARIANTS and INVARIANT_CODE is that INVARIANT_CODE > just includes the actual code necessary to be able to check an invariant, > while _INVARIANTS actually throw in the code that do calls to check the > invariant. > > The reason for the underscores is that header files are likely to depend on > those options. The separation of the INVARIANT_CODE and _INVARIANTS is to > be able to support enabling invariant-checks in only some files. Separation > of _INVARIANTS and _ASSERTS is that there is often a factor of >1000 > difference between the cost of checking pre-conditions and the cost of > checking post-conditions/data-structure invariants. One quick comment - ANSI C reserves names which begin with an underscore followed by a capital letter. It's possible (albeit unlikely) that a future C compiler would warn, or produce errors for these. Just an observation. - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe hackers" in the body of the message