csky/ftrace: Fixup error when disable CONFIG_DYNAMIC_FTRACE
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 8 Apr 2020 09:47:33 +0000 (17:47 +0800)
committerGuo Ren <guoren@linux.alibaba.com>
Wed, 13 May 2020 09:55:05 +0000 (17:55 +0800)
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".

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
arch/csky/abiv2/mcount.S
arch/csky/kernel/ftrace.c

index 9331c7ed5958ab0b80e265b17f35cf0e4e3aa3a6..911512bf480f3ef9102e3d24b072dc2a37fd6d07 100644 (file)
@@ -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
 
index 44628e3f7fa689cf6ec9856dfb79bc4221da5a60..3c425b84e3be6f59b04b9eb7a64ea61ccf4df78a 100644 (file)
@@ -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);