Re: [PATCH] printk/tracing: Do not trace printk_nmi_enter()

From: Steven Rostedt
Date: Fri Sep 07 2018 - 09:53:50 EST


On Fri, 7 Sep 2018 11:30:55 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> > That said, I am not against this change. Especially the inlining
> > is a good move. Note that lockdep_off()/lockdep_on() must not
> > be traced as well.
>
> Hard to trace an inline funcion; we could make it __always_inline to
> feel better.

In the old days, you would need to make it __always_inline, because if
gcc didn't inline it (and it did so in the past), it would be traced
and would re-introduce this bug. But I've hit this issue too many times
in the past, that I added "notrace" to the "inline" definition, where
all "inline" labeled functions are also "notrace".

lockdep.o has the -pg option removed in the Makefile so that all
functions in lockdep.c is notrace, which is why it was fine to keep it
there.

But adding __always_inline may not be a bad idea regardless.

-- Steve