Re: [patch part-II V2 09/13] x86/entry/common: Split hardirq tracing into lockdep and ftrace parts

From: Steven Rostedt
Date: Tue Mar 10 2020 - 09:41:03 EST


On Tue, 10 Mar 2020 12:20:45 +0100
Borislav Petkov <bp@xxxxxxxxx> wrote:

> > +
> > + /*
> > + * Tell the tracer about the irq state as well before enabling
> > + * interrupts.
> > + */
> > + __trace_hardirqs_off();
>
> I wonder if those "__" variants should be named something else to
> denote better the difference between __trace_hardirqs_{on,off} and
> trace_hardirqs_{on,off}. Latter does the _rcuidle variant and lockdep
> annotation but
>
> trace_hardirqs_{on,off}_rcuidle_lockdep()
>
> sounds yuck.
>
> Maybe lockdep_trace_hardirqs_{on,off}()...
>
> Blergh, I can't think of a good name ATM.

Kernel developers are not good at naming ;-) This is one of the original
pieces of code that came in with the original addition of tracing, where we
had the "Ingo notation" of something like:

trace() {
[..]
_trace();
[..]
}

_trace() {
[..]
__trace();
[..]
}

__trace() {
[..]
___trace();
[..]
}

___trace() {
[..]
____trace();
[..]
}

____trace() {
[..]
_____trace();
[..]
}

_____trace() {
[..]
}

-- Steve