History

ftrace: Remove selecting FRAME_POINTER with FUNCTION_TRACER

The function tracer will enable the -pg option with gcc, which requires that frame pointers. When FRAME_POINTER is defined in the kernel config it adds the gcc option -fno-omit-frame-pointer which causes some problems on some architectures. For those architectures, the FRAME_POINTER select was not set. When FUNCTION_TRACER was selected on these architectures that can not have -fno-omit-frame-pointer, the -pg option is still set. But when FRAME_POINTER is not selected, the kernel config would add the gcc option -fomit-frame-pointer. Adding this option is incompatible with -pg even on archs that do not need frame pointers with -pg. The answer to this was to just not add either -fno-omit-frame-pointer or -fomit-frame-pointer on these archs that want function tracing but do not set FRAME_POINTER. As it turns out, for archs that require frame pointers for function tracing, the same can be used. If gcc requires frame pointers with -pg, it will simply add it. The best thing to do is not select FRAME_POINTER when function tracing is selected, and let gcc add it if needed. Only add the -fno-omit-frame-pointer when something else selects FRAME_POINTER, but do not add -fomit-frame-pointer if function tracing is selected.

Steven Rostedt committed 14 years ago

Commit b732d431 parent e4f5d541 file · +0 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/Kconfig+0−1
@@ -141,7 +141,6 @@ if FTRACE · 140 unmodified lines
141config FUNCTION_TRACER141config FUNCTION_TRACER
142 bool "Kernel Function Tracer"142 bool "Kernel Function Tracer"
143 depends on HAVE_FUNCTION_TRACER143 depends on HAVE_FUNCTION_TRACER
144 select FRAME_POINTER if !ARM_UNWIND && !PPC && !S390 && !MICROBLAZE
145 select KALLSYMS144 select KALLSYMS
146 select GENERIC_TRACER145 select GENERIC_TRACER
147 select CONTEXT_SWITCH_TRACER146 select CONTEXT_SWITCH_TRACER