cvs commit: src/sys/net if_vlan.c

Marcel Moolenaar marcel at xcllnt.net
Fri Aug 4 16:24:31 UTC 2006


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 at xcllnt.net




More information about the cvs-all mailing list