Skip to contentSkip to conversation

csky/ftrace: Fixup error when disable CONFIG_DYNAMIC_FTRACE

PATCH New [email protected] 1 participant 1 message Apr 8, 2020

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 csky/ftrace: Fixup error when disable CONFIG_DYNAMIC_FTRACE

From: Guo Ren <[email protected]>

When CONFIG_DYNAMIC_FTRACE is enabled, static ftrace will fail to boot up and compile. It's a carelessness when developing "dynamic ftrace" and "ftrace with regs".

---
 arch/csky/abiv2/mcount.S  | 2 ++
 arch/csky/kernel/ftrace.c | 2 ++
 2 files changed, 4 insertions(+)
arch/csky/abiv2/mcount.S +2 -0
index 9331c7ed5958..911512bf480f 100644
@@ -103,6 +103,8 @@ ENTRY(_mcount)
 	mov	a0, lr
 	subi	a0, 4
 	ldw	a1, (sp, 24)
+	lrw	a2, function_trace_op
+	ldw	a2, (a2, 0)
 
 	jsr	r26
 
arch/csky/kernel/ftrace.c +2 -0
index 44628e3f7fa6..3c425b84e3be 100644
@@ -202,6 +202,7 @@ int ftrace_disable_ftrace_graph_caller(void)
 #endif /* CONFIG_DYNAMIC_FTRACE */
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
+#ifdef CONFIG_DYNAMIC_FTRACE
 #ifndef CONFIG_CPU_HAS_ICACHE_INS
 struct ftrace_modify_param {
 	int command;
@@ -231,6 +232,7 @@ void arch_ftrace_update_code(int command)
 	stop_machine(__ftrace_modify_code, &param, cpu_online_mask);
 }
 #endif
+#endif /* CONFIG_DYNAMIC_FTRACE */
 
 /* _mcount is defined in abi's mcount.S */
 EXPORT_SYMBOL(_mcount);
Signature · 1 line
2.17.0