From owner-freebsd-arch@FreeBSD.ORG Wed Feb 13 15:31:18 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B0C8D32; Wed, 13 Feb 2013 15:31:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 377FB9CB; Wed, 13 Feb 2013 15:31:18 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9C734B95E; Wed, 13 Feb 2013 10:31:17 -0500 (EST) From: John Baldwin To: freebsd-arch@freebsd.org Subject: Re: Proposal: Unify printing the function name in panic messages() Date: Wed, 13 Feb 2013 10:28:29 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201302120615.r1C6FpP8086860@chez.mckusick.com> <5DCB8A72-ABD8-4E8B-8595-EDEBEE70C6AB@bsdimp.com> In-Reply-To: <5DCB8A72-ABD8-4E8B-8595-EDEBEE70C6AB@bsdimp.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201302131028.30010.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 13 Feb 2013 10:31:17 -0500 (EST) Cc: Adrian Chadd , mike@karels.net, Andriy Gapon , Kirk McKusick , Christoph Mallon X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2013 15:31:18 -0000 On Tuesday, February 12, 2013 11:34:33 am Warner Losh wrote: > > On Feb 11, 2013, at 11:15 PM, Kirk McKusick wrote: > > >> To: Kirk McKusick > >> cc: John Baldwin , Adrian Chadd , > >> Christoph Mallon , > >> Andriy Gapon , freebsd-arch@freebsd.org > >> From: Mike Karels > >> Subject: Re: Proposal: Unify printing the function name in panic messages() > >> Date: Tue, 12 Feb 2013 00:01:07 -0600 > >> > >> I'm not arguing against consistency, nor even agaist the proposal itself > >> (as modified for a lower-case panic macro). However, I don't think the > >> lack of consistency is the real problem. "panic: watchdog timeout" tells > >> me what I need to know, whether or not it includes "watchdog_fire" or the > >> line number. The only problem that has been pointed out is lack of > >> uniqueness. That is a simpler problem to handle, and isn't handled by > >> the current proposal as I understand it. > >> > >> Mike > > > > Though the default for the current proposal gives just the function name, > > in its verbose mode it give file, function, and line number. And in its > > lean and mean mode, just the error string. This replacing the hodge-podge > > that we have now. My main point is that it is a significant improvement > > over what we have now. > > I'm all for consistency, and I'm also all for having knobs that let people limit what is printed. In some environments, I'd love to have the file/line number. Why? Because I'm lazy and it saves me a grep: I'd be trading space for convenience. In others, where I'm more space constrained, I'd love to just have the raw message and suffer the ambiguity we have today (or fix things so they aren't ambiguous). > > I too am having difficulty understanding the resistance to the basic proposal: > (1) Make panic messages suck less by removing bogus function names. > (2) Hack the panic() to make it a macro so you can add function name or file + line or the MJD of the last leap second to the panic messages. > > (1) is like no-brainer yes. I think (1) is fine if it fixes truly bogus ones. However, there are some cases (like the one I cited earlier) where the mismatch is _intentional_, so you can't do automated fixes. I also want the string that shows up in the code to match what is output for my project of writing unit/regression tests. -- John Baldwin