From owner-cvs-all@FreeBSD.ORG Tue Jan 20 20:33:11 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B84B16A4D0 for ; Tue, 20 Jan 2004 20:33:11 -0800 (PST) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 2096143D39 for ; Tue, 20 Jan 2004 20:33:06 -0800 (PST) (envelope-from nate@root.org) Received: (qmail 99876 invoked by uid 1000); 21 Jan 2004 04:33:08 -0000 Date: Tue, 20 Jan 2004 20:33:08 -0800 (PST) From: Nate Lawson To: Ian Dowse In-Reply-To: <200401210148.aa95501@salmon.maths.tcd.ie> Message-ID: <20040120203001.B99547@root.org> References: <200401210148.aa95501@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Poul-Henning Kamp cc: cvs-all@FreeBSD.org Subject: Re: backtrace() and the console log (was Re: cvs commit: src/sys/alpha...) X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2004 04:33:11 -0000 On Wed, 21 Jan 2004, Ian Dowse wrote: > In message <20040120144505.ccsc4kog4c88sgww@www.sweetdreamsracing.biz>, Kenneth > Culver writes: > >Quoting Nate Lawson : > >> * 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