From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0B37A0C45; Fri, 30 Jul 2021 10:51:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80E57410F7; Fri, 30 Jul 2021 10:51:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 8554A40A4B for ; Fri, 30 Jul 2021 10:51:36 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16U8l3uC016213; Fri, 30 Jul 2021 01:51:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=HV8YtRqkQkYJBaG5jm/nZsc82eouVy8UZEc+FMu7DSU=; b=RxZM5ArildHQJEO1qgYUgCBUvSZmYQXocIZsmzEISvonii+lZo3EUESl9jOueU11JQ6Z yUNFcfCZzfrJIF0ArU+bvATyNiV5Ii9CUZBQNKAeEAtgMnRbgV6dCdATq66xam822odg oj3Jv7oUQY49CZ/NKzTwoPt/odo6FgpexuYNf+B09GQagoSIwX9Bs4S4st7Yji6z2A8Z i7Ocx/n9svWi/jmsnB1EgVbA0oYbroKuMcnAX9lShCRK7xwJUOWj0tLY9EA/V5//TAPp vpNgZRK4ysrJo1vj15q6FT1BR9VAOOaXMR0pPQxFmhFnBM0MwQtVt06ufU5Se/WWLbGn iw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3a456tskqp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 30 Jul 2021 01:51:33 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 30 Jul 2021 01:51:31 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 30 Jul 2021 01:51:31 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 4DCB13F705D; Fri, 30 Jul 2021 01:51:27 -0700 (PDT) From: To: CC: , , , , , , , , , , , Jerin Jacob Date: Fri, 30 Jul 2021 14:19:36 +0530 Message-ID: <20210730084938.2426128-5-jerinj@marvell.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210730084938.2426128-1-jerinj@marvell.com> References: <20210730084938.2426128-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: XHtOxR8dXSkQV1dm69nXSSWXx39V43NI X-Proofpoint-ORIG-GUID: XHtOxR8dXSkQV1dm69nXSSWXx39V43NI X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-30_05:2021-07-29, 2021-07-30 signatures=0 Subject: [dpdk-dev] 4/6] eal/x86: support register dump for oops X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Dump the x86 arch state register in oops handling routine. Signed-off-by: Jerin Jacob --- lib/eal/unix/eal_oops.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/eal/unix/eal_oops.c b/lib/eal/unix/eal_oops.c index 118b236f35..da71481ade 100644 --- a/lib/eal/unix/eal_oops.c +++ b/lib/eal/unix/eal_oops.c @@ -132,6 +132,38 @@ stack_code_dump(void *stack, void *code) mem32_dump(code); oops_print("\n"); } + +#if defined(RTE_ARCH_X86_64) && defined(RTE_EXEC_ENV_LINUX) +static void +archinfo_dump(ucontext_t *uc) +{ + + mcontext_t *mc = &uc->uc_mcontext; + + oops_print("R8 : 0x%.16llx ", mc->gregs[REG_R8]); + oops_print("R9 : 0x%.16llx\n", mc->gregs[REG_R9]); + oops_print("R10: 0x%.16llx ", mc->gregs[REG_R10]); + oops_print("R11: 0x%.16llx\n", mc->gregs[REG_R11]); + oops_print("R12: 0x%.16llx ", mc->gregs[REG_R12]); + oops_print("R13: 0x%.16llx\n", mc->gregs[REG_R13]); + oops_print("R14: 0x%.16llx ", mc->gregs[REG_R14]); + oops_print("R15: 0x%.16llx\n", mc->gregs[REG_R15]); + oops_print("RAX: 0x%.16llx ", mc->gregs[REG_RAX]); + oops_print("RBX: 0x%.16llx\n", mc->gregs[REG_RBX]); + oops_print("RCX: 0x%.16llx ", mc->gregs[REG_RCX]); + oops_print("RDX: 0x%.16llx\n", mc->gregs[REG_RDX]); + oops_print("RBP: 0x%.16llx ", mc->gregs[REG_RBP]); + oops_print("RSP: 0x%.16llx\n", mc->gregs[REG_RSP]); + oops_print("RSI: 0x%.16llx ", mc->gregs[REG_RSI]); + oops_print("RDI: 0x%.16llx\n", mc->gregs[REG_RDI]); + oops_print("RIP: 0x%.16llx ", mc->gregs[REG_RIP]); + oops_print("EFL: 0x%.16llx\n", mc->gregs[REG_EFL]); + + stack_code_dump((void *)mc->gregs[REG_RSP], (void *)mc->gregs[REG_RIP]); +} + +#else + static void archinfo_dump(ucontext_t *uc) { @@ -140,6 +172,8 @@ archinfo_dump(ucontext_t *uc) stack_code_dump(NULL, NULL); } +#endif + static void default_signal_handler_invoke(int sig) { -- 2.32.0