All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] add a macro to enable support of backtrace
@ 2017-03-13  8:59 Wei Dai
  2017-03-13  8:59 ` [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Wei Dai @ 2017-03-13  8:59 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, john.mcnamara, david.marchand, raymond.tan, Wei Dai

Some LIBC implementation like musl doesn't support backtrace( )
and backtrace_symbols declared in execinfo.h.
Currently some DPDK customers fail to build PDDK with musl.
In order to build DPDK with musl, there is a need to
reomve references toexecinfo.h.

Add a configuration parameter in config/common_linuxapp which equals to y 
by default. It also generate a macro named as RTE_EAL_ENABLE_BACKTRACE when 
this configuration paramter equals to y or no above macro when it is n.

---
changes:
v2 -- change configuration parameter name


Wei Dai (3):
  examples/performance-thread: remove reference to execinfo.h
  config: add a marco to enable backtrace or not
  eal: remove references to execinfo.h for musl

 config/common_linuxapp                           | 1 +
 examples/performance-thread/common/lthread_tls.c | 1 -
 lib/librte_eal/linuxapp/eal/eal_debug.c          | 4 ++++
 3 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h
  2017-03-13  8:59 [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
@ 2017-03-13  8:59 ` Wei Dai
  2017-03-15  8:39   ` Jan Blunck
  2017-03-13  8:59 ` [PATCH v2 2/3] config: add a marco to enable backtrace or not Wei Dai
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Wei Dai @ 2017-03-13  8:59 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, john.mcnamara, david.marchand, raymond.tan, Wei Dai

There is no function to refer any part of execinfo.h, so remove the
reference to it. And there is no this file in musl. So need to
remove it to support musl.

The musl is an alternative LIBC to GLIBC and provides the
standard C/POSIX library and extensions.
The musl can be got from http://www.musl-libc.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 examples/performance-thread/common/lthread_tls.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/examples/performance-thread/common/lthread_tls.c b/examples/performance-thread/common/lthread_tls.c
index 6876f83..47505f2 100644
--- a/examples/performance-thread/common/lthread_tls.c
+++ b/examples/performance-thread/common/lthread_tls.c
@@ -42,7 +42,6 @@
 #include <fcntl.h>
 #include <sys/time.h>
 #include <sys/mman.h>
-#include <execinfo.h>
 #include <sched.h>
 
 #include <rte_malloc.h>
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/3] config: add a marco to enable backtrace or not
  2017-03-13  8:59 [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
  2017-03-13  8:59 ` [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
@ 2017-03-13  8:59 ` Wei Dai
  2017-03-13  8:59 ` [PATCH v2 3/3] eal: remove references to execinfo.h for musl Wei Dai
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Wei Dai @ 2017-03-13  8:59 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, john.mcnamara, david.marchand, raymond.tan, Wei Dai

When building DPDK with musl, there is need not to generate
the MACRO named RTE_EAL_ENABLE_BACKTRACE in rte_config.h 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( ).

Got more details about musl from http://www.musl-libc.org .

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 config/common_linuxapp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/common_linuxapp b/config/common_linuxapp
index 00ebaac..16e0064 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -37,6 +37,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
+CONFIG_RTE_EAL_ENABLE_BACKTRACE=y
 CONFIG_RTE_KNI_KMOD=y
 CONFIG_RTE_LIBRTE_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/3] eal: remove references to execinfo.h for musl
  2017-03-13  8:59 [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
  2017-03-13  8:59 ` [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
  2017-03-13  8:59 ` [PATCH v2 2/3] config: add a marco to enable backtrace or not Wei Dai
@ 2017-03-13  8:59 ` Wei Dai
  2017-05-05  1:30 ` [PATCH v2 0/3] add a macro to enable support of backtrace Dai, Wei
  2017-05-05 13:18 ` [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
  4 siblings, 0 replies; 10+ messages in thread
From: Wei Dai @ 2017-03-13  8:59 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, john.mcnamara, david.marchand, raymond.tan, Wei Dai

execinfo.h is not supported by musl now.
need to remove references to execinfo.h to
build DPDK with musl.

musl is an implementation of the userspace portion
of the standard library functionality described in
the ISO C and POSIX standards, plus common extensions.

Get more details about musl from
http://www.musl-libc.org

This also aplies to some other LIBC implementation which
doesn't support backtrace( ) and backtrace_symbols( ).

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_debug.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/eal_debug.c b/lib/librte_eal/linuxapp/eal/eal_debug.c
index 5fbc17c..3a9aee9 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_EAL_ENABLE_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_EAL_ENABLE_BACKTRACE
 	void *func[BACKTRACE_SIZE];
 	char **symb = NULL;
 	int size;
@@ -64,6 +67,7 @@ void rte_dump_stack(void)
 	}
 
 	free(symb);
+#endif
 }
 
 /* not implemented in this environment */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h
  2017-03-13  8:59 ` [PATCH v2 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
@ 2017-03-15  8:39   ` Jan Blunck
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Blunck @ 2017-03-15  8:39 UTC (permalink / raw)
  To: Wei Dai
  Cc: dev, Thomas Monjalon, Mcnamara, John, David Marchand, Tan, Raymond

On Mon, Mar 13, 2017 at 9:59 AM, Wei Dai <wei.dai@intel.com> wrote:
> There is no function to refer any part of execinfo.h, so remove the
> reference to it. And there is no this file in musl. So need to
> remove it to support musl.
>
> The musl is an alternative LIBC to GLIBC and provides the
> standard C/POSIX library and extensions.
> The musl can be got from http://www.musl-libc.org
>
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> ---
>  examples/performance-thread/common/lthread_tls.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/examples/performance-thread/common/lthread_tls.c b/examples/performance-thread/common/lthread_tls.c
> index 6876f83..47505f2 100644
> --- a/examples/performance-thread/common/lthread_tls.c
> +++ b/examples/performance-thread/common/lthread_tls.c
> @@ -42,7 +42,6 @@
>  #include <fcntl.h>
>  #include <sys/time.h>
>  #include <sys/mman.h>
> -#include <execinfo.h>
>  #include <sched.h>
>
>  #include <rte_malloc.h>
> --
> 2.7.4
>

Acked-by: Jan Blunck <jblunck@infradead.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/3] add a macro to enable support of backtrace
  2017-03-13  8:59 [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
                   ` (2 preceding siblings ...)
  2017-03-13  8:59 ` [PATCH v2 3/3] eal: remove references to execinfo.h for musl Wei Dai
@ 2017-05-05  1:30 ` Dai, Wei
  2017-05-05 13:18 ` [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
  4 siblings, 0 replies; 10+ messages in thread
From: Dai, Wei @ 2017-05-05  1:30 UTC (permalink / raw)
  To: thomas, raphael.cohn; +Cc: Mcnamara, John, david.marchand, Tan, Raymond, dev

Hi, Thomas

I noticed that my following patch set has been superseded.
It address the compile errors when DPDK is built with musl.
I know some customer products like Yocto Linux and that from Roph are using DPDK with musl and
they have to manually change something to build it.
Roph also referenced to use DPDK with musl in his mail titled " [dpdk-dev] Compiling DPDK 17.02 using musl instead of glibc " sent on 2017-03-14

Thanks & Best Regards
-Wei


> -----Original Message-----
> From: Dai, Wei
> Sent: Monday, March 13, 2017 4:59 PM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Mcnamara, John
> <john.mcnamara@intel.com>; david.marchand@6wind.com; Tan, Raymond
> <raymond.tan@intel.com>; Dai, Wei <wei.dai@intel.com>
> Subject: [PATCH v2 0/3] add a macro to enable support of backtrace
> 
> Some LIBC implementation like musl doesn't support backtrace( ) and
> backtrace_symbols declared in execinfo.h.
> Currently some DPDK customers fail to build PDDK with musl.
> In order to build DPDK with musl, there is a need to reomve references
> toexecinfo.h.
> 
> Add a configuration parameter in config/common_linuxapp which equals to y by
> default. It also generate a macro named as RTE_EAL_ENABLE_BACKTRACE
> when this configuration paramter equals to y or no above macro when it is n.
> 
> ---
> changes:
> v2 -- change configuration parameter name
> 
> 
> Wei Dai (3):
>   examples/performance-thread: remove reference to execinfo.h
>   config: add a marco to enable backtrace or not
>   eal: remove references to execinfo.h for musl
> 
>  config/common_linuxapp                           | 1 +
>  examples/performance-thread/common/lthread_tls.c | 1 -
>  lib/librte_eal/linuxapp/eal/eal_debug.c          | 4 ++++
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> --
> 2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 0/2] add a macro to disable support of backtrace
  2017-03-13  8:59 [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
                   ` (3 preceding siblings ...)
  2017-05-05  1:30 ` [PATCH v2 0/3] add a macro to enable support of backtrace Dai, Wei
@ 2017-05-05 13:18 ` Thomas Monjalon
  2017-05-05 13:18   ` [PATCH v3 1/2] examples/performance-thread: remove useless include Thomas Monjalon
                     ` (2 more replies)
  4 siblings, 3 replies; 10+ messages in thread
From: Thomas Monjalon @ 2017-05-05 13:18 UTC (permalink / raw)
  To: Wei Dai; +Cc: dev

Some LIBC implementation like musl doesn't support backtrace()
and backtrace_symbols() declared in execinfo.h.
Currently some DPDK customers fail to build DPDK with musl.
In order to build DPDK with musl, there is a need to
remove references to execinfo.h.

Add a configuration parameter which defaults to y.

v3:
- rename option
- apply to BSD
- squash patches

Wei Dai (2):
  examples/performance-thread: remove useless include
  config: make backtrace optional

 config/common_base                               | 1 +
 examples/performance-thread/common/lthread_tls.c | 1 -
 lib/librte_eal/bsdapp/eal/eal_debug.c            | 4 ++++
 lib/librte_eal/linuxapp/eal/eal_debug.c          | 4 ++++
 4 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/2] examples/performance-thread: remove useless include
  2017-05-05 13:18 ` [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
@ 2017-05-05 13:18   ` Thomas Monjalon
  2017-05-05 13:18   ` [PATCH v3 2/2] config: make backtrace optional Thomas Monjalon
  2017-05-05 13:21   ` [PATCH v3 0/2] add a macro to disable support of backtrace Thomas Monjalon
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2017-05-05 13:18 UTC (permalink / raw)
  To: Wei Dai; +Cc: dev

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

There is no function to refer any part of execinfo.h, so remove the
reference to it.
And there is no this file in musl. So need to remove it to support musl.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 examples/performance-thread/common/lthread_tls.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/examples/performance-thread/common/lthread_tls.c b/examples/performance-thread/common/lthread_tls.c
index 6876f831b..47505f2d4 100644
--- a/examples/performance-thread/common/lthread_tls.c
+++ b/examples/performance-thread/common/lthread_tls.c
@@ -42,7 +42,6 @@
 #include <fcntl.h>
 #include <sys/time.h>
 #include <sys/mman.h>
-#include <execinfo.h>
 #include <sched.h>
 
 #include <rte_malloc.h>
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/2] config: make backtrace optional
  2017-05-05 13:18 ` [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
  2017-05-05 13:18   ` [PATCH v3 1/2] examples/performance-thread: remove useless include Thomas Monjalon
@ 2017-05-05 13:18   ` Thomas Monjalon
  2017-05-05 13:21   ` [PATCH v3 0/2] add a macro to disable support of backtrace Thomas Monjalon
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2017-05-05 13:18 UTC (permalink / raw)
  To: Wei Dai; +Cc: dev

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/2] add a macro to disable support of backtrace
  2017-05-05 13:18 ` [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
  2017-05-05 13:18   ` [PATCH v3 1/2] examples/performance-thread: remove useless include Thomas Monjalon
  2017-05-05 13:18   ` [PATCH v3 2/2] config: make backtrace optional Thomas Monjalon
@ 2017-05-05 13:21   ` Thomas Monjalon
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2017-05-05 13:21 UTC (permalink / raw)
  To: Wei Dai; +Cc: dev

05/05/2017 15:18, Thomas Monjalon:
> Some LIBC implementation like musl doesn't support backtrace()
> and backtrace_symbols() declared in execinfo.h.
> Currently some DPDK customers fail to build DPDK with musl.
> In order to build DPDK with musl, there is a need to
> remove references to execinfo.h.
> 
> Add a configuration parameter which defaults to y.
> 
> v3:
> - rename option
> - apply to BSD
> - squash patches
> 
> Wei Dai (2):
>   examples/performance-thread: remove useless include
>   config: make backtrace optional

I prefer this version ;)

Applied, thanks

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-05 13:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13  8:59 [PATCH v2 0/3] add a macro to enable support of backtrace Wei Dai
2017-03-13  8:59 ` [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 ` [PATCH v2 2/3] config: add a marco to enable backtrace or not Wei Dai
2017-03-13  8:59 ` [PATCH v2 3/3] eal: remove references to execinfo.h for musl Wei Dai
2017-05-05  1:30 ` [PATCH v2 0/3] add a macro to enable support of backtrace Dai, Wei
2017-05-05 13:18 ` [PATCH v3 0/2] add a macro to disable " Thomas Monjalon
2017-05-05 13:18   ` [PATCH v3 1/2] examples/performance-thread: remove useless include Thomas Monjalon
2017-05-05 13:18   ` [PATCH v3 2/2] config: make backtrace optional Thomas Monjalon
2017-05-05 13:21   ` [PATCH v3 0/2] add a macro to disable support of backtrace Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.