[Crash-utility] ppc: fix backtrace problem when NT_PRSTATUS was not saved

Dave Anderson anderson at redhat.com
Mon Jun 25 20:49:40 UTC 2012



----- Original Message -----
> (2012/06/23 0:36), Dave Anderson wrote:
> >
> >
> > ----- Original Message -----
>   
> > OK, doing it that way looks reasonable, and safely segregated to
> > PPC only.
> >
> > Just two more suggestions -- first, please do me a favor by running
> > "make warn" prior to posting a patch, and fix these:
> >
> >    $ make warn
> >    TARGET: X86_64
> >     CRASH: 6.0.8rc15
> >       GDB: 7.3.1
> >
> >    cc -c -g -DX86_64  -DGDB_7_3_1  build_data.c -Wall -O2
> >    -Wstrict-prototypes -Wmissing-prototypes -fstack-protector
> >    cc -c -g -DX86_64  -DGDB_7_3_1  ppc.c -Wall -O2
> >    -Wstrict-prototypes -Wmissing-prototypes -fstack-protector
> >    cc -c -g -DX86_64  -DGDB_7_3_1  netdump.c -Wall -O2
> >    -Wstrict-prototypes -Wmissing-prototypes -fstack-protector
> >    netdump.c: In function 'get_netdump_regs_ppc':
> >    netdump.c:2603: warning: pointer targets in passing argument 2
> >    of 'relocate_nt_prstatus_percpu_ppc' differ in signedness
> >    cc -c -g -DX86_64  -DGDB_7_3_1  diskdump.c -Wall -O2
> >    -Wstrict-prototypes -Wmissing-prototypes -fstack-protector
> >    diskdump.c:1061: warning: no previous prototype for
> >    ‘relocate_nt_prstatus_percpu_ppc’
> >    diskdump.c: In function 'get_diskdump_regs_ppc':
> >    diskdump.c:1103: warning: pointer targets in passing argument 2
> >    of 'relocate_nt_prstatus_percpu_ppc' differ in signedness
> >    ...
> 
> Thanks for your checking out. I shuold use unit * for argument 2.
>   
> > Secondly, since your new relocate_nt_prstatus_percpu_ppc() and
> > verify_crash_note_in_kernel_ppc() functions are used for both
> > kdump ELF and compressed kdump formats, and since they are
> > PPC-specific, can you just move the two functions into ppc.c?
> > All that should require is to #include elf.h.
> 
> Make sense.
> I move them into ppc.c, then function calls in diskdump.c and netdump.c
> are wrapped with "if defined (PPC)" so that those lines will be invalid when
> other arch is build (x86_64 build was no problem).
 
To avoid the somewhat-confusing "#if defined (PPC)" in the PPC-only 
get_diskdump_regs_ppc() and get_netdump_regs_ppc() functions, I made
ppc_relocate_nt_prstatus_cpu() a do-nothing #define in defs.h for
non-PPC arches like this:
  
  #ifdef PPC
  ...
  void ppc_relocate_nt_prstatus_percpu(void **, uint *);
  ...
  #else
  #define ppc_relocate_nt_prstatus_percpu(X,Y) do {} while (0)
  #endif

And I changed the WARNING message from:

  error(WARNING, "cpu#%d: not saved crash_notes\n", i);

to:

  error(WARNING, "cpu#%d: crash_notes not saved\n", i);

to make it a bit more understandable.

Queued for crash-6.0.8.

Thanks,
  Dave
  


 





More information about the Crash-utility mailing list