Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Aug 2006 09:23:52 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Yar Tikhiy <yar@comp.chem.msu.su>
Cc:        Sam Leffler <sam@errno.com>, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, John Baldwin <jhb@FreeBSD.org>, cvs-src@FreeBSD.org
Subject:   Re: cvs commit: src/sys/net if_vlan.c
Message-ID:  <6B15CBE0-00E0-4F64-A652-4A4B614975C2@xcllnt.net>
In-Reply-To: <20060804070348.GR97316@comp.chem.msu.su>
References:  <200608030959.k739x9N6007207@repoman.freebsd.org> <44D22E2F.4070307@errno.com> <20060803180854.GI97316@comp.chem.msu.su> <200608031458.01134.jhb@freebsd.org> <20060804070348.GR97316@comp.chem.msu.su>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-- 
  Marcel Moolenaar         USPA: A-39004          marcel@xcllnt.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6B15CBE0-00E0-4F64-A652-4A4B614975C2>