Thread (20 messages) 20 messages, 5 authors, 2015-10-29
STALE3875d
Revisions (3)
  1. v3 current
  2. v4 [diff vs current]
  3. v5 [diff vs current]

[PATCH v3 4/7] arm64: ftrace: allow for tracing leaf functions

From: AKASHI Takahiro <hidden>
Date: 2015-10-08 10:03:41
Also in: lkml
Subsystem: arm64 port (aarch64 architecture), the rest · Maintainers: Catalin Marinas, Will Deacon, Linus Torvalds

CONFIG_FRAME_POINTER is always enabled on arm64, adding
-fno-omit-frame-pointer, while ftrace, CONFIG_FUNCTION_TRACER, adds -pg
to KBUILD_CFLAGS.
The combination of these options, however, does not implicitly enables
-fno-omit-leaf-frame-pointer option, and no leaf functions are actually
traced under ftrace.

This patch allows for tracing leaf functions by adding
-fno-omit-leaf-frame-pointer option, but does it only when
CONFIG_STACK_TRACER is configured because it will increase the kernel
size and add extra instructions on runtime.

Signed-off-by: AKASHI Takahiro <redacted>
---
 arch/arm64/Makefile |    5 +++++
 1 file changed, 5 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f9914d7..71cad91 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -28,6 +28,11 @@ endif
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr)
 KBUILD_AFLAGS	+= $(lseinstr)
+ifdef CONFIG_STACK_TRACER
+ifdef CONFIG_FRAME_POINTER
+KBUILD_CFLAGS	+= -mno-omit-leaf-frame-pointer
+endif
+endif
 
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help