[PATCH v2 2/3] arm: ftrace: function_graph with DYNAMIC_FTRACE

Julien Thierry julien.thierry at arm.com
Fri Nov 3 04:44:17 PDT 2017


Function graph does not work currently when CONFIG_DYNAMIC_TRACE is not
set. This is because ftrace_function_trace is not always set to ftrace_stub
when function_graph is in use.

Do not skip checking of graph tracer functions when ftrace_function_trace
is set.

Suggested-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
Signed-off-by: Julien Thierry <julien.thierry at arm.com>
Cc: Russell King <linux at armlinux.org.uk>
---
 arch/arm/kernel/entry-ftrace.S | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Takahiro's patch was not signed-off, let me know if I need to change the
Suggested-by into a Signed-off-by.

diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S
index efcd9f2..e3555f8 100644
--- a/arch/arm/kernel/entry-ftrace.S
+++ b/arch/arm/kernel/entry-ftrace.S
@@ -68,7 +68,13 @@
 	ldr	r2, [r0]
 	adr	r0, .Lftrace_stub
 	cmp	r0, r2
-	bne	1f
+	beq	1f
+
+	mcount_get_lr	r1			@ lr of instrumented func
+	mcount_adjust_addr	r0, lr		@ instrumented function
+	badr	lr, 1f
+	mov	pc, r2
+1:

 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 	ldr     r1, =ftrace_graph_return
@@ -84,12 +90,6 @@
 #endif

 	mcount_exit
-
-1: 	mcount_get_lr	r1			@ lr of instrumented func
-	mcount_adjust_addr	r0, lr		@ instrumented function
-	badr	lr, 2f
-	mov	pc, r2
-2:	mcount_exit
 .endm

 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
--
1.9.1



More information about the linux-arm-kernel mailing list