Subject: Re: Line & file debugging info for vnode locking.
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Julian Assange <>
List: tech-kern
Date: 08/12/1999 03:43:41
> >>> and __FUNCTION__
> >> Doh.  Actually __FUNCTION__ and __LINE__ would be sufficient.
> > ...considering that __FILE__ and __LINE__ are already used for lock
> > debugging, and are also what are used for KASSERT(), etc., I think
> > sticking with __FILE__ and __LINE__, for consistency's sake, is
> > better.
> Not to mention that if you get a problem from a piece of the kernel
> you're not familiar with, finding the call when given the function name
> is harder than when given the file name.

If you don't have sources handy, or are unaware exactly what date the
kernel sources reflect, then __FUNCTION__ is highly useful, because
it is *conceptual* rather than merely numerical, and concepts drift
slower as source code evolves that do line numbers.

That an average user can explain immediately what function an assertion is
failed in is valuable. Futher if they see several failures in ip_optlen(),
they will mentally categorize this more narrowly than several failures in
"ip_output.c", as line numbers are not memorable, the context becomes the
entire file.

Memorable context is valuable. By the time you reach for pen and paper,
the assertion might have stopped asserting.

That's my assertion, anyway :)