From owner-cvs-src@FreeBSD.ORG Fri Aug 4 19:33:23 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 684B916A4DD; Fri, 4 Aug 2006 19:33:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADCDB43D46; Fri, 4 Aug 2006 19:33:22 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k74JX60w007138; Fri, 4 Aug 2006 15:33:07 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marcel Moolenaar Date: Fri, 4 Aug 2006 13:14:22 -0400 User-Agent: KMail/1.9.1 References: <200608030959.k739x9N6007207@repoman.freebsd.org> <20060804070348.GR97316@comp.chem.msu.su> <6B15CBE0-00E0-4F64-A652-4A4B614975C2@xcllnt.net> In-Reply-To: <6B15CBE0-00E0-4F64-A652-4A4B614975C2@xcllnt.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608041314.24161.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 04 Aug 2006 15:33:08 -0400 (EDT) X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx 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-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2006 19:33:23 -0000 On Friday 04 August 2006 12:23, Marcel Moolenaar wrote: > On Aug 4, 2006, at 12:03 AM, Yar Tikhiy wrote: > > > Just noticed that many calls to kdb_backtrace() are under "#ifdef > > KDB" while subr_kdb.c is marked as standard in /sys/conf/files and > > the function itself is always available (yet can do nothing.) > > > > Should calls to kdb_backtrace() be put under "#ifdef KDB"? If they > > should, it can justify introducing the combined printf+trace function. > > subr_kdb.c is indeed unconditional. The reason is that it contains > the interface functions and you should not make interface functions > optional if modules can reference them. > > The KDB option is there to tell that one wants debugging features > enabled. This means for example that serial drivers react to the > line break condition by going into the debugger. Without the KDB > option line break conditions just result in a 0-character in the > input stream. > > So, putting the kdb_backtrace() under KDB is not a matter of said > function not being present without KDB, it's that we don't want > to emit backtraces when debugging is not enabled. Backtraces are > a debugging tool and it makes sense to emit them only when the > kernel is configured for debugging. In practice this ends up being redundant though as to have kdb_backtrace() actually do anything you have to have DDB in your kernel config, which requires KDB. 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. -- John Baldwin