FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 02-01-2012, 05:13 AM
"Suzuki K. Poulose"
 
Default Support for compressed KDUMP

This patch introduces support for analysing compressed KDUMP
cores for PPC32.


Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
---

diskdump.c | 38 +++++++++++++++++++++++++++++++++++++-
ppc.c | 7 +++++++
2 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/diskdump.c b/diskdump.c
index 9f4b228..dc4baf3 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -367,6 +367,9 @@ restart:
else if (STRNEQ(header->utsname.machine, "ia64") &&
machine_type_mismatch(file, "IA64", NULL, 0))
goto err;
+ else if (STRNEQ(header->utsname.machine, "ppc") &&
+ machine_type_mismatch(file, "PPC", NULL, 0))
+ goto err;
else if (STRNEQ(header->utsname.machine, "ppc64") &&
machine_type_mismatch(file, "PPC64", NULL, 0))
goto err;
@@ -496,6 +499,8 @@ restart:
dd->machine_type = EM_X86_64;
else if (machine_type("IA64"))
dd->machine_type = EM_IA_64;
+ else if (machine_type("PPC"))
+ dd->machine_type = EM_PPC;
else if (machine_type("PPC64"))
dd->machine_type = EM_PPC64;
else if (machine_type("S390X"))
@@ -937,6 +942,31 @@ extern void get_netdump_regs_x86(struct bt_info *, ulong *, ulong *);
extern void get_netdump_regs_x86_64(struct bt_info *, ulong *, ulong *);

static void
+get_diskdump_regs_ppc(struct bt_info *bt, ulong *eip, ulong *esp)
+{
+ Elf32_Nhdr *note;
+ int len;
+
+ if (KDUMP_CMPRS_VALID() &&
+ (bt->task == tt->panic_task ||
+ (is_task_active(bt->task) && dd->num_prstatus_notes > 1))) {
+ note = (Elf32_Nhdr*) dd->nt_prstatus_percpu[bt->tc->processor];
+ if (!note)
+ error(FATAL,
+ "cannot determine NT_PRSTATUS ELF note "
+ "for %s task: %lx
",
+ (bt->task == tt->panic_task) ?
+ "panic" : "active", bt->task);
+ len = sizeof(Elf32_Nhdr);
+ len = roundup(len + note->n_namesz, 4);
+ bt->machdep = (void *)((char *)note + len +
+ MEMBER_OFFSET("elf_prstatus", "pr_reg"));
+ }
+
+ machdep->get_stack_frame(bt, eip, esp);
+}
+
+static void
get_diskdump_regs_ppc64(struct bt_info *bt, ulong *eip, ulong *esp)
{
if ((bt->task == tt->panic_task) && DISKDUMP_VALID())
@@ -977,6 +1007,10 @@ get_diskdump_regs(struct bt_info *bt, ulong *eip, ulong *esp)
machdep->get_stack_frame(bt, eip, esp);
break;

+ case EM_PPC:
+ return get_diskdump_regs_ppc(bt, eip, esp);
+ break;
+
case EM_PPC64:
return get_diskdump_regs_ppc64(bt, eip, esp);
break;
@@ -1142,7 +1176,7 @@ dump_nt_prstatus_offset(FILE *fp)
(tot == 0) ? "" : " ",
(ulong)(offset + tot));

- } else if (machine_type("X86")) {
+ } else if (machine_type("X86") || machine_type("PPC")) {
note32 = (void *)dd->notes_buf + tot;
len = sizeof(Elf32_Nhdr);
len = roundup(len + note32->n_namesz, 4);
@@ -1202,6 +1236,8 @@ __diskdump_memory_dump(FILE *fp)
fprintf(fp, "(EM_X86_64)
"); break;
case EM_IA_64:
fprintf(fp, "(EM_IA_64)
"); break;
+ case EM_PPC:
+ fprintf(fp, "(EM_PPC)
"); break;
case EM_PPC64:
fprintf(fp, "(EM_PPC64)
"); break;
case EM_S390:
diff --git a/ppc.c b/ppc.c
index 2a10fac..78c9178 100755
--- a/ppc.c
+++ b/ppc.c
@@ -67,6 +67,9 @@ static void ppc_display_machine_stats(void);
static void ppc_dump_line_number(ulong);
static struct line_number_hook ppc_line_number_hooks[];

+/* Defined in diskdump.c */
+extern void process_elf32_notes(void *, ulong);
+
/*
* Do all necessary machine-specific setup here. This is called twice,
* before and after GDB has been initialized.
@@ -79,6 +82,10 @@ ppc_init(int when)

switch (when)
{
+ case SETUP_ENV:
+ machdep->process_elf_notes = process_elf32_notes;
+ break;
+
case PRE_SYMTAB:
machdep->verify_symbol = ppc_verify_symbol;
if (pc->flags & KERNEL_DEBUG_QUERY)

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 08:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org