Proposal: Unify printing the function name in panic messages()

Warner Losh imp at bsdimp.com
Tue Feb 12 16:41:43 UTC 2013


On Feb 11, 2013, at 11:15 PM, Kirk McKusick wrote:

>> To: Kirk McKusick <mckusick at mckusick.com>
>> cc: John Baldwin <jhb at freebsd.org>, Adrian Chadd <adrian at freebsd.org>,
>>        Christoph Mallon <christoph.mallon at gmx.de>,
>>        Andriy Gapon <avg at freebsd.org>, freebsd-arch at freebsd.org
>> From: Mike Karels <mike at 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. (2) is infinite bike-shed land, but if we have the basic macro there, maybe with a simple/gaudy kernel config then people that want a different kind of gaudy have an easy hack.

I'm still having trouble seeing the down side, except maybe your brand of gaudy is considered too passe' to be allowed in :)

Warner


More information about the freebsd-arch mailing list