From: Wei Dai Date: Mon, 13 Mar 2017 08:59:27 +0000 (+0800) Subject: config: make backtrace optional X-Git-Tag: spdx-start~3285 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=4d8b986bfece500b343704dd1b508a98d9a96f3c config: make backtrace optional 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 Signed-off-by: Thomas Monjalon --- diff --git a/config/common_base b/config/common_base index 93e923507d..8907bea366 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 5fbc17c599..e1c7554826 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 +#endif #include #include #include @@ -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 5fbc17c599..e1c7554826 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 +#endif #include #include #include @@ -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 */