[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0904161411320.20429@gandalf.stny.rr.com>
Date: Thu, 16 Apr 2009 14:12:33 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
cc: LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Frederic Weisbecker <fweisbec@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Subject: Re: [PATCH 2/2] tracing/events/lockdep: move tracepoints within
recursive protection
On Thu, 16 Apr 2009, Peter Zijlstra wrote:
>
> > That is, at thread context, you are at level 0, if an interrupt comes
> > in, it sets you to level 1, if another interrupt comes in, it sets you to
> > level 2, and so on.
> >
> > I guess we could add this into the irq_enter/exit sofirq_enter/exit and
> > nmi_enter/exit.
> >
> > Thus we can have each task with a bitmask. When we start to trace, we set
> > the bit coresponding to the level the task is at.
> >
> > Ie. in thread context, we set bit 0, if we are interrupted by a
> > softirq/irq/nmi, we set the level bit we are at. Hmm, we might be able to
> > do this via the preempt count already :-/
> >
> > Just add the softirq/irq/nmi bits together.
> >
> > The if the bit is already set we can dump out a warning.
> >
> > I'll try that out.
>
> static int *perf_swcounter_recursion_context(struct perf_cpu_context *cpuctx)
> {
> if (in_nmi())
> return &cpuctx->recursion[3];
>
> if (in_irq())
> return &cpuctx->recursion[2];
>
> if (in_softirq())
> return &cpuctx->recursion[1];
>
> return &cpuctx->recursion[0];
> }
>
> Is what I use for perf-counters.
But does that allow multi nested interrupts?
I'll try the preempt_count and let you know.
Thanks,
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists