diff mbox series

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

Message ID 20230718023201.16018-1-minachou@andestech.com (mailing list archive)
State New, archived
Headers show
Series riscv: Move the "Call Trace" to dump_backrace(). | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD 471aba2e4760
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 4 and now 4
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch warning WARNING: Avoid logging continuation uses where feasible
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Mina HuiMin-Chou July 18, 2023, 2:32 a.m. UTC
From: Hui Min Mina Chou <minachou@andestech.com>

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/20220419174842.488-1-palmer@rivosinc.com/

Signed-off-by: Hui Min Mina Chou <minachou@andestech.com>
---
 arch/riscv/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Conor Dooley July 24, 2023, 7:57 a.m. UTC | #1
On Tue, Jul 18, 2023 at 10:32:01AM +0800, Mina HuiMin-Chou wrote:
> From: Hui Min Mina Chou <minachou@andestech.com>
> 
> 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/20220419174842.488-1-palmer@rivosinc.com/

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?

> 
> Signed-off-by: Hui Min Mina Chou <minachou@andestech.com>
> ---
>  arch/riscv/kernel/stacktrace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
> index 64a9c093aef9..ff136031a592 100644
> --- a/arch/riscv/kernel/stacktrace.c
> +++ b/arch/riscv/kernel/stacktrace.c
> @@ -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);
>  }
>  
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
diff mbox series

Patch

diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 64a9c093aef9..ff136031a592 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -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);
 }