From owner-cvs-all@FreeBSD.ORG Wed Jan 21 15:53:35 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 DB41F16A4CE; Wed, 21 Jan 2004 15:53:34 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CD0343D62; Wed, 21 Jan 2004 15:52:21 -0800 (PST) (envelope-from grog@lemis.com) Received: from blackwater.lemis.com (blackwater.lemis.com [192.109.197.80]) by ozlabs.org (Postfix) with ESMTP id D2B462BD7B; Thu, 22 Jan 2004 10:52:17 +1100 (EST) Received: by blackwater.lemis.com (Postfix, from userid 1004) id D6F9E51209; Thu, 22 Jan 2004 10:22:15 +1030 (CST) Date: Thu, 22 Jan 2004 10:22:15 +1030 From: Greg 'groggy' Lehey To: Ian Dowse , Bruce Evans Message-ID: <20040121235215.GV86671@wantadilla.lemis.com> References: <200401210148.aa95501@salmon.maths.tcd.ie> <20040120203001.B99547@root.org> <20040121162731.F7489@gamplex.bde.org> <20040120144505.ccsc4kog4c88sgww@www.sweetdreamsracing.biz> <200401210148.aa95501@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l/3WCmqZNZ+BnHMk" Content-Disposition: inline In-Reply-To: <20040121162731.F7489@gamplex.bde.org> <200401210148.aa95501@salmon.maths.tcd.ie> User-Agent: Mutt/1.4.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: Kenneth Culver cc: src-committers@FreeBSD.org cc: Poul-Henning Kamp cc: Nate Lawson cc: cvs-src@FreeBSD.org cc: Mike Silbersack 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 23:53:35 -0000 --l/3WCmqZNZ+BnHMk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wednesday, 21 January 2004 at 1:48:18 +0000, 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? 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. --l/3WCmqZNZ+BnHMk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQFADxCvIubykFB6QiMRArMWAKCyE3aVZBeP4g+r4VSqV3jE+vFaYgCdHcPh hGyZN9tYKg2Rg71Jcm2JN6I= =SJPA -----END PGP SIGNATURE----- --l/3WCmqZNZ+BnHMk--