@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2017 Andes Technology Corporation */
-/*
- * The graph frame test is not possible if CONFIG_FRAME_POINTER is not enabled.
- * Check arch/riscv/kernel/mcount.S for detail.
- */
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) && defined(CONFIG_FRAME_POINTER)
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#define HAVE_FUNCTION_GRAPH_FP_TEST
#endif
#define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
@@ -20,8 +20,6 @@
#include <linux/stacktrace.h>
#include <linux/ftrace.h>
-#ifdef CONFIG_FRAME_POINTER
-
struct stackframe {
unsigned long fp;
unsigned long ra;
@@ -73,41 +71,6 @@ static void notrace walk_stackframe(struct task_struct *task,
}
}
-#else /* !CONFIG_FRAME_POINTER */
-
-static void notrace walk_stackframe(struct task_struct *task,
- struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg)
-{
- unsigned long sp, pc;
- unsigned long *ksp;
-
- if (regs) {
- sp = GET_USP(regs);
- pc = GET_IP(regs);
- } else if (task == NULL || task == current) {
- const register unsigned long current_sp __asm__ ("sp");
- sp = current_sp;
- pc = (unsigned long)walk_stackframe;
- } else {
- /* task blocked in __switch_to */
- sp = task->thread.sp;
- pc = task->thread.ra;
- }
-
- if (unlikely(sp & 0x7))
- return;
-
- ksp = (unsigned long *)sp;
- while (!kstack_end(ksp)) {
- if (__kernel_text_address(pc) && unlikely(fn(pc, arg)))
- break;
- pc = (*ksp++) - 0x4;
- }
-}
-
-#endif /* CONFIG_FRAME_POINTER */
-
-
static bool print_trace_address(unsigned long pc, void *arg)
{
print_ip_sym(pc);
The RISC-V port selects CONFIG_ARCH_WANT_FRAME_POINTERS, which causes CONFIG_FRAME_POINTER to always be set. Remove the unreachable code for the !CONFIG_FRAME_POINTER case. Signed-off-by: Christoph Hellwig <hch@lst.de> --- arch/riscv/include/asm/ftrace.h | 6 +----- arch/riscv/kernel/stacktrace.c | 37 --------------------------------- 2 files changed, 1 insertion(+), 42 deletions(-)