Re: spinlock assertion macros

From: Dave Jones (davej@suse.de)
Date: Fri Jul 12 2002 - 07:07:51 EST


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[1] 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).

        Dave

[1] 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:22 EST