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 E0219A0C45; Fri, 30 Jul 2021 10:51:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 780744014D; Fri, 30 Jul 2021 10:51:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id F055A40040 for ; Fri, 30 Jul 2021 10:51:13 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16U8kEdu016326; Fri, 30 Jul 2021 01:51:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=FG53ujNXGOmt3zMDqlz+fJWwv++9ukwmhtsY3BY/ol8=; b=HDRRsjSqXqJmpFMWLjbIMhMAgjqIbHMF2hWn2kiL9Wn0L5rn6NXoblbXGBYNKJlIkqlA TUbI8emQF2BCd+51UUqLVF/5ksV1/iOuYrPCCw7erWNNY51rbORZzr8oEeJXSdG3ksIo ATtJnURL0BTTZKwl5lYh43KV4FZ1ywveBMPgoN8ZsZ6BGP+Dauck2+zMDxFVKia3qVy3 fph3Xq+LzgTxV+ly7ssOmmhve4m76RMEG7OUyNpLz6m8PoJ2LouyLDWDODZrsJG1zzgB t1ofDemuGvGKjyi4CNZVnn1iykdRlBbi1PBgFyObLT0NUO4JQxT7RHMjq3PFb+Fdupsl gA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3a4866sab6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 30 Jul 2021 01:51:10 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 30 Jul 2021 01:51:09 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 30 Jul 2021 01:51:09 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 0FD243F705D; Fri, 30 Jul 2021 01:51:04 -0700 (PDT) From: To: CC: , , , , , , , , , , , Jerin Jacob Date: Fri, 30 Jul 2021 14:19:32 +0530 Message-ID: <20210730084938.2426128-1-jerinj@marvell.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: x4jAT07xaPwiQEPeFbCaVATIQU778B9Y X-Proofpoint-ORIG-GUID: x4jAT07xaPwiQEPeFbCaVATIQU778B9Y 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] 0/6] support oops handling 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 It is handy to get detailed OOPS information like Linux kernel when DPDK application crashes without losing any of the features provided by coredump infrastructure by the OS. This patch series introduces the APIs to handle OOPS in DPDK. Following section details the implementation and API interface to application. On rte_eal_init() invocation, the EAL library installs the oops handler for the essential signals. The rte_oops_signals_enabled() API provides the list of signals the library installed by the EAL. The default EAL oops handler decodes the oops message using rte_oops_decode() and then calls the signal handler installed by the application before invoking the rte_eal_init(). This scheme will also enable the use of the default coredump handler(for gdb etc.) provided by OS if the application does not install any specific signal handler. The second case where the application installs the signal handler after the rte_eal_init() invocation, rte_oops_decode() provides the means of decoding the oops message in the application's fault handler. Patch split: Patch 1/6: defines the API and stub implementation for Unix systems Patch 2/6: The API implementation Patch 3/6: add an optional libunwind dependency to DPDK for better backtrace in oops. Patch 4/6: x86 specific archinfo like x86 register dump on oops Patch 5/6: arm64 specific archinfo like arm64 register dump on oops Patch 6/6: UT for the new APIs Example command for the build, run, and output logs of an x86-64 linux machine. meson --buildtype debug build ninja -C build echo "oops_autotest" | ./build/app/test/dpdk-test --no-huge -c 0x2 Signal info: ------------ PID: 2439496 Signal number: 11 Fault address: 0x5 Backtrace: ---------- [ 0x55e8b56d5cee]: test_oops_generate()+0x75 [ 0x55e8b5459843]: unit_test_suite_runner()+0x1aa [ 0x55e8b56d605c]: test_oops()+0x13 [ 0x55e8b544bdfc]: cmd_autotest_parsed()+0x55 [ 0x55e8b6063a0d]: cmdline_parse()+0x319 [ 0x55e8b6061dea]: cmdline_valid_buffer()+0x35 [ 0x55e8b6066bd8]: rdline_char_in()+0xc48 [ 0x55e8b606221c]: cmdline_in()+0x62 [ 0x55e8b6062495]: cmdline_interact()+0x56 [ 0x55e8b5459314]: main()+0x65e [ 0x7f54b25d2b25]: __libc_start_main()+0xd5 [ 0x55e8b544bc9e]: _start()+0x2e Arch info: ---------- R8 : 0x0000000000000000 R9 : 0x0000000000000000 R10: 0x00007f54b25b8b48 R11: 0x00007f54b25e7930 R12: 0x00007fffc695e610 R13: 0x0000000000000000 R14: 0x0000000000000000 R15: 0x0000000000000000 RAX: 0x0000000000000005 RBX: 0x0000000000000001 RCX: 0x00007f54b278a943 RDX: 0x3769043bf13a2594 RBP: 0x00007fffc6958340 RSP: 0x00007fffc6958330 RSI: 0x0000000000000000 RDI: 0x000055e8c4c1e380 RIP: 0x000055e8b56d5cee EFL: 0x0000000000010246 Stack dump: ---------- 0x7fffc6958330: 0x6000000 0x7fffc6958334: 0x0 0x7fffc6958338: 0x30cfeac5 0x7fffc695833c: 0x0 0x7fffc6958340: 0xe08395c6 0x7fffc6958344: 0xff7f0000 0x7fffc6958348: 0x439845b5 0x7fffc695834c: 0xe8550000 0x7fffc6958350: 0x0 0x7fffc6958354: 0xb000000 0x7fffc6958358: 0x20445bb9 0x7fffc695835c: 0xe8550000 0x7fffc6958360: 0x925506b6 0x7fffc6958364: 0x0 0x7fffc6958368: 0x0 0x7fffc695836c: 0x0 Code dump: ---------- 0x55e8b56d5cee: 0xc7000000 0x55e8b56d5cf2: 0xeb12 0x55e8b56d5cf6: 0xfb6054b 0x55e8b56d5cfa: 0x87540f84 0x55e8b56d5cfe: 0xc07407b8 0x55e8b56d5d02: 0x0 0x55e8b56d5d06: 0xeb05b8ff 0x55e8b56d5d0a: 0xffffffc9 0x55e8b56d5d0e: 0xc3554889 0x55e8b56d5d12: 0xe54881ec 0x55e8b56d5d16: 0xc0000000 0x55e8b56d5d1a: 0x89bd4cff 0x55e8b56d5d1e: 0xffff4889 0x55e8b56d5d22: 0xb540ffff Jerin Jacob (6): eal: introduce oops handling API eal: oops handling API implementation eal: support libunwind based backtrace eal/x86: support register dump for oops eal/arm64: support register dump for oops test/oops: support unit test case for oops handling APIs .github/workflows/build.yml | 2 +- .travis.yml | 2 +- app/test/meson.build | 2 + app/test/test_oops.c | 121 ++++++++++++++ config/meson.build | 8 + doc/api/doxy-api-index.md | 3 +- lib/eal/common/eal_private.h | 3 + lib/eal/freebsd/eal.c | 6 + lib/eal/include/meson.build | 1 + lib/eal/include/rte_oops.h | 100 ++++++++++++ lib/eal/linux/eal.c | 6 + lib/eal/unix/eal_oops.c | 297 +++++++++++++++++++++++++++++++++++ lib/eal/unix/meson.build | 1 + lib/eal/version.map | 4 + 14 files changed, 553 insertions(+), 3 deletions(-) create mode 100644 app/test/test_oops.c create mode 100644 lib/eal/include/rte_oops.h create mode 100644 lib/eal/unix/eal_oops.c -- 2.32.0