Date: Tue, 20 Jan 2004 20:33:08 -0800 (PST) From: Nate Lawson <nate@root.org> To: Ian Dowse <iedowse@maths.tcd.ie> Cc: cvs-all@FreeBSD.org Subject: Re: backtrace() and the console log (was Re: cvs commit: src/sys/alpha...) Message-ID: <20040120203001.B99547@root.org> In-Reply-To: <200401210148.aa95501@salmon.maths.tcd.ie> References: <200401210148.aa95501@salmon.maths.tcd.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Jan 2004, Ian Dowse wrote: > In message <20040120144505.ccsc4kog4c88sgww@www.sweetdreamsracing.biz>, Kenneth > Culver writes: > >Quoting Nate Lawson <nate@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? 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 } -Nate
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040120203001.B99547>