[Crash-utility] [PATCH] netdump: Add a helper function to check if registers is available for a given active task in ELF notes

Dave Anderson anderson at redhat.com
Fri Apr 1 20:08:42 UTC 2011



----- Original Message -----
> ----- Original Message -----
> > Add a helper function, exist_regs_in_elf_notes(tc), which checks
> > whether or not register values for a given active task is available in
> > ELF notes.
> >
> > I intend to use the helper function in gcore extension module.  vmcore
> > generated by diskdump has NT_PRSTATUS for a panic task only, and so
> > specifying get_regs_from_elf_notes() directly to non-panic active
> > tasks leads to a fatal action. So, it's necessary to check, in
> > advance, that an active task can get registers from ELF notes, but the
> > variable holding vmcore's data including ELF notes', nd, is defined as
> > a static global variable in netdump.c and thus the new helper function
> > needs to be introduced.
> 
> Why not make the "nd" pointer available to extension modules?
> 
> A get_kdump_vmcore_data() function already exists. If you
> create a new get_netdump_vmcore_data() function, it seems that
> most (if not all) of this netdump.c code that is *only* used by
> your extension module could be moved into your extension module
> source code, where it really belongs. The vmcore_data structure
> declaration could be moved into defs.h so that you would not have
> to #include netdump.h.
> 
> BTW, you seemed to have sent a duplicate patch-set, i.e.,
> 0001-Check-non-support-machine-check-first-01.patch and
> 0001-Check-non-support-machine-check-first.patch, etc.
> 
> Dave

A couple other questions...

As I understand it, if you attempt to do a gcore on an active
task from a netdump vmcore, but it is not the panic task, the
registers are not saved, and the command will abort due to the
fatal error here in get_regs_from_elf_notes():

       if (!exist_regs_in_elf_notes(tc))
                error(FATAL, "cannot determine register set "
                      "for %s task: %lx comm: \"%s\"\n",
                      (tc->task == tt->panic_task) ? "panic" : "active",
                      tc->task, tc->comm);

In that case, why not fall through and get the registers from 
the kernel-entry exception frame in gcore_get_regs_from_eframe()?

But I admit I still don't understand why you don't get
the registers from the kernel-entry exception frame
for *all* tasks -- even if the task was the panic task
or one of the active tasks?

And related to the above, the fatal error message above
prints either "panic" or "active".  How would it be possible
for the "panic" task to fail?  The exist_regs_in_elf_notes()
always returns TRUE for the panic task.

Dave


> 
> >
> > The change includes:
> >
> > 1) Add and export exist_regs_in_elf_notes(), and
> > 2) Merge two kinds of fatal information printed in the case where no
> > corresponding register values exist in ELF notes.
> >
> > defs.h | 1 +
> > netdump.c | 174
> > +++++++++++++++++++++++++++++--------------------------------
> > 2 files changed, 83 insertions(+), 92 deletions(-)
> >
> > Signed-off-by: HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com>
> >
> >
> > [Text
> > Documents:0004-Introduce-and-export-exist_regs_in_elf_notes.patch]
> >
> >
> > [Text
> > Documents:0003-Unify-error-check-conditions-and-information-printed.patch]
> >
> >
> > [Text
> > Documents:0002-Move-all-common-error-processings-in-get_arch_regs_f.patch]
> >
> >
> > [Text Documents:0001-Check-non-support-machine-check-first.patch]
> >
> > --
> > Crash-utility mailing list
> > Crash-utility at redhat.com
> > https://www.redhat.com/mailman/listinfo/crash-utility




More information about the Crash-utility mailing list