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 11-16-2010, 12:52 AM
Mahesh J Salgaonkar
 
Default Crash-Utility: Add support for s390x diskdump

This patch adds support for reading diskdumps (generated by makedumpfile) for
s390x architecture.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
---
diskdump.c | 12 ++++++++++++
s390x.c | 22 ++++++++++++++++++++++
2 files changed, 34 insertions(+)

Index: crash-5.0.9/diskdump.c
================================================== =================
--- crash-5.0.9.orig/diskdump.c
+++ crash-5.0.9/diskdump.c
@@ -253,6 +253,9 @@ restart:
else if (STRNEQ(header->utsname.machine, "arm") &&
machine_type_mismatch(file, "ARM", NULL, 0))
goto err;
+ else if (STRNEQ(header->utsname.machine, "s390x") &&
+ machine_type_mismatch(file, "S390X", NULL, 0))
+ goto err;

if (header->block_size != block_size) {
block_size = header->block_size;
@@ -349,6 +352,10 @@ restart:
dd->machine_type = EM_IA_64;
else if (machine_type("PPC64"))
dd->machine_type = EM_PPC64;
+ else if (machine_type("S390"))
+ dd->machine_type = EM_S390;
+ else if (machine_type("S390X"))
+ dd->machine_type = EM_S390;
else {
error(INFO, "%s: unsupported machine type: %s
",
DISKDUMP_VALID() ? "diskdump" : "compressed kdump",
@@ -778,6 +785,9 @@ get_diskdump_regs(struct bt_info *bt, ul
case EM_X86_64:
return get_netdump_regs_x86_64(bt, eip, esp);
break;
+ case EM_S390:
+ return machdep->get_stack_frame(bt, eip, esp);
+ break;

default:
error(FATAL, "%s: unsupported machine type: %s
",
@@ -893,6 +903,8 @@ __diskdump_memory_dump(FILE *fp)
fprintf(fp, "(EM_IA_64)
"); break;
case EM_PPC64:
fprintf(fp, "(EM_PPC64)
"); break;
+ case EM_S390:
+ fprintf(fp, "(EM_S390)
"); break;
default:
fprintf(fp, "(unknown)
"); break;
}
Index: crash-5.0.9/s390x.c
================================================== =================
--- crash-5.0.9.orig/s390x.c
+++ crash-5.0.9/s390x.c
@@ -272,6 +272,26 @@ static void s390x_elf_note_add(int elf_c
}
}

+static void s390x_process_elf_notes(void *note_ptr, unsigned long size_note)
+{
+ Elf64_Nhdr *note = NULL;
+ size_t tot, len;
+ static int num_prstatus_notes = 0;
+
+ for (tot = 0; tot < size_note; tot += len) {
+ note = note_ptr + tot;
+
+ if (note->n_type == NT_PRSTATUS)
+ num_prstatus_notes++;
+
+ machdep->dumpfile_init(num_prstatus_notes, note);
+
+ len = sizeof(Elf64_Nhdr);
+ len = roundup(len + note->n_namesz, 4);
+ len = roundup(len + note->n_descsz, 4);
+ }
+}
+
/*
* Do all necessary machine-specific setup here. This is called several
* times during initialization.
@@ -283,6 +303,7 @@ s390x_init(int when)
{
case SETUP_ENV:
machdep->dumpfile_init = s390x_elf_note_add;
+ machdep->process_elf_notes = s390x_process_elf_notes;
break;
case PRE_SYMTAB:
machdep->verify_symbol = s390x_verify_symbol;
@@ -399,6 +420,7 @@ s390x_dump_machdep_table(ulong arg)
fprintf(fp, " init_kernel_pgd: NULL
");
fprintf(fp, " value_to_symbol: generic_machdep_value_to_symbol()
");
fprintf(fp, " dumpfile_init: s390x_elf_note_add()
");
+ fprintf(fp, " process_elf_notes: s390x_process_elf_notes()
");
fprintf(fp, " line_number_hooks: s390x_line_number_hooks
");
fprintf(fp, " last_pgd_read: %lx
", machdep->last_pgd_read);
fprintf(fp, " last_pmd_read: %lx
", machdep->last_pmd_read);

--
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 11:46 AM.

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