Re: [PATCH 3/4] tracing: fix recursive test level calculation

From: Andrew Morton
Date: Mon Apr 20 2009 - 15:42:37 EST


On Mon, 20 Apr 2009 13:38:22 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> static int trace_irq_level(void)
> {
> - return hardirq_count() + softirq_count() + in_nmi();
> + return (hardirq_count() >> HARDIRQ_SHIFT) +
> + (softirq_count() >> + SOFTIRQ_SHIFT) +
> + !!in_nmi();
> }

hah, tricked you!

IMO hardirq_count() and softirq_count() should do the shift internally.
They're terribly misleading at present.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/