[Crash-utility] ARM panic registers

Mika Westerberg mika.westerberg at iki.fi
Tue Sep 20 18:32:51 UTC 2011


On Tue, Sep 20, 2011 at 10:41:51AM -0400, Dave Anderson wrote:
> > 
> > static void
> > get_netdump_regs_arm(struct bt_info *bt, ulong *eip, ulong *esp)
> > {
> > 	machdep->get_stack_frame(bt, eip, esp);
> > }
> > 
> > If we're not going to use the ELF notes, why fail if they're not
> > there?
> 
> I'm not sure what you mean about reading "directly from within the 
> PT_LOAD segments",  but I agree with you that the preliminary "if" 
> section of get_netdump_regs_arm() which sets bt->machdep is a 
> no-op -- given that arm_get_dumpfile_stack_frame() just ignores
> it, and resets bt->machdep from that ARM-specific ms->crash_task_regs
> area.
> 
> Mika, you agree?

Absolutely - we already have similar for diskdump:

static void
get_diskdump_regs_arm(struct bt_info *bt, ulong *eip, ulong *esp)
{
	machdep->get_stack_frame(bt, eip, esp);
}

I tested Per's suggestion on my few kdump/netdump vmcores and it works well.

If you prefer to have a patch for this change, it is included below (all credits goes
to Per).

diff --git a/netdump.c b/netdump.c
index 1e9960c..a194364 100644
--- a/netdump.c
+++ b/netdump.c
@@ -2580,34 +2580,6 @@ get_netdump_regs_ppc64(struct bt_info *bt, ulong *eip, ulong *esp)
 static void
 get_netdump_regs_arm(struct bt_info *bt, ulong *eip, ulong *esp)
 {
-	Elf64_Nhdr *note;
-	size_t len;
-
-	if ((bt->task == tt->panic_task) ||
-		(is_task_active(bt->task) && nd->num_prstatus_notes > 1)) {
-		/*
-		 * Registers are saved during the dump process for the
-		 * panic task. Whereas in kdump, regs are captured for all
-		 * CPUs if they responded to an IPI.
-		 */
-                if (nd->num_prstatus_notes > 1) {
-			if (!nd->nt_prstatus_percpu[bt->tc->processor])
-				error(FATAL,
-				      "cannot determine NT_PRSTATUS ELF note "
-				      "for %s task: %lx\n",
-				       (bt->task == tt->panic_task) ?
-				       "panic" : "active", bt->task);
-                        note = (Elf64_Nhdr *)
-                                nd->nt_prstatus_percpu[bt->tc->processor];
-		} else
-			note = (Elf64_Nhdr *)nd->nt_prstatus;
-
-		len = sizeof(Elf64_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);
 }
 




More information about the Crash-utility mailing list