lkml.org 
[lkml]   [2022]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/6] LoongArch: Add raw_show_trace to enable guess unwinder default
Date
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@loongson.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
\
 
 \ /
  Last update: 2022-12-15 05:04    [W:0.108 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site