|| ||Dave Jones <firstname.lastname@example.org>|
|| ||Daniel Phillips <email@example.com>|
|| ||Re: spinlock assertion macros|
|| ||Fri, 12 Jul 2002 14:07:51 +0200|
|| ||Jesse Barnes <firstname.lastname@example.org>,
On Thu, Jul 11, 2002 at 09:17:44PM +0200, Daniel Phillips wrote:
> On Thursday 11 July 2002 20:03, Jesse Barnes wrote:
> > How about this?
> It looks good, the obvious thing we don't get is what the actual lock
> count is, and actually, we don't care because we know what it is in
> this case.
Something I've been meaning to hack up for a while is some spinlock
debugging code that adds a FUNCTION_SLEEPS() to (ta-da) functions that
may sleep. This macro then checks whether we're currently holding any
locks, and if so printk's the names of locks held, and where they were taken.
When I came up with the idea I envisioned some linked-lists frobbing,
but in more recent times, we can now check the preempt_count for a
quick-n-dirty implementation (without the additional info of which locks
we hold, lock-taker, etc).
 Not an original idea, in fact I think Ingo came up with an
implementation back in `98 or so.
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
to post comments)