Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1666a6fc authored by Franck Bui-Huu's avatar Franck Bui-Huu Committed by Ralf Baechle
Browse files

[MIPS] Simplify dump_stack()



Make dump_stack() code not depend on CONFIG_KALLSYMS.

It also make prepare_frametrace() always inlined to get
less false entries reported by show_raw_backtrace().

Signed-off-by: default avatarFranck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 6057a798
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
	show_backtrace(task, regs);
}

static noinline void prepare_frametrace(struct pt_regs *regs)
static __always_inline void prepare_frametrace(struct pt_regs *regs)
{
	__asm__ __volatile__(
		"1: la $2, 1b\n\t"
@@ -200,17 +200,15 @@ void show_stack(struct task_struct *task, unsigned long *sp)
 */
void dump_stack(void)
{
	unsigned long stack;

#ifdef CONFIG_KALLSYMS
	if (!raw_show_trace) {
	struct pt_regs regs;

	/*
	 * Remove any garbage that may be in regs (specially func
	 * addresses) to avoid show_raw_backtrace() to report them
	 */
	memset(&regs, 0, sizeof(regs));
	prepare_frametrace(&regs);
	show_backtrace(current, &regs);
		return;
	}
#endif
	show_raw_backtrace(&stack);
}

EXPORT_SYMBOL(dump_stack);