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>
This commit is contained in:
20
arch/nds32/include/asm/ftrace.h
Normal file
20
arch/nds32/include/asm/ftrace.h
Normal file
@@ -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 */
|
Reference in New Issue
Block a user