Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2203/?format=api
https://patches.dpdk.org/api/patches/2203/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1420565213-17429-1-git-send-email-rkerur@gmail.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1420565213-17429-1-git-send-email-rkerur@gmail.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1420565213-17429-1-git-send-email-rkerur@gmail.com", "date": "2015-01-06T17:26:47", "name": "[dpdk-dev,v4,1/7] Move common functions in eal_debug.c", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "e12e94a43edb4611b349f70a0932b35e1bd70798", "submitter": { "id": 134, "url": "https://patches.dpdk.org/api/people/134/?format=api", "name": "Ravi Kerur", "email": "rkerur@gmail.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1420565213-17429-1-git-send-email-rkerur@gmail.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/2203/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/2203/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 0504B5938;\n\tTue, 6 Jan 2015 18:27:19 +0100 (CET)", "from mail-pd0-f181.google.com (mail-pd0-f181.google.com\n\t[209.85.192.181]) by dpdk.org (Postfix) with ESMTP id 9F3C0590C\n\tfor <dev@dpdk.org>; Tue, 6 Jan 2015 18:27:15 +0100 (CET)", "by mail-pd0-f181.google.com with SMTP id v10so30359889pde.26\n\tfor <dev@dpdk.org>; Tue, 06 Jan 2015 09:27:14 -0800 (PST)", "from iaas-l305162.englab.brocade.com ([144.49.130.148])\n\tby mx.google.com with ESMTPSA id\n\tnl14sm46887340pdb.81.2015.01.06.09.27.14\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 06 Jan 2015 09:27:14 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=LQKr62UHDN5tJ34ptQ4eLxuars3co64yWhVy3u5SZ5Y=;\n\tb=mZ5u+mCsaQkG027NU2w2pr1tVP9AM84UXy+Ywez1h6PG2VbjSv+xkNN9WrEQqZSAxt\n\tRh/qeLJn/XiKSjTX1nn2lFLCiZe9BAaIowMOZQkQ2jxzaFlkkiR1og0uPubMicGxOpBz\n\tB6ah9KjjIL8X++ptwQz2z01IzXeTGWBafNvZNALRC1nUmqnqlurG95+utHPFeU1U1nVR\n\tH9gigvm8Gicrby3z49B6kJ/2IHnUOZl/cxPB7avmN6Plh3TADqj5puwfP6xostHA7BUt\n\ttLaxffnz1sYizcnOMJfUN7HmvGa3Zls7Dpc3DXVzcrUnBT9qk3HN5vIuZoDAqAWtogSz\n\t+1qA==", "X-Received": "by 10.68.100.33 with SMTP id ev1mr79792772pbb.13.1420565234892; \n\tTue, 06 Jan 2015 09:27:14 -0800 (PST)", "From": "Ravi Kerur <rkerur@gmail.com>", "To": "dev@dpdk.org", "Date": "Tue, 6 Jan 2015 12:26:47 -0500", "Message-Id": "<1420565213-17429-1-git-send-email-rkerur@gmail.com>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1420565170-17365-1-git-send-email-rkerur@gmail.com>", "References": "<1420565170-17365-1-git-send-email-rkerur@gmail.com>", "Subject": "[dpdk-dev] [PATCH v4 1/7] Move common functions in eal_debug.c", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Changes in v4\nNone\n\nChanges in v3\nChanged subject to be more explicit on file name inclusion.\n\nChanges in v2\nRemove rte_dump_registers() function since it is not implemented.\nFix comment for _rte_exit()\n\nChanges in v1\neal_debug.c has no difference between Linux and BSD, move\nentire file into common directory.\nRename eal_debug.c to eal_common_debug.c\nMakefile changes to reflect file move and name change.\nFix checkpatch warnings.\n\nSigned-off-by: Ravi Kerur <rkerur@gmail.com>\n---\n app/test/test_debug.c | 1 -\n lib/librte_eal/bsdapp/eal/Makefile | 2 +-\n lib/librte_eal/bsdapp/eal/eal_debug.c | 113 ------------------------------\n lib/librte_eal/common/eal_common_debug.c | 106 ++++++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_debug.h | 7 --\n lib/librte_eal/linuxapp/eal/Makefile | 2 +-\n lib/librte_eal/linuxapp/eal/eal_debug.c | 113 ------------------------------\n 7 files changed, 108 insertions(+), 236 deletions(-)\n delete mode 100644 lib/librte_eal/bsdapp/eal/eal_debug.c\n create mode 100644 lib/librte_eal/common/eal_common_debug.c\n delete mode 100644 lib/librte_eal/linuxapp/eal/eal_debug.c", "diff": "diff --git a/app/test/test_debug.c b/app/test/test_debug.c\nindex 7c3ee92..01d4b76 100644\n--- a/app/test/test_debug.c\n+++ b/app/test/test_debug.c\n@@ -136,7 +136,6 @@ static int\n test_debug(void)\n {\n \trte_dump_stack();\n-\trte_dump_registers();\n \tif (test_panic() < 0)\n \t\treturn -1;\n \tif (test_exit() < 0)\ndiff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile\nindex d434882..9b83e11 100644\n--- a/lib/librte_eal/bsdapp/eal/Makefile\n+++ b/lib/librte_eal/bsdapp/eal/Makefile\n@@ -53,7 +53,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_hugepage_info.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_thread.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_log.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_pci.c\n-SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_debug.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_lcore.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_timer.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_interrupts.c\n@@ -73,6 +72,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_hexdump.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_devargs.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_dev.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_options.c\n+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_debug.c\n \n CFLAGS_eal.o := -D_GNU_SOURCE\n #CFLAGS_eal_thread.o := -D_GNU_SOURCE\ndiff --git a/lib/librte_eal/bsdapp/eal/eal_debug.c b/lib/librte_eal/bsdapp/eal/eal_debug.c\ndeleted file mode 100644\nindex 44fc4f3..0000000\n--- a/lib/librte_eal/bsdapp/eal/eal_debug.c\n+++ /dev/null\n@@ -1,113 +0,0 @@\n-/*-\n- * BSD LICENSE\n- *\n- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n- * All rights reserved.\n- *\n- * Redistribution and use in source and binary forms, with or without\n- * modification, are permitted provided that the following conditions\n- * are met:\n- *\n- * * Redistributions of source code must retain the above copyright\n- * notice, this list of conditions and the following disclaimer.\n- * * Redistributions in binary form must reproduce the above copyright\n- * notice, this list of conditions and the following disclaimer in\n- * the documentation and/or other materials provided with the\n- * distribution.\n- * * Neither the name of Intel Corporation nor the names of its\n- * contributors may be used to endorse or promote products derived\n- * from this software without specific prior written permission.\n- *\n- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#include <execinfo.h>\n-#include <stdarg.h>\n-#include <signal.h>\n-#include <stdlib.h>\n-#include <stdio.h>\n-#include <stdint.h>\n-\n-#include <rte_log.h>\n-#include <rte_debug.h>\n-#include <rte_common.h>\n-\n-#define BACKTRACE_SIZE 256\n-\n-/* dump the stack of the calling core */\n-void rte_dump_stack(void)\n-{\n-\tvoid *func[BACKTRACE_SIZE];\n-\tchar **symb = NULL;\n-\tint size;\n-\n-\tsize = backtrace(func, BACKTRACE_SIZE);\n-\tsymb = backtrace_symbols(func, size);\n-\twhile (size > 0) {\n-\t\trte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,\n-\t\t\t\"%d: [%s]\\n\", size, symb[size - 1]);\n-\t\tsize --;\n-\t}\n-}\n-\n-/* not implemented in this environment */\n-void rte_dump_registers(void)\n-{\n-\treturn;\n-}\n-\n-/* call abort(), it will generate a coredump if enabled */\n-void __rte_panic(const char *funcname, const char *format, ...)\n-{\n-\tva_list ap;\n-\n-\t/* disable history */\n-\trte_log_set_history(0);\n-\n-\trte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, \"PANIC in %s():\\n\", funcname);\n-\tva_start(ap, format);\n-\trte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);\n-\tva_end(ap);\n-\trte_dump_stack();\n-\trte_dump_registers();\n-\tabort();\n-}\n-\n-/*\n- * Like rte_panic this terminates the application. However, no traceback is\n- * provided and no core-dump is generated.\n- */\n-void\n-rte_exit(int exit_code, const char *format, ...)\n-{\n-\tva_list ap;\n-\n-\t/* disable history */\n-\trte_log_set_history(0);\n-\n-\tif (exit_code != 0)\n-\t\tRTE_LOG(CRIT, EAL, \"Error - exiting with code: %d\\n\"\n-\t\t\t\t\" Cause: \", exit_code);\n-\n-\tva_start(ap, format);\n-\trte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);\n-\tva_end(ap);\n-\n-#ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR\n-\texit(exit_code);\n-#else\n-\trte_dump_stack();\n-\trte_dump_registers();\n-\tabort();\n-#endif\n-}\ndiff --git a/lib/librte_eal/common/eal_common_debug.c b/lib/librte_eal/common/eal_common_debug.c\nnew file mode 100644\nindex 0000000..9c10ee4\n--- /dev/null\n+++ b/lib/librte_eal/common/eal_common_debug.c\n@@ -0,0 +1,106 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of Intel Corporation nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <execinfo.h>\n+#include <stdarg.h>\n+#include <signal.h>\n+#include <stdlib.h>\n+#include <stdio.h>\n+#include <stdint.h>\n+\n+#include <rte_log.h>\n+#include <rte_debug.h>\n+#include <rte_common.h>\n+\n+#define BACKTRACE_SIZE 256\n+\n+/* dump the stack of the calling core */\n+void rte_dump_stack(void)\n+{\n+\tvoid *func[BACKTRACE_SIZE];\n+\tchar **symb = NULL;\n+\tint size;\n+\n+\tsize = backtrace(func, BACKTRACE_SIZE);\n+\tsymb = backtrace_symbols(func, size);\n+\twhile (size > 0) {\n+\t\trte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,\n+\t\t\t\"%d: [%s]\\n\", size, symb[size - 1]);\n+\t\tsize--;\n+\t}\n+}\n+\n+/* call abort(), it will generate a coredump if enabled */\n+void __rte_panic(const char *funcname, const char *format, ...)\n+{\n+\tva_list ap;\n+\n+\t/* disable history */\n+\trte_log_set_history(0);\n+\n+\trte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, \"PANIC in %s():\\n\", funcname);\n+\tva_start(ap, format);\n+\trte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);\n+\tva_end(ap);\n+\trte_dump_stack();\n+\tabort();\n+}\n+\n+/*\n+ * Like rte_panic this terminates the application. However, no traceback is\n+ * provided and no core-dump is generated. if RTE_EAL_ALWAYS_PANIC_ON_ERROR\n+ * is not defined.\n+ */\n+void\n+rte_exit(int exit_code, const char *format, ...)\n+{\n+\tva_list ap;\n+\n+\t/* disable history */\n+\trte_log_set_history(0);\n+\n+\tif (exit_code != 0)\n+\t\tRTE_LOG(CRIT, EAL, \"Error - exiting with code: %d\\n\"\n+\t\t\t\t\" Cause: \", exit_code);\n+\n+\tva_start(ap, format);\n+\trte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);\n+\tva_end(ap);\n+\n+#ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR\n+\texit(exit_code);\n+#else\n+\trte_dump_stack();\n+\tabort();\n+#endif\n+}\ndiff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h\nindex 82ee3b3..3fb0307 100644\n--- a/lib/librte_eal/common/include/rte_debug.h\n+++ b/lib/librte_eal/common/include/rte_debug.h\n@@ -53,13 +53,6 @@ extern \"C\" {\n void rte_dump_stack(void);\n \n /**\n- * Dump the registers of the calling core to the console.\n- *\n- * Note: Not implemented in a userapp environment; use gdb instead.\n- */\n-void rte_dump_registers(void);\n-\n-/**\n * Provide notification of a critical non-recoverable error and terminate\n * execution abnormally.\n *\ndiff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile\nindex 72ecf3a..87b9bfc 100644\n--- a/lib/librte_eal/linuxapp/eal/Makefile\n+++ b/lib/librte_eal/linuxapp/eal/Makefile\n@@ -62,7 +62,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_uio.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_vfio.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_pci_vfio_mp_sync.c\n-SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_debug.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_lcore.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_timer.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_interrupts.c\n@@ -85,6 +84,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_hexdump.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_devargs.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_dev.c\n SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_options.c\n+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_debug.c\n \n CFLAGS_eal.o := -D_GNU_SOURCE\n CFLAGS_eal_thread.o := -D_GNU_SOURCE\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_debug.c b/lib/librte_eal/linuxapp/eal/eal_debug.c\ndeleted file mode 100644\nindex 44fc4f3..0000000\n--- a/lib/librte_eal/linuxapp/eal/eal_debug.c\n+++ /dev/null\n@@ -1,113 +0,0 @@\n-/*-\n- * BSD LICENSE\n- *\n- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n- * All rights reserved.\n- *\n- * Redistribution and use in source and binary forms, with or without\n- * modification, are permitted provided that the following conditions\n- * are met:\n- *\n- * * Redistributions of source code must retain the above copyright\n- * notice, this list of conditions and the following disclaimer.\n- * * Redistributions in binary form must reproduce the above copyright\n- * notice, this list of conditions and the following disclaimer in\n- * the documentation and/or other materials provided with the\n- * distribution.\n- * * Neither the name of Intel Corporation nor the names of its\n- * contributors may be used to endorse or promote products derived\n- * from this software without specific prior written permission.\n- *\n- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n- */\n-\n-#include <execinfo.h>\n-#include <stdarg.h>\n-#include <signal.h>\n-#include <stdlib.h>\n-#include <stdio.h>\n-#include <stdint.h>\n-\n-#include <rte_log.h>\n-#include <rte_debug.h>\n-#include <rte_common.h>\n-\n-#define BACKTRACE_SIZE 256\n-\n-/* dump the stack of the calling core */\n-void rte_dump_stack(void)\n-{\n-\tvoid *func[BACKTRACE_SIZE];\n-\tchar **symb = NULL;\n-\tint size;\n-\n-\tsize = backtrace(func, BACKTRACE_SIZE);\n-\tsymb = backtrace_symbols(func, size);\n-\twhile (size > 0) {\n-\t\trte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,\n-\t\t\t\"%d: [%s]\\n\", size, symb[size - 1]);\n-\t\tsize --;\n-\t}\n-}\n-\n-/* not implemented in this environment */\n-void rte_dump_registers(void)\n-{\n-\treturn;\n-}\n-\n-/* call abort(), it will generate a coredump if enabled */\n-void __rte_panic(const char *funcname, const char *format, ...)\n-{\n-\tva_list ap;\n-\n-\t/* disable history */\n-\trte_log_set_history(0);\n-\n-\trte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, \"PANIC in %s():\\n\", funcname);\n-\tva_start(ap, format);\n-\trte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);\n-\tva_end(ap);\n-\trte_dump_stack();\n-\trte_dump_registers();\n-\tabort();\n-}\n-\n-/*\n- * Like rte_panic this terminates the application. However, no traceback is\n- * provided and no core-dump is generated.\n- */\n-void\n-rte_exit(int exit_code, const char *format, ...)\n-{\n-\tva_list ap;\n-\n-\t/* disable history */\n-\trte_log_set_history(0);\n-\n-\tif (exit_code != 0)\n-\t\tRTE_LOG(CRIT, EAL, \"Error - exiting with code: %d\\n\"\n-\t\t\t\t\" Cause: \", exit_code);\n-\n-\tva_start(ap, format);\n-\trte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap);\n-\tva_end(ap);\n-\n-#ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR\n-\texit(exit_code);\n-#else\n-\trte_dump_stack();\n-\trte_dump_registers();\n-\tabort();\n-#endif\n-}\n", "prefixes": [ "dpdk-dev", "v4", "1/7" ] }{ "id": 2203, "url": "