Re: RFC: How to handle function tracing, frame pointers and-mfentry?

From: Steven Rostedt
Date: Fri Apr 27 2012 - 17:27:35 EST


On Fri, 2012-04-27 at 14:11 -0700, H. Peter Anvin wrote:
> On 04/27/2012 01:57 PM, Steven Rostedt wrote:
> >>
> >> Except it is the wrong thing. This is not the only user of frame
> >> pointer. What I think you mean is remove the dependency in Kconfig, but
> >> force the frame pointer enabled if -mfentry is not supported.
> >
> > You mean option 3?
> >
> > 3) Add frame pointers silently if gcc fails to build with gcc -pg.
> >
>
> Yes, your option 3.
>

Actually, I just noticed this in the Makefile:

ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
# Some targets (ARM with Thumb2, for example), can't be built with frame
# pointers. For those, we don't have FUNCTION_TRACER automatically
# select FRAME_POINTER. However, FUNCTION_TRACER adds -pg, and this is
# incompatible with -fomit-frame-pointer with current GCC, so we don't use
# -fomit-frame-pointer with FUNCTION_TRACER.
ifndef CONFIG_FUNCTION_TRACER
KBUILD_CFLAGS += -fomit-frame-pointer
endif
endif


Because of ARM thumb2, -fomit-frame-pointer is not added if
CONFIG_FRAME_POINTER is not set and FUNCTION_TRACER is. As it is fine to
just use '-pg', which gcc will add frame pointers if needed, and it is
only a problem if both -pg and -fomit-frame-pointer is set. We only need
to remove the select without doing anything else.

If -mfentry is added with -pg, and -fno-omit-frame-pointer is not set,
gcc will not add frame pointers by default.

So it seems that gcc took care of this problem for me :-)

I'll go and make a patch that simply removes the select.

Sorry for the noise ;-)

-- Steve


--
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/