Skip to contentSkip to conversation

riscv: Move the "Call Trace" to dump_backrace().

PATCH In review Mina HuiMin-Chou 2 participants 2 messages Jul 19, 2023 – Jul 24, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: Move the "Call Trace" to dump_backrace().

From: Hui Min Mina Chou <[email protected]>

It would be appropriate to show "Call Trace" within the dump_backtrace function to ensure that some kernel dumps include this information.

This patch is based on Chen Huang's comment [1] and Palmer Dabbelt's patch [2].

[1] https://lore.kernel.org/lkml/mhng-75c14e1e-a23c-404b-a1f6-235e53bdb6f3@palmerdabbelt-glaptop/
[2] https://lore.kernel.org/lkml/[email protected]/

---
 arch/riscv/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/stacktrace.c +1 -1
index 64a9c093aef9..ff136031a592 100644
@@ -118,12 +118,12 @@ static bool print_trace_address(void *arg, unsigned long pc)
 noinline void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
 		    const char *loglvl)
 {
+	pr_cont("%sCall Trace:\n", loglvl);
 	walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
 }
 
 void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
-	pr_cont("%sCall Trace:\n", loglvl);
 	dump_backtrace(NULL, task, loglvl);
 }
 
Signature · 7 lines
2.34.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw
Quoted 10 lines · Mina HuiMin-Chou

From: Hui Min Mina Chou <[email protected]>

It would be appropriate to show "Call Trace" within the dump_backtrace function to ensure that some kernel dumps include this information.

This patch is based on Chen Huang's comment [1] and Palmer Dabbelt's patch [2].

[1] https://lore.kernel.org/lkml/mhng-75c14e1e-a23c-404b-a1f6-235e53bdb6f3@palmerdabbelt-glaptop/
[2] https://lore.kernel.org/lkml/[email protected]/

Is this change still appropriate? It was cited as a fix for syzkaller but a year has passed since then and it may not be required.

Alex, do you know?

Quoted 32 lines
---
 arch/riscv/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/stacktrace.c +1 -1
index 64a9c093aef9..ff136031a592 100644
@@ -118,12 +118,12 @@ static bool print_trace_address(void *arg, unsigned long pc)
 noinline void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
 		    const char *loglvl)
 {
+	pr_cont("%sCall Trace:\n", loglvl);
 	walk_stackframe(task, regs, print_trace_address, (void *)loglvl);
 }
 
 void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 {
-	pr_cont("%sCall Trace:\n", loglvl);
 	dump_backtrace(NULL, task, loglvl);
 }
 
Signature · 7 lines
2.34.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv