Skip to contentSkip to conversation

arm: show_regs dump stack when ARM_UNWIND enable

PATCH New janboe 3 participants 8 messages Jul 20, 2010 – Aug 10, 2010 Arm (32-bit)

lore
Share & tools
lore

janboe

author
#0 lore raw

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
index acf5e6f..e7ad878 100644
@@ -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
#1 lore raw

PATCH 1/1 arm: show_regs dump stack when ARM_UNWIND enable

Quoted 12 lines · janboe

__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 +0 -0
index acf5e6f..e7ad878 100644

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
author
#2 lore raw

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

__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 +0 -0
index acf5e6f..e7ad878 100644

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.

--
Catalin

#3 lore raw

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.S if ARM_UNWIND is 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
author
#4 lore raw

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.S if ARM_UNWIND is 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
#5 lore raw

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_backtrace in arm_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.

author
#6 lore raw

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_backtrace in arm_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.

#7 lore raw

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_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?

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.