Subject: Re: CVS commit: src/sys
To: None <erh@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: source-changes
Date: 04/17/2006 00:44:21
> On Mon, Apr 10, 2006 at 07:07:13AM +0900, YAMAMOTO Takashi wrote:
> > > Modified Files:
> > > 	src/sys/kern: kern_lock.c
> > > 	src/sys/sys: lock.h sched.h
> > > 
> > > Log Message:
> > > Add simple_lock_assert_locked/simple_lock_assert_unlocked to provide additional
> > > useful information when panic'ing because the assertion fails.
> > > Use these to define the SCHED_ASSERT_LOCKED/SCHED_ASSERT_UNLOCKED macros.
> > 
> > i'm not sure if it's a good idea.
> > 
> > if you want more descriptive panic messages,
> > something like freebsd's KASSERT is better than
> > these simplelock-specific ones, IMO.
> 
> 	It's not just a more descriptive panic message, it's also the stack
> backtrace and the call into the debugger that I think is useful.

how are they simple lock-specific?

> That
> could of couse still happen with a freebsd-like KASSERT call, but since
> it's doing more than just printing a message, it seems clearer to not
> obscure those actions within a printf format string argument.
> 
> eric

"obscure those actions within a printf format string argument"?
i don't understand what you mean.

YAMAMOTO Takashi