arm: show_regs dump stack when ARM_UNWIND enable
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
__backtrace is empty when ARM_UNWIND enable, so instead dump_stack
--- arch/arm/kernel/process.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/kernel/process.c +4 -0
@@ -271,7 +271,11 @@ void show_regs(struct pt_regs * regs)printk ("\n" );printk ("Pid: %d, comm: %20s\n" ,task_pid_nr (current), current->comm);__show_regs (regs); +#ifdef CONFIG_ARM_UNWIND +dump_stack (); +#else __backtrace (); +#endif }ATOMIC_NOTIFIER_HEAD (thread_notify_head);
Signature · 1 line
1.7.1
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
Quoted 12 lines · janboe
__backtraceis empty whenARM_UNWINDenable, so insteaddump_stackSigned-off-by janboe <[email protected]>--- arch/arm/kernel/process.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)arch/arm/kernel/process.c +0
-0
arch/arm/kernel/process.c void show_regs(struct pt_regs * regs) · line 279
Quoted 9 lines
arch/arm/kernel/process.c +4
-0@@ -271,7 +271,11 @@ void show_regs(struct pt_regs * regs)printk ("\n" );printk ("Pid: %d, comm: %20s\n" ,task_pid_nr (current), current->comm);__show_regs (regs); +#ifdef CONFIG_ARM_UNWIND +dump_stack (); +#else __backtrace (); +#endif }
It looks like both dump_stack() and __backtrace() (with FRAME_POINTER) have pretty much the same semantics. Maybe we could define __backtrace() to just call dump_stack() when ARM_UNWIND.
Signature · 1 line
Catalin
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
Yes. both are same.
Is it ok to remove backtrace.S if ARM_UNWIND is enable?
Catalin
Is it ok to merge this patch first and then try replace __bactrace in next patch?
Janboe
2010/7/20 Catalin Marinas <[email protected]>:
Quoted 31 lines · janboe
Quoted 12 lines
__backtraceis empty whenARM_UNWINDenable, so insteaddump_stackSigned-off-by janboe <[email protected]>---
?arch/arm/kernel/process.c | ? ?4 ++++
?1 files changed, 4 insertions(+), 0 deletions(-)arch/arm/kernel/process.c +0
-0arch/arm/kernel/process.c void show_regs(struct pt_regs * regs) · line 279
Quoted 9 lines
arch/arm/kernel/process.c +4
-0@@ -271,7 +271,11 @@ void show_regs(struct pt_regs * regs) ? ? ? printk("\n"); ? ? ? printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm); ? ? ? __show_regs(regs); +#ifdef CONFIG_ARM_UNWIND + ? ? dump_stack(); +#else ? ? ? __backtrace(); +#endif ?}It looks like both
dump_stack()and__backtrace()(withFRAME_POINTER) have pretty much the same semantics. Maybe we could define__backtrace()to just calldump_stack()whenARM_UNWIND.--
Catalin
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
Quoted 3 lines · ye janboe
Yes. both are same.
Is it ok to remove
backtrace.SifARM_UNWINDis enable?
I think so, as long as you provide some macro or static inline function for __backtrace and c_backtrace (if they are called at all).
Signature · 1 line
Catalin
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
Is there any way for arm unwind to do user space backtrace like c_backtrace in arm_syscall?
Thanks
Quoted 11 lines · Catalin Marinas
Quoted 3 lines · ye janboe
Yes. both are same.
Is it ok to remove
backtrace.SifARM_UNWINDis enable?I think so, as long as you provide some macro or static inline function for
__backtraceandc_backtrace(if they are called at all).Signature · 1 line
Catalin
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
Quoted 2 lines · Janboe Ye
Is there any way for arm unwind to do user space backtrace like
c_backtraceinarm_syscall?
That's a job for userspace, which would have access to the program debug information, which is necessary for unwinding EABI programs. The debug information is not loaded into the programs address space when you run it, and therefore would not be available to the kernel.
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
hi, Russell
I agree with this.
But I am confused with c_bactrace in arm_syscall. This function is used to dump stack when arm syscall failed. regs->ARM_fp should be an userspace address and c_backtrace should fail to dump the backtrace.
Do you know what the purpose c_backtrace here?
Thanks
Janboe
2010/7/22 Russell King - ARM Linux <[email protected]>:
Quoted 9 lines · Janboe Ye
Quoted 2 lines
Is there any way for arm unwind to do user space backtrace like
c_backtraceinarm_syscall?That's a job for userspace, which would have access to the program debug information, which is necessary for unwinding EABI programs. The debug information is not loaded into the programs address space when you run it, and therefore would not be available to the kernel.
PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable
Quoted 10 lines · ye janboe
hi, Russell
I agree with this.
But I am confused with
c_bactraceinarm_syscall. This function is used to dump stack when arm syscall failed.regs->ARM_fpshould be an userspace address andc_backtraceshould fail to dump the backtrace.Do you know what the purpose
c_backtracehere?
Debugging kernel failures in earlier kernels when there wasn't such stuff as EABI to worry about - from times when programs were built with frame pointers.
That call should probably be removed now.