DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Wei Dai <wei.dai@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 2/2] config: make backtrace optional
Date: Fri,  5 May 2017 15:18:27 +0200	[thread overview]
Message-ID: <20170505131827.25599-3-thomas@monjalon.net> (raw)
In-Reply-To: <20170505131827.25599-1-thomas@monjalon.net>

From: Wei Dai <wei.dai@intel.com>

When building DPDK with musl, there is need not to disable
backtrace to remove some references to execinfo.h which is
not supported by musl now.
This also applies to some other libc implementation which
doesn't support backtrace() and backtrace_symbols().

musl is an implementation of the userspace portion
of the standard library functionality described in
the ISO C and POSIX standards, plus common extensions.
Got more details about musl from http://www.musl-libc.org .

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 config/common_base                      | 1 +
 lib/librte_eal/bsdapp/eal/eal_debug.c   | 4 ++++
 lib/librte_eal/linuxapp/eal/eal_debug.c | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/config/common_base b/config/common_base
index 93e923507..8907bea36 100644
--- a/config/common_base
+++ b/config/common_base
@@ -96,6 +96,7 @@ CONFIG_RTE_MAX_TAILQ=32
 CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_HISTORY=256
+CONFIG_RTE_BACKTRACE=y
 CONFIG_RTE_LIBEAL_USE_HPET=n
 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
diff --git a/lib/librte_eal/bsdapp/eal/eal_debug.c b/lib/librte_eal/bsdapp/eal/eal_debug.c
index 5fbc17c59..e1c755482 100644
--- a/lib/librte_eal/bsdapp/eal/eal_debug.c
+++ b/lib/librte_eal/bsdapp/eal/eal_debug.c
@@ -31,7 +31,9 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef RTE_BACKTRACE
 #include <execinfo.h>
+#endif
 #include <stdarg.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -47,6 +49,7 @@
 /* dump the stack of the calling core */
 void rte_dump_stack(void)
 {
+#ifdef RTE_BACKTRACE
 	void *func[BACKTRACE_SIZE];
 	char **symb = NULL;
 	int size;
@@ -64,6 +67,7 @@ void rte_dump_stack(void)
 	}
 
 	free(symb);
+#endif /* RTE_BACKTRACE */
 }
 
 /* not implemented in this environment */
diff --git a/lib/librte_eal/linuxapp/eal/eal_debug.c b/lib/librte_eal/linuxapp/eal/eal_debug.c
index 5fbc17c59..e1c755482 100644
--- a/lib/librte_eal/linuxapp/eal/eal_debug.c
+++ b/lib/librte_eal/linuxapp/eal/eal_debug.c
@@ -31,7 +31,9 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef RTE_BACKTRACE
 #include <execinfo.h>
+#endif
 #include <stdarg.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -47,6 +49,7 @@
 /* dump the stack of the calling core */
 void rte_dump_stack(void)
 {
+#ifdef RTE_BACKTRACE
 	void *func[BACKTRACE_SIZE];
 	char **symb = NULL;
 	int size;
@@ -64,6 +67,7 @@ void rte_dump_stack(void)
 	}
 
 	free(symb);
+#endif /* RTE_BACKTRACE */
 }
 
 /* not implemented in this environment */
-- 
2.12.2

  parent reply	other threads:[~2017-05-05 13:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13  8:59 [dpdk-dev] [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
2017-03-13  8:59 ` [dpdk-dev] [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
2017-03-15  8:39   ` Jan Blunck
2017-03-13  8:59 ` [dpdk-dev] [PATCH v2 2/3] config: add a marco to enable backtrace or not Wei Dai
2017-03-13  8:59 ` [dpdk-dev] [PATCH v2 3/3] eal: remove references to execinfo.h for musl Wei Dai
2017-05-05  1:30 ` [dpdk-dev] [PATCH v2 0/3] add a macro to enable support of backtrace Dai, Wei
2017-05-05 13:18 ` [dpdk-dev] [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
2017-05-05 13:18   ` [dpdk-dev] [PATCH v3 1/2] examples/performance-thread: remove useless include Thomas Monjalon
2017-05-05 13:18   ` Thomas Monjalon [this message]
2017-05-05 13:21   ` [dpdk-dev] [PATCH v3 0/2] add a macro to disable support of backtrace Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170505131827.25599-3-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=wei.dai@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).