svn commit: r279764 - head/sys/vm

Gleb Smirnoff glebius at FreeBSD.org
Tue Mar 10 10:30:50 UTC 2015


On Tue, Mar 10, 2015 at 12:18:13PM +0200, Konstantin Belousov wrote:
K> On Tue, Mar 10, 2015 at 01:01:41PM +0300, Gleb Smirnoff wrote:
K> > On Sun, Mar 08, 2015 at 02:13:47AM +0000, Konstantin Belousov wrote:
K> > K> Author: kib
K> > K> Date: Sun Mar  8 02:13:46 2015
K> > K> New Revision: 279764
K> > K> URL: https://svnweb.freebsd.org/changeset/base/279764
K> > K> 
K> > K> Log:
K> > K>   Fix function name in the panic message.
K> > 
K> > Why not use "%s, __func__" always and never encounter this problem
K> > in future?
K> 
K> Because you cannot grep for the panic string when __func__ is used.

Grepping for panic string doesn't work in general. A panic message
can report pointers or numbers, which make text not unique. Actually,
the messages that do report extra information are more useful. Also,
if panic string resides in the source code under several levels of
indentation, it is likely to be split into two lines.

But you can always grep for the function name and locate the panic
or KASSERT in the function manually, which isn't a big deal. And
if %s, __func__ is used, you will never get to a wrong function.

-- 
Totus tuus, Glebius.


More information about the svn-src-head mailing list