backtrace() and the console log (was Re: cvs commit: src/sys/alpha...)

Greg 'groggy' Lehey grog at FreeBSD.org
Wed Jan 21 15:53:35 PST 2004


On Wednesday, 21 January 2004 at  1:48:18 +0000, Ian Dowse wrote:
> In message <20040120144505.ccsc4kog4c88sgww at www.sweetdreamsracing.biz>, Kenneth
>  Culver writes:
>> Quoting Nate Lawson <nate at root.org>:
>>> * Fix backtrace() so the output goes to the console log.  Right now, we
>>> get output that needs to be hand-transcribed or use a serial console.
>>
>> This is also very useful for when FreeBSD crashes when X is running. If X is
>> running, the only option is a serial console, as you can't see the crash to
>> transcribe it otherwise, and most people don't have the spare computer to use
>> as a serial console.
>
> I've been using the following patch for a while to get backtrace()
> to output to the kernel message buffer. Sending all ddb output via
> printf might be undesirable for some cases, but I guess having it
> configurable with a `debug.ddb_use_printf' sysctl that defaults to
> the old behaviour would be ok?

This sounds excellent.

On Wednesday, 21 January 2004 at 16:40:46 +1100, Bruce Evans wrote:
> On Tue, 20 Jan 2004, Nate Lawson wrote:
>
>> On Wed, 21 Jan 2004, Ian Dowse wrote:
>>> I've been using the following patch for a while to get backtrace()
>>> to output to the kernel message buffer. Sending all ddb output via
>>> printf might be undesirable for some cases, but I guess having it
>>> configurable with a `debug.ddb_use_printf' sysctl that defaults to
>>> the old behaviour would be ok?
>
> It's undesireable in almost all cases, since it fills up the message
> buffer with garbage.

If it's "garbage", why are we ever producing it?  Currently I'm
getting a lot of LORs which don't get reported anywhere.  I'd really
like to catch this "garbage".

>> Can't you just check that you aren't in DDB before printing to the message
>> buf?
>>
>> Like this:
>>
>> if (boothowto & RB_KDB) {
>>    normal behavior to console via cnputc()
>> } else {
>>    print to message buf instead
>> }
>
> Something like that would be correct (test db_active, not boothowto...).

Seems reasonable.  Can somebody (iedowse?) commit it?

Greg
--
See complete headers for address and phone numbers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20040122/c20b2661/attachment.bin


More information about the cvs-all mailing list