vamsi_krishna@xxxxxxxxxx wrote:
>
> Matt,
>
> I am trying to figure out why dump_configure_header is called twice, once
> from dump_execute_memdump and then from dump_execute (after the call to
> dump_execute_memdump). It is not clear to me what could have changed in the
> meantime.
>
> Another question is regarding the x86 specific code in dump_execute to
> capture esp and eip one more time at the end. AFAIU, if we don't do this,
> the backtrace should show only untill the last time dump_configure_header
> is called, as the comment there says. I would think calling
> dump_configure_header once, at the top of dump_execute should do. Do you
> see any problem with this?
Both _very_ good questions. As it turns out, you _have_ to do exactly
what's indicated in the comments. The reason for the first call to
dump_configure_header() was to save those eip/esp values, and then
we call dump_write_header() to write them out.
Unfortunately, though, calling dump_write_header() in some cases blows
away the ability to perform a backtrace (stack trace dump) of the
failing process, because dump_write_header() overwrites part of the
stack that dump_configure_header() was once on. So, you snapshot the
registers and then write out the dump header. We ran into this
problem way back in 2.X, and had to fix it. Some people were saying
that their dumps weren't complete. When looking at the dump with
'lcrash', we saw that the stack trace was "corrupt" due to this
problem, specifically with the failing task.
Here's a better way around this (I wonder why I didn't do it this
way to begin with). Pass an integer argument into dump_configure_header(),
which passes the value down to the lower __dump_configure_header() calls.
This in turn will look at the flag (integer) and determine if the lower
call should call back up into dump_write_header() from below. That way
you don't have to maintain the register save in that code.
Sound about right? If so, I'll check it in later today.
--Matt
> Thanks, Vamsi.
>
> Vamsi Krishna S.
> Linux Technology Center,
> IBM Software Lab, Bangalore.
> Ph: +91 80 5262355 Extn: 3959
> Internet: vamsi_krishna@xxxxxxxxxx
|