Date: Wed, 13 Feb 2013 10:28:29 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Cc: Adrian Chadd <adrian@freebsd.org>, mike@karels.net, Andriy Gapon <avg@freebsd.org>, Kirk McKusick <mckusick@mckusick.com>, Christoph Mallon <christoph.mallon@gmx.de> Subject: Re: Proposal: Unify printing the function name in panic messages() Message-ID: <201302131028.30010.jhb@freebsd.org> In-Reply-To: <5DCB8A72-ABD8-4E8B-8595-EDEBEE70C6AB@bsdimp.com> References: <201302120615.r1C6FpP8086860@chez.mckusick.com> <5DCB8A72-ABD8-4E8B-8595-EDEBEE70C6AB@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <mckusick@mckusick.com> > >> cc: John Baldwin <jhb@freebsd.org>, Adrian Chadd <adrian@freebsd.org>, > >> Christoph Mallon <christoph.mallon@gmx.de>, > >> Andriy Gapon <avg@freebsd.org>, freebsd-arch@freebsd.org > >> From: Mike Karels <mike@karels.net> > >> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302131028.30010.jhb>