summaryrefslogtreecommitdiff
path: root/arch/nds32/include
diff options
context:
space:
mode:
authorZong Li <zong@andestech.com>2018-08-15 05:45:59 +0300
committerGreentime Hu <greentime@andestech.com>2018-09-04 09:45:17 +0300
commita18082575c664847d36c6ca030b09ce8d93aec2f (patch)
tree96070f10fadd478d6f644d639b899d9bb9311650 /arch/nds32/include
parent487913ab18c215b06611c4c91c7e905fc0960eb8 (diff)
downloadlinux-a18082575c664847d36c6ca030b09ce8d93aec2f.tar.xz
nds32/ftrace: Support static function tracer
This patch support the static function tracer. On nds32 ABI, we need to always push return address to stack for __builtin_return_address can work correctly, otherwise, it will get the wrong value of $lp at leaf function. Signed-off-by: Zong Li <zong@andestech.com> Acked-by: Greentime Hu <greentime@andestech.com> Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/include')
-rw-r--r--arch/nds32/include/asm/ftrace.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/nds32/include/asm/ftrace.h b/arch/nds32/include/asm/ftrace.h
new file mode 100644
index 000000000000..bac7657f576a
--- /dev/null
+++ b/arch/nds32/include/asm/ftrace.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_NDS32_FTRACE_H
+#define __ASM_NDS32_FTRACE_H
+
+#ifdef CONFIG_FUNCTION_TRACER
+
+#define HAVE_FUNCTION_GRAPH_FP_TEST
+
+#define MCOUNT_ADDR ((unsigned long)(_mcount))
+/* mcount call is composed of three instructions:
+ * sethi + ori + jral
+ */
+#define MCOUNT_INSN_SIZE 12
+
+extern void _mcount(unsigned long parent_ip);
+
+#endif /* CONFIG_FUNCTION_TRACER */
+
+#endif /* __ASM_NDS32_FTRACE_H */