* RE: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
@ 2005-03-11 19:12 ` Chen, Kenneth W
2005-03-11 20:25 ` Matthew Wilcox
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Chen, Kenneth W @ 2005-03-11 19:12 UTC (permalink / raw)
To: linux-ia64
Bob Montgomery wrote on Friday, March 11, 2005 10:40 AM
>
> I have a patch for arch/ia64/kernel/process.c that changes
> ia64_do_show_stack to show the contents of the register backing store
> for each level. I think this will help our post-mortem debugging
> of hard-to-reproduce problems, especially when customers do not have
> a working kernel core dump facility, by allowing us to see function
> argument registers and some of the locals for each function leading
> to the oops. Note: this doesn't capture function arguments per se,
> since the argument register(s) could have been modified prior to the
> call to the next stack level. You still have to read disassembly to
> debug this way :-)
>
> Is this generally interesting? I'm wondering if it isn't currently
> done because of some issue with oops message size, or excessive
> printk's causing problems elsewhere?
Very nice and I think is extremely valuable for debugging, especially
the stack register dump. I vote YES!!
- Ken
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
2005-03-11 19:12 ` Chen, Kenneth W
@ 2005-03-11 20:25 ` Matthew Wilcox
2005-03-11 20:59 ` David Mosberger
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Matthew Wilcox @ 2005-03-11 20:25 UTC (permalink / raw)
To: linux-ia64
On Fri, Mar 11, 2005 at 11:40:04AM -0700, Bob Montgomery wrote:
> argument registers and some of the locals for each function leading
> to the oops. Note: this doesn't capture function arguments per se,
I've been wanting this for a while. I think it'd be *very* useful.
> The current vs. proposed is shown below. Thanks for any comments
> and advice.
I know your patch leaaves this unchanged, but I don't think it's helpful
to show the 'show_stack' and 'show_regs' frames. Can we get rid of them,
or is there a reason they're useful?
> Call Trace:
> [<a000000100012940>] show_stack+0x80/0xa0
> spà000001200df960 bspà000001200d8fb8
> [<a0000001000131c0>] show_regs+0x800/0x820
> spà000001200dfb30 bspà000001200d8f60
> r32 : e0000001200dfc50 r33 : 0000000000000000 r34 : e0000001200dfd08
> r35 : e0000001200dfcc8 r36 : e0000001200dfce0 r37 : e0000001200dfca0
> r38 : e0000001200dfc90 r39 : 00000fffffffbfff r40 : a000000100036b50
> r41 : 000000000000040e r42 : e0000001a00dfbce
> [<a000000100036b50>] die+0x150/0x280
> spà000001200dfb40 bspà000001200d8f20
> r32 : e0000001200dfbd0 r33 : e0000001200dfc50 r34 : 0000020200000010
> r35 : a00000010066a1b8 r36 : a00000010066a1bc r37 : a000000100036cc0
> r38 : 0000000000000309 r39 : a00000010056ebe8
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
2005-03-11 19:12 ` Chen, Kenneth W
2005-03-11 20:25 ` Matthew Wilcox
@ 2005-03-11 20:59 ` David Mosberger
2005-03-11 21:00 ` Luck, Tony
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: David Mosberger @ 2005-03-11 20:59 UTC (permalink / raw)
To: linux-ia64
>>>>> On Fri, 11 Mar 2005 20:25:26 +0000, Matthew Wilcox <matthew@wil.cx> said:
Matthew> I know your patch leaaves this unchanged, but I don't think it's helpful
Matthew> to show the 'show_stack' and 'show_regs' frames. Can we get rid of them,
Matthew> or is there a reason they're useful?
There were useful in the early days, when I didn't trust the unwinder... ;-)
I agree that we should drop them. Just unwind to the interruption-frame
(pt_regs), then start printing the frames.
That'll also be more in line with the other arches.
--david
^ permalink raw reply [flat|nested] 11+ messages in thread* RE: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (2 preceding siblings ...)
2005-03-11 20:59 ` David Mosberger
@ 2005-03-11 21:00 ` Luck, Tony
2005-03-11 21:19 ` Bob Montgomery
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Luck, Tony @ 2005-03-11 21:00 UTC (permalink / raw)
To: linux-ia64
>Is this generally interesting? I'm wondering if it isn't currently
>done because of some issue with oops message size, or excessive
>printk's causing problems elsewhere?
On a VGA console the "iip" is _sometimes_ still visible on the screen
after an oops (and if your users can only be trained to copy down one
number from an oops, this is the most useful one to have). Adding these
extra lines would guarantee that iip always scrolls off the top.
But I'd be fine sacrificing this in exchange for seeing all the
backing store registers.
-Tony
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (3 preceding siblings ...)
2005-03-11 21:00 ` Luck, Tony
@ 2005-03-11 21:19 ` Bob Montgomery
2005-03-11 21:23 ` David Mosberger
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Bob Montgomery @ 2005-03-11 21:19 UTC (permalink / raw)
To: linux-ia64
On Fri, 2005-03-11 at 12:59 -0800, David Mosberger wrote:
> >>>>> On Fri, 11 Mar 2005 20:25:26 +0000, Matthew Wilcox <matthew@wil.cx> said:
>
> Matthew> I know your patch leaaves this unchanged, but I don't think it's helpful
> Matthew> to show the 'show_stack' and 'show_regs' frames. Can we get rid of them,
> Matthew> or is there a reason they're useful?
>
> There were useful in the early days, when I didn't trust the unwinder... ;-)
> I agree that we should drop them. Just unwind to the interruption-frame
> (pt_regs), then start printing the frames.
>
> That'll also be more in line with the other arches.
You might trust the unwinder, and that *might* be a reason to lop off
the top two (show regs and show stack), but I still want to see what
kernel handler was used, and it's still reassuring to be able to check
at show_stack to verify that bsp < sp to eliminate stack overflow as
the source of either the problem, or the problem with the unwinding that
follows.
I'm assuming in my example, that not printing until the interruption
frame would eliminate what is shown below, and I would like to keep
that:
[<a000000100036b50>] die+0x150/0x280
spà000001200dfb40 bspà000001200d8f20
[<a000000100036cc0>] die_if_kernel+0x40/0x60
spà000001200dfb40 bspà000001200d8ef0
[<a0000001000378d0>] ia64_fault+0x150/0xac0
spà000001200dfb40 bspà000001200d8ea8
[<a00000010000ad20>] ia64_leave_kernel+0x0/0x260
spà000001200dfc40 bspà000001200d8ea8
and not just see the stack top out at
[<a0000002000689d0>] buncho_going_to_regnat+0x50/0xa0 [buncho]
spà000001200dfe10 bspà000001200d8e80
...
where the error occurred.
--
Bob Montgomery <bob.montgomery@hp.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (4 preceding siblings ...)
2005-03-11 21:19 ` Bob Montgomery
@ 2005-03-11 21:23 ` David Mosberger
2005-03-14 18:51 ` Alex Tsariounov
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: David Mosberger @ 2005-03-11 21:23 UTC (permalink / raw)
To: linux-ia64
>>>>> On Fri, 11 Mar 2005 14:19:49 -0700, Bob Montgomery <bob.montgomery@hp.com> said:
Bob> You might trust the unwinder, and that *might* be a reason to lop off
Bob> the top two (show regs and show stack), but I still want to see what
Bob> kernel handler was used, and it's still reassuring to be able to check
Bob> at show_stack to verify that bsp < sp to eliminate stack overflow as
Bob> the source of either the problem, or the problem with the unwinding that
Bob> follows.
That's true.
Bob> I'm assuming in my example, that not printing until the interruption
Bob> frame would eliminate what is shown below, and I would like to keep
Bob> that:
Bob> [<a000000100036b50>] die+0x150/0x280
Bob> spà000001200dfb40 bspà000001200d8f20
Bob> [<a000000100036cc0>] die_if_kernel+0x40/0x60
Bob> spà000001200dfb40 bspà000001200d8ef0
Bob> [<a0000001000378d0>] ia64_fault+0x150/0xac0
Bob> spà000001200dfb40 bspà000001200d8ea8
Bob> [<a00000010000ad20>] ia64_leave_kernel+0x0/0x260
Bob> spà000001200dfc40 bspà000001200d8ea8
Bob> and not just see the stack top out at
Bob> [<a0000002000689d0>] buncho_going_to_regnat+0x50/0xa0 [buncho]
Bob> spà000001200dfe10 bspà000001200d8e80
Bob> ...
Bob> where the error occurred.
No, other arches start past the interrupt frame, i.e., you'd get the
latter output.
Stack-corruption is an important concern, I agree. That's the only
reason I haven't gotten rid of the "sp" and "bsp" printing.
--david
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (5 preceding siblings ...)
2005-03-11 21:23 ` David Mosberger
@ 2005-03-14 18:51 ` Alex Tsariounov
2005-03-14 19:04 ` Luck, Tony
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Alex Tsariounov @ 2005-03-14 18:51 UTC (permalink / raw)
To: linux-ia64
On Fri, Mar 11, 2005 at 01:00:08PM -0800, Luck, Tony wrote:
> >Is this generally interesting? I'm wondering if it isn't currently
> >done because of some issue with oops message size, or excessive
> >printk's causing problems elsewhere?
>
> On a VGA console the "iip" is _sometimes_ still visible on the screen
> after an oops (and if your users can only be trained to copy down one
> number from an oops, this is the most useful one to have). Adding these
> extra lines would guarantee that iip always scrolls off the top.
Doesn't hitting Shift-PgUp bring the scrolled-off portions back
into view on a VGA console, or does that key not always work?
Regards,
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread* RE: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (6 preceding siblings ...)
2005-03-14 18:51 ` Alex Tsariounov
@ 2005-03-14 19:04 ` Luck, Tony
2005-03-14 19:19 ` Alex Tsariounov
2005-03-14 23:06 ` Keith Owens
9 siblings, 0 replies; 11+ messages in thread
From: Luck, Tony @ 2005-03-14 19:04 UTC (permalink / raw)
To: linux-ia64
>>Adding these extra lines would guarantee that iip always scrolls off the top.
>
>Doesn't hitting Shift-PgUp bring the scrolled-off portions back
>into view on a VGA console, or does that key not always work?
I've never seen Shift-PgUp work after the kernel has oopsed ... aren't
keyboard interrupts disabled by that point?
-Tony
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (7 preceding siblings ...)
2005-03-14 19:04 ` Luck, Tony
@ 2005-03-14 19:19 ` Alex Tsariounov
2005-03-14 23:06 ` Keith Owens
9 siblings, 0 replies; 11+ messages in thread
From: Alex Tsariounov @ 2005-03-14 19:19 UTC (permalink / raw)
To: linux-ia64
On Mon, Mar 14, 2005 at 11:04:53AM -0800, Luck, Tony wrote:
> >>Adding these extra lines would guarantee that iip always scrolls off the top.
> >
> >Doesn't hitting Shift-PgUp bring the scrolled-off portions back
> >into view on a VGA console, or does that key not always work?
>
> I've never seen Shift-PgUp work after the kernel has oopsed ... aren't
> keyboard interrupts disabled by that point?
Ah... I forgot about that little point.
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFC] Enhanced show_stack output to add backing store regs
2005-03-11 18:40 [RFC] Enhanced show_stack output to add backing store regs Bob Montgomery
` (8 preceding siblings ...)
2005-03-14 19:19 ` Alex Tsariounov
@ 2005-03-14 23:06 ` Keith Owens
9 siblings, 0 replies; 11+ messages in thread
From: Keith Owens @ 2005-03-14 23:06 UTC (permalink / raw)
To: linux-ia64
On Mon, 14 Mar 2005 11:51:36 -0700,
alext@fc.hp.com (Alex Tsariounov) wrote:
>On Fri, Mar 11, 2005 at 01:00:08PM -0800, Luck, Tony wrote:
>> >Is this generally interesting? I'm wondering if it isn't currently
>> >done because of some issue with oops message size, or excessive
>> >printk's causing problems elsewhere?
>>
>> On a VGA console the "iip" is _sometimes_ still visible on the screen
>> after an oops (and if your users can only be trained to copy down one
>> number from an oops, this is the most useful one to have). Adding these
>> extra lines would guarantee that iip always scrolls off the top.
>
>Doesn't hitting Shift-PgUp bring the scrolled-off portions back
>into view on a VGA console, or does that key not always work?
Shift-PgUp requires working interrupts. Not always available when the
kernel is having problems.
^ permalink raw reply [flat|nested] 11+ messages in thread