summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/unwind.h
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2021-10-21 09:54:42 +0900
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-10-22 12:16:53 -0400
commit811b93ffaa488a4733270d8c8bc6c773334ab351 (patch)
tree2446e9be789bee3115da52462e895a916eb2af83 /arch/x86/include/asm/unwind.h
parente44e81c5b90f698025eadceb7eef8661eda117d5 (diff)
x86/unwind: Compile kretprobe fixup code only if CONFIG_KRETPROBES=y
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>
Diffstat (limited to 'arch/x86/include/asm/unwind.h')
-rw-r--r--arch/x86/include/asm/unwind.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h
index fca2e783e3ce..2a1f8734416d 100644
--- a/arch/x86/include/asm/unwind.h
+++ b/arch/x86/include/asm/unwind.h
@@ -16,7 +16,9 @@ struct unwind_state {
unsigned long stack_mask;
struct task_struct *task;
int graph_idx;
+#ifdef CONFIG_KRETPROBES
struct llist_node *kr_cur;
+#endif
bool error;
#if defined(CONFIG_UNWINDER_ORC)
bool signal, full_regs;
@@ -105,9 +107,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, &state->kr_cur) :
addr;
+#else
+ return addr;
+#endif
}
/* Recover the return address modified by kretprobe and ftrace_graph. */