From owner-cvs-all@FreeBSD.ORG Mon Aug 7 16:42:00 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1892F16A509; Mon, 7 Aug 2006 16:42:00 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A30B43D88; Mon, 7 Aug 2006 16:41:47 +0000 (GMT) (envelope-from marcel@xcllnt.net) Received: from [192.168.4.150] (pptp0.pn.xcllnt.net [192.168.4.150]) by ns1.xcllnt.net (8.13.6/8.13.6) with ESMTP id k77GfHiE093437; Mon, 7 Aug 2006 09:41:19 -0700 (PDT) (envelope-from marcel@xcllnt.net) In-Reply-To: <200608041644.08533.jhb@freebsd.org> References: <200608030959.k739x9N6007207@repoman.freebsd.org> <200608041314.24161.jhb@freebsd.org> <20060804200154.GC31805@ns1.xcllnt.net> <200608041644.08533.jhb@freebsd.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marcel Moolenaar Date: Mon, 7 Aug 2006 09:41:01 -0700 To: John Baldwin X-Mailer: Apple Mail (2.752.2) Cc: Yar Tikhiy , src-committers@freebsd.org, cvs-all@freebsd.org, cvs-src@freebsd.org, Sam Leffler Subject: Re: cvs commit: src/sys/net if_vlan.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 16:42:00 -0000 On Aug 4, 2006, at 1:44 PM, John Baldwin wrote: >>> Places that call kdb_enter() aren't all #ifdef KDB IIRC. It's >>> just a feature that kdb_foo() functions become NOPs when the >>> kernel isn't >>> configured for debugging, so I think the #ifdef KDB's would be >>> redundant. >> >> None of the kdb_*() functions in src/sys/kern/subr_kdb.c turn into >> NOPs when option KDB is not present. They are all unconditionally >> functional by design and should therefore be called conditionally >> by consequence. > > Well, given that separation, I'm not sure KDB is the right option > to make > calls conditional. Rather, some specific is-debugging-enabled? > option (like > INARIANTS or FOO_DEBUG) should be used instead. i.e.: > > #ifdef FOO_DEBUG > if (foo_bad) { > printf("foo is bad\n"); > kdb_backtrace(); > } > #endif > > I don't think that warrants an extra #ifdef KDB. Exactly. Here, FOO_DEBUG serves roughly the same function as KDB. Where KDB's scope is limitless, FOO_DEBUG typically applies to foo(4) only. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net