* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
@ 2010-07-20 15:24 janboe
2010-07-20 15:37 ` Catalin Marinas
0 siblings, 1 reply; 8+ messages in thread
From: janboe @ 2010-07-20 15:24 UTC (permalink / raw)
To: linux-arm-kernel
__backtrace is empty when ARM_UNWIND enable, so instead dump_stack
Signed-off-by: janboe <janboe.ye@gmail.com>
---
arch/arm/kernel/process.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index acf5e6f..e7ad878 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -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);
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-07-20 15:24 [PATCH] arm: show_regs dump stack when ARM_UNWIND enable janboe
@ 2010-07-20 15:37 ` Catalin Marinas
2010-07-20 15:54 ` ye janboe
0 siblings, 1 reply; 8+ messages in thread
From: Catalin Marinas @ 2010-07-20 15:37 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 2010-07-20 at 23:24 +0800, janboe wrote:
> __backtrace is empty when ARM_UNWIND enable, so instead dump_stack
>
> Signed-off-by: janboe <janboe.ye@gmail.com>
> ---
> arch/arm/kernel/process.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
> index acf5e6f..e7ad878 100644
> --- a/arch/arm/kernel/process.c
> +++ b/arch/arm/kernel/process.c
> @@ -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
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-07-20 15:37 ` Catalin Marinas
@ 2010-07-20 15:54 ` ye janboe
2010-07-21 9:21 ` Catalin Marinas
0 siblings, 1 reply; 8+ messages in thread
From: ye janboe @ 2010-07-20 15:54 UTC (permalink / raw)
To: linux-arm-kernel
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 <catalin.marinas@arm.com>:
> On Tue, 2010-07-20 at 23:24 +0800, janboe wrote:
>> __backtrace is empty when ARM_UNWIND enable, so instead dump_stack
>>
>> Signed-off-by: janboe <janboe.ye@gmail.com>
>> ---
>> ?arch/arm/kernel/process.c | ? ?4 ++++
>> ?1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
>> index acf5e6f..e7ad878 100644
>> --- a/arch/arm/kernel/process.c
>> +++ b/arch/arm/kernel/process.c
>> @@ -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
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-07-20 15:54 ` ye janboe
@ 2010-07-21 9:21 ` Catalin Marinas
2010-07-21 17:24 ` Janboe Ye
0 siblings, 1 reply; 8+ messages in thread
From: Catalin Marinas @ 2010-07-21 9:21 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 2010-07-20 at 16:54 +0100, ye janboe wrote:
> 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).
--
Catalin
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-07-21 9:21 ` Catalin Marinas
@ 2010-07-21 17:24 ` Janboe Ye
2010-07-22 8:00 ` Russell King - ARM Linux
0 siblings, 1 reply; 8+ messages in thread
From: Janboe Ye @ 2010-07-21 17:24 UTC (permalink / raw)
To: linux-arm-kernel
Is there any way for arm unwind to do user space backtrace like c_backtrace in arm_syscall?
Thanks
On Wed, Jul 21, 2010 at 10:21:05AM +0100, Catalin Marinas wrote:
> On Tue, 2010-07-20 at 16:54 +0100, ye janboe wrote:
> > 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).
>
> --
> Catalin
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-07-21 17:24 ` Janboe Ye
@ 2010-07-22 8:00 ` Russell King - ARM Linux
2010-08-10 3:27 ` ye janboe
0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2010-07-22 8:00 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 22, 2010 at 01:24:28AM +0800, Janboe Ye wrote:
> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-07-22 8:00 ` Russell King - ARM Linux
@ 2010-08-10 3:27 ` ye janboe
2010-08-10 22:59 ` Russell King - ARM Linux
0 siblings, 1 reply; 8+ messages in thread
From: ye janboe @ 2010-08-10 3:27 UTC (permalink / raw)
To: linux-arm-kernel
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 <linux@arm.linux.org.uk>:
> On Thu, Jul 22, 2010 at 01:24:28AM +0800, Janboe Ye wrote:
>> 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.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] arm: show_regs dump stack when ARM_UNWIND enable
2010-08-10 3:27 ` ye janboe
@ 2010-08-10 22:59 ` Russell King - ARM Linux
0 siblings, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2010-08-10 22:59 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Aug 10, 2010 at 11:27:54AM +0800, ye janboe wrote:
> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-08-10 22:59 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20 15:24 [PATCH] arm: show_regs dump stack when ARM_UNWIND enable janboe
2010-07-20 15:37 ` Catalin Marinas
2010-07-20 15:54 ` ye janboe
2010-07-21 9:21 ` Catalin Marinas
2010-07-21 17:24 ` Janboe Ye
2010-07-22 8:00 ` Russell King - ARM Linux
2010-08-10 3:27 ` ye janboe
2010-08-10 22:59 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).