Thread (45 messages) 45 messages, 5 authors, 2022-01-28

[dpdk-dev] [PATCH v3 5/6] eal/arm64: support register dump for oops

From: <hidden>
Date: 2021-09-06 04:20:13
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

From: Jerin Jacob <redacted>

Dump the arm64 arch state register in oops
handling routine.

Signed-off-by: Jerin Jacob <redacted>
---
 lib/eal/unix/eal_oops.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff --git a/lib/eal/unix/eal_oops.c b/lib/eal/unix/eal_oops.c
index a9c22cbe70..6793497bee 100644
--- a/lib/eal/unix/eal_oops.c
+++ b/lib/eal/unix/eal_oops.c
@@ -161,6 +161,25 @@ archinfo_dump(ucontext_t *uc)
 	stack_code_dump((void *)mc->gregs[REG_RSP], (void *)mc->gregs[REG_RIP]);
 }
 
+#elif defined(RTE_ARCH_ARM64) && defined(RTE_EXEC_ENV_LINUX)
+
+static void
+archinfo_dump(ucontext_t *uc)
+{
+	mcontext_t *mc = &uc->uc_mcontext;
+	int i;
+
+	oops_print("PC : 0x%.16llx ", mc->pc);
+	oops_print("SP : 0x%.16llx\n", mc->sp);
+	for (i = 0; i < 31; i++)
+		oops_print("X%.2d: 0x%.16llx%s", i, mc->regs[i],
+			   i & 0x1 ? "\n" : " ");
+
+	oops_print("PSTATE: 0x%.16llx\n", mc->pstate);
+
+	stack_code_dump((void *)mc->sp, (void *)mc->pc);
+}
+
 #else
 
 static void
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help