public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Kconfig dependency issue on function-graph tracer and frame pointer on arm
@ 2019-04-14 10:47 Masami Hiramatsu
  2019-04-14 13:34 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 7+ messages in thread
From: Masami Hiramatsu @ 2019-04-14 10:47 UTC (permalink / raw)
  To: Steven Rostedt, Stefan Agner, Arnd Bergmann, Masahiro Yamada
  Cc: Russell King, linux-arm-kernel, naresh.kamboju, linux-kernel

Hello,

Recently, Naresh reported that the function-graph tracer on the latest
kernel crashes on arm. I could reproduce it and bisected. I finally found
the commit f9b58e8c7d03 ("ARM: 8800/1: use choice for kernel unwinders")
was the first bad commit.

Actually, this commit is just changing Kconfig for making kernel unwinder
choosable. However, as a side effect, this makes CONFIG_FRAME_POINTER=n
by default even if CONFIG_FUNCTION_GRAPH_TRACER=y.
(Note that function-graph tracer implementation on arm depends on
 FRAME_POINTER.)

This seems odd, because the commit introduced below code

+choice
+       prompt "Choose kernel unwinder"
+       default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER
+       default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER
+       help

So, it seems UNWINDER_FRAME_POINTER is used if FUNCTION_GRAPH_TRACER=y.
However, it seems not working. (I guess this is a wrong syntax for Kconfig)

Moreover, since this just setting default value, there seems no direct
dependency to FRAME_POINTER from FUNCTION_GRAPH_TRACER. I guess user can
change it...

I made a fix below (which I tested). This is ugly (arch specific dependency
in generic part) but works.
It enables both of FRAME_POINTER and UNWINDER_ARM.

However I still have some questions.

- Is above choice+default a correct syntax for Kconfig? (Masahiro?)
- Can UNWINDER_ARM work with FRAME_POINTER? (Arnd?)

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 5e3de28c7677..f79c54680f3b 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -160,6 +160,7 @@ config FUNCTION_GRAPH_TRACER
        depends on HAVE_FUNCTION_GRAPH_TRACER
        depends on FUNCTION_TRACER
        depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE
+       select ARCH_WANT_FRAME_POINTERS if ARM
        default y
        help
          Enable the kernel to trace a function at both its return

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-23 20:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-14 10:47 Kconfig dependency issue on function-graph tracer and frame pointer on arm Masami Hiramatsu
2019-04-14 13:34 ` Russell King - ARM Linux admin
2019-04-14 14:52   ` Masami Hiramatsu
2019-04-14 15:37     ` Russell King - ARM Linux admin
2019-04-14 23:54       ` Masami Hiramatsu
2019-04-15 12:28   ` Arnd Bergmann
2019-04-23 20:37     ` Stefan Agner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox