[PATCH] powerpc/xmon: Exclude all of xmon/ from ftrace
Naveen N. Rao
naveen.n.rao at linux.vnet.ibm.com
Thu Aug 17 00:13:04 AEST 2017
Hi Michael,
Sorry -- was off since last week.
On 2017/08/15 08:04PM, Michael Ellerman wrote:
> Michael Ellerman <mpe at ellerman.id.au> writes:
>
> > "Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:
> >
> >> diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
> >> index 0b2f771593eb..5f95af64cb8f 100644
> >> --- a/arch/powerpc/xmon/Makefile
> >> +++ b/arch/powerpc/xmon/Makefile
> >> @@ -7,6 +7,19 @@ UBSAN_SANITIZE := n
> >>
> >> ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
> >>
> >> +ifdef CONFIG_FUNCTION_TRACER
> >> +CFLAGS_REMOVE_xmon.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> >> +CFLAGS_REMOVE_nonstdio.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> >> +ifdef CONFIG_XMON_DISASSEMBLY
> >> +CFLAGS_REMOVE_ppc-dis.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> >> +CFLAGS_REMOVE_ppc-opc.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> >> +ifdef CONFIG_SPU_BASE
> >> +CFLAGS_REMOVE_spu-dis.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> >> +CFLAGS_REMOVE_spu-opc.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
> >> +endif
> >> +endif
> >> +endif
> >
> > Urk.
> >
> > We want to disable it for everything in the directory, so can you do
> > something like:
> >
> > ORIG_CFLAGS := $(KBUILD_CFLAGS)
> > KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
>
> Yes:
>
> # Disable ftrace for the entire directory
> ORIG_CFLAGS := $(KBUILD_CFLAGS)
> KBUILD_CFLAGS = $(subst -mno-sched-epilog,,$(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)))
>
> Seems to work.
Nice -- I had looked for a generic CFLAGS_REMOVE variant, but didn't
find that. This is much nicer.
Thanks,
Naveen
More information about the Linuxppc-dev
mailing list