[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221215040141.18610-6-hejinyang@loongson.cn>
Date: Thu, 15 Dec 2022 12:01:40 +0800
From: Jinyang He <hejinyang@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>,
Qing Zhang <zhangqing@...ngson.cn>
Cc: loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mark Rutland <mark.rutland@....com>
Subject: [PATCH 5/6] LoongArch: Add raw_show_trace to enable guess unwinder default
Inspired by MIPS, add cmdline parameter named 'raw_show_trace' to
enable guess unwinder in prologue unwinder unwind_start() default.
In some cases the guess is more efficient than prologue.
Signed-off-by: Jinyang He <hejinyang@...ngson.cn>
---
arch/loongarch/kernel/unwind_prologue.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/loongarch/kernel/unwind_prologue.c b/arch/loongarch/kernel/unwind_prologue.c
index 9677e13c4b4c..441641227c10 100644
--- a/arch/loongarch/kernel/unwind_prologue.c
+++ b/arch/loongarch/kernel/unwind_prologue.c
@@ -122,11 +122,22 @@ static bool unwind_by_prologue(struct unwind_state *state)
return !!__kernel_text_address(state->pc);
}
+static int raw_show_trace;
+static int __init set_raw_show_trace(char *str)
+{
+ raw_show_trace = 1;
+ return 1;
+}
+__setup("raw_show_trace", set_raw_show_trace);
+
static void start(struct unwind_state *state, struct task_struct *task,
struct pt_regs *regs)
{
state->first = true;
+ if (raw_show_trace)
+ unwind_register_unwinder(state, guard_unwinder);
+
/*
* The current PC is not kernel text address, we cannot find its
* relative symbol. Thus, prologue analysis will be broken. Luckly,
--
2.34.3
Powered by blists - more mailing lists