[PATCH v3 08/13] ARM: ftrace: enable the graph tracer with the EABI unwinder

Nathan Chancellor nathan at kernel.org
Thu Feb 3 08:09:01 PST 2022


On Thu, Feb 03, 2022 at 10:16:57AM +0100, Arnd Bergmann wrote:
> On Thu, Feb 3, 2022 at 9:21 AM Ard Biesheuvel <ardb at kernel.org> wrote:
> >
> > Enable the function graph tracer in combination with the EABI unwinder,
> > so that Thumb2 builds or Clang ARM builds can make use of it.
> >
> > This involves using the unwinder to locate the return address of an
> > instrumented function on the stack, so that it can be overridden and
> > made to refer to the ftrace handling routines that need to be called at
> > function return.
> >
> > Given that for these builds, it is not guaranteed that the value of the
> > link register is stored on the stack, fall back to the stack slot that
> > will be used by the ftrace exit code to restore LR in the instrumented
> > function's execution context.
> >
> > Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
> > Reviewed-by: Steven Rostedt (Google) <rostedt at goodmis.org>
> 
> > diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> > index 07055a503022..cc7523f44be4 100644
> > --- a/arch/arm/Kconfig.debug
> > +++ b/arch/arm/Kconfig.debug
> > @@ -65,7 +65,7 @@ config UNWINDER_FRAME_POINTER
> >
> >  config UNWINDER_ARM
> >         bool "ARM EABI stack unwinder"
> > -       depends on AEABI && !FUNCTION_GRAPH_TRACER
> > +       depends on AEABI
> >         # https://github.com/ClangBuiltLinux/linux/issues/732
> >         depends on !LD_IS_LLD || LLD_VERSION >= 110000
> >         select ARM_UNWIND
> 
> What are the remaining tradeoffs between the two unwinders
> on EABI kernels? Since we require llvm-11 as the minimum
> toolchain now, we can probably drop the LLD_VERSION
> check here as well, so UNWINDER_ARM should finally work
> for any EABI kernel.

For what it's worth, that check was eliminated in the same series as
bumping the minimum version: e1ab4182ca11 ("Revert "ARM: 9070/1: Make
UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+"")

Cheers,
Nathan



More information about the linux-arm-kernel mailing list