
From: Masami Hiramatsu <mhiramat@kernel.org> mainline inclusion from mainline-v5.16-rc1 commit 811b93ffaa488a4733270d8c8bc6c773334ab351 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9R2TB Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- Compile kretprobe related stacktrace entry recovery code and unwind_state::kr_cur field only when CONFIG_KRETPROBES=y. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Conflicts: arch/x86/include/asm/unwind.h Fixes: b0c9f2f39283 ("x86/unwind: Recover kretprobe trampoline entry") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com> --- arch/x86/include/asm/unwind.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h index 1139b3cab818..fbce1e35d406 100644 --- a/arch/x86/include/asm/unwind.h +++ b/arch/x86/include/asm/unwind.h @@ -104,9 +104,13 @@ static inline unsigned long unwind_recover_kretprobe(struct unwind_state *state, unsigned long addr, unsigned long *addr_p) { +#ifdef CONFIG_KRETPROBES return is_kretprobe_trampoline(addr) ? kretprobe_find_ret_addr(state->task, addr_p) : addr; +#else + return addr; +#endif } /* Recover the return address modified by kretprobe and ftrace_graph. */ -- 2.25.1