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

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

Some DPDK customers fail to build DPDK with musl.
But so far execinfo.h is not supported by musl.
In order to build DPDK with musl, there is a need
to remove references to execinfo.h.

Currently only backtrace() and backtrace_symbols( ) from
execinfo.h are used in rte_dump_stack( ) in 
lib/librte_eal/linuxapp/eal/eal_debug.c .
This rte_dump_stack( ) is only used to get the
name of fucntions in call stack for debugging.

Wei Dai (3):
  examples/performance-thread: remove reference to execinfo.h
  config: add support of musl
  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          | 7 ++++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.7.4

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

* [PATCH 1/3] examples/performance-thread: remove reference to execinfo.h
  2017-03-10 11:58 [PATCH 0/3] add support of musl Wei Dai
@ 2017-03-10 11:58 ` Wei Dai
  2017-03-10 11:58 ` [PATCH 2/3] config: add support of musl Wei Dai
  2017-03-10 11:58 ` [PATCH 3/3] eal: remove references to execinfo.h for musl Wei Dai
  2 siblings, 0 replies; 8+ messages in thread
From: Wei Dai @ 2017-03-10 11:58 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, thomas.monjalon, david.marchand, Wei Dai

There is no function to refer any part of it, 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] 8+ messages in thread

* [PATCH 2/3] config: add support of musl
  2017-03-10 11:58 [PATCH 0/3] add support of musl Wei Dai
  2017-03-10 11:58 ` [PATCH 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
@ 2017-03-10 11:58 ` Wei Dai
  2017-03-10 11:58 ` [PATCH 3/3] eal: remove references to execinfo.h for musl Wei Dai
  2 siblings, 0 replies; 8+ messages in thread
From: Wei Dai @ 2017-03-10 11:58 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, thomas.monjalon, david.marchand, Wei Dai

When building DPDK with musl, there is need to generate
the MACRO named RTE_LIBC_MUSL in rte_config.h to remove
some references to execinfo.h which is not supported
by musl now.

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..66fb0a3 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -46,3 +46,4 @@ CONFIG_RTE_LIBRTE_PMD_TAP=y
 CONFIG_RTE_LIBRTE_NFP_PMD=y
 CONFIG_RTE_LIBRTE_POWER=y
 CONFIG_RTE_VIRTIO_USER=y
+CONFIG_RTE_LIBC_MUSL=n
-- 
2.7.4

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

* [PATCH 3/3] eal: remove references to execinfo.h for musl
  2017-03-10 11:58 [PATCH 0/3] add support of musl Wei Dai
  2017-03-10 11:58 ` [PATCH 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
  2017-03-10 11:58 ` [PATCH 2/3] config: add support of musl Wei Dai
@ 2017-03-10 11:58 ` Wei Dai
  2017-03-10 12:40   ` Thomas Monjalon
  2 siblings, 1 reply; 8+ messages in thread
From: Wei Dai @ 2017-03-10 11:58 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, thomas.monjalon, david.marchand, 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

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

diff --git a/lib/librte_eal/linuxapp/eal/eal_debug.c b/lib/librte_eal/linuxapp/eal/eal_debug.c
index 5fbc17c..d2416ee 100644
--- a/lib/librte_eal/linuxapp/eal/eal_debug.c
+++ b/lib/librte_eal/linuxapp/eal/eal_debug.c
@@ -31,7 +31,10 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <execinfo.h>
+#ifndef RTE_LIBC_MUSL
+	#include <execinfo.h>
+#endif
+
 #include <stdarg.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -47,6 +50,7 @@
 /* dump the stack of the calling core */
 void rte_dump_stack(void)
 {
+#ifndef RTE_LIBC_MUSL
 	void *func[BACKTRACE_SIZE];
 	char **symb = NULL;
 	int size;
@@ -64,6 +68,7 @@ void rte_dump_stack(void)
 	}
 
 	free(symb);
+#endif
 }
 
 /* not implemented in this environment */
-- 
2.7.4

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

* Re: [PATCH 3/3] eal: remove references to execinfo.h for musl
  2017-03-10 11:58 ` [PATCH 3/3] eal: remove references to execinfo.h for musl Wei Dai
@ 2017-03-10 12:40   ` Thomas Monjalon
  2017-03-10 14:49     ` Jan Blunck
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2017-03-10 12:40 UTC (permalink / raw)
  To: Wei Dai; +Cc: dev, john.mcnamara, david.marchand

2017-03-10 19:58, Wei Dai:
> @@ -47,6 +50,7 @@
>  /* dump the stack of the calling core */
>  void rte_dump_stack(void)
>  {
> +#ifndef RTE_LIBC_MUSL
>  	void *func[BACKTRACE_SIZE];
>  	char **symb = NULL;
>  	int size;
> @@ -64,6 +68,7 @@ void rte_dump_stack(void)
>  	}
>  
>  	free(symb);
> +#endif
>  }

There are probably other libc implementations not supporting this feature.
Instead of calling it "RTE_LIBC_MUSL", it should something like
"ENABLE_BACKTRACE".
Then you can add a musl section in the Linux quick start guide.

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

* Re: [PATCH 3/3] eal: remove references to execinfo.h for musl
  2017-03-10 12:40   ` Thomas Monjalon
@ 2017-03-10 14:49     ` Jan Blunck
  2017-03-13  8:10       ` Dai, Wei
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Blunck @ 2017-03-10 14:49 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Wei Dai, dev, Mcnamara, John, david.marchand

On Fri, Mar 10, 2017 at 1:40 PM, Thomas Monjalon
<thomas.monjalon@6wind.com> wrote:
> 2017-03-10 19:58, Wei Dai:
>> @@ -47,6 +50,7 @@
>>  /* dump the stack of the calling core */
>>  void rte_dump_stack(void)
>>  {
>> +#ifndef RTE_LIBC_MUSL
>>       void *func[BACKTRACE_SIZE];
>>       char **symb = NULL;
>>       int size;
>> @@ -64,6 +68,7 @@ void rte_dump_stack(void)
>>       }
>>
>>       free(symb);
>> +#endif
>>  }
>
> There are probably other libc implementations not supporting this feature.
> Instead of calling it "RTE_LIBC_MUSL", it should something like
> "ENABLE_BACKTRACE".
> Then you can add a musl section in the Linux quick start guide.

Also I would improve the code readability by removing the preprocessor
junk from it by moving the rte_dump_stack() function into
eal_backtrace.c and make that conditionally compile based on
CONFIG_ENABLE_BACKTRACE.

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

* Re: [PATCH 3/3] eal: remove references to execinfo.h for musl
  2017-03-10 14:49     ` Jan Blunck
@ 2017-03-13  8:10       ` Dai, Wei
  2017-03-15  8:38         ` Jan Blunck
  0 siblings, 1 reply; 8+ messages in thread
From: Dai, Wei @ 2017-03-13  8:10 UTC (permalink / raw)
  To: Jan Blunck, Thomas Monjalon
  Cc: dev, Mcnamara, John, david.marchand, Tan, Raymond

> -----Original Message-----
> From: jblunck@gmail.com [mailto:jblunck@gmail.com] On Behalf Of Jan Blunck
> Sent: Friday, March 10, 2017 10:50 PM
> To: Thomas Monjalon <thomas.monjalon@6wind.com>
> Cc: Dai, Wei <wei.dai@intel.com>; dev <dev@dpdk.org>; Mcnamara, John
> <john.mcnamara@intel.com>; david.marchand@intel.com
> Subject: Re: [dpdk-dev] [PATCH 3/3] eal: remove references to execinfo.h for
> musl
> 
> On Fri, Mar 10, 2017 at 1:40 PM, Thomas Monjalon
> <thomas.monjalon@6wind.com> wrote:
> > 2017-03-10 19:58, Wei Dai:
> >> @@ -47,6 +50,7 @@
> >>  /* dump the stack of the calling core */  void rte_dump_stack(void)
> >> {
> >> +#ifndef RTE_LIBC_MUSL
> >>       void *func[BACKTRACE_SIZE];
> >>       char **symb = NULL;
> >>       int size;
> >> @@ -64,6 +68,7 @@ void rte_dump_stack(void)
> >>       }
> >>
> >>       free(symb);
> >> +#endif
> >>  }
> >
> > There are probably other libc implementations not supporting this feature.
> > Instead of calling it "RTE_LIBC_MUSL", it should something like
> > "ENABLE_BACKTRACE".
> > Then you can add a musl section in the Linux quick start guide.
> 
> Also I would improve the code readability by removing the preprocessor junk
> from it by moving the rte_dump_stack() function into eal_backtrace.c and make
> that conditionally compile based on CONFIG_ENABLE_BACKTRACE.

I'd like to change CONFIG_RTE_LIBC_MUSL  to  CONFIG_RTE_EAL_ENABLE_BACKTRACE and
Will send a v2 patch soon.
Anyway, you also still can move rte_dump_stack() to another file when my change is accepted.


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

* Re: [PATCH 3/3] eal: remove references to execinfo.h for musl
  2017-03-13  8:10       ` Dai, Wei
@ 2017-03-15  8:38         ` Jan Blunck
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Blunck @ 2017-03-15  8:38 UTC (permalink / raw)
  To: Dai, Wei
  Cc: Thomas Monjalon, dev, Mcnamara, John, david.marchand, Tan, Raymond

On Mon, Mar 13, 2017 at 9:10 AM, Dai, Wei <wei.dai@intel.com> wrote:
>> -----Original Message-----
>> From: jblunck@gmail.com [mailto:jblunck@gmail.com] On Behalf Of Jan Blunck
>> Sent: Friday, March 10, 2017 10:50 PM
>> To: Thomas Monjalon <thomas.monjalon@6wind.com>
>> Cc: Dai, Wei <wei.dai@intel.com>; dev <dev@dpdk.org>; Mcnamara, John
>> <john.mcnamara@intel.com>; david.marchand@intel.com
>> Subject: Re: [dpdk-dev] [PATCH 3/3] eal: remove references to execinfo.h for
>> musl
>>
>> On Fri, Mar 10, 2017 at 1:40 PM, Thomas Monjalon
>> <thomas.monjalon@6wind.com> wrote:
>> > 2017-03-10 19:58, Wei Dai:
>> >> @@ -47,6 +50,7 @@
>> >>  /* dump the stack of the calling core */  void rte_dump_stack(void)
>> >> {
>> >> +#ifndef RTE_LIBC_MUSL
>> >>       void *func[BACKTRACE_SIZE];
>> >>       char **symb = NULL;
>> >>       int size;
>> >> @@ -64,6 +68,7 @@ void rte_dump_stack(void)
>> >>       }
>> >>
>> >>       free(symb);
>> >> +#endif
>> >>  }
>> >
>> > There are probably other libc implementations not supporting this feature.
>> > Instead of calling it "RTE_LIBC_MUSL", it should something like
>> > "ENABLE_BACKTRACE".
>> > Then you can add a musl section in the Linux quick start guide.
>>
>> Also I would improve the code readability by removing the preprocessor junk
>> from it by moving the rte_dump_stack() function into eal_backtrace.c and make
>> that conditionally compile based on CONFIG_ENABLE_BACKTRACE.
>
> I'd like to change CONFIG_RTE_LIBC_MUSL  to  CONFIG_RTE_EAL_ENABLE_BACKTRACE and
> Will send a v2 patch soon.
> Anyway, you also still can move rte_dump_stack() to another file when my change is accepted.
>

Thanks for working on it! Please also merge the introduction of the
configuration and its usage into one patch.

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

end of thread, other threads:[~2017-03-15  8:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10 11:58 [PATCH 0/3] add support of musl Wei Dai
2017-03-10 11:58 ` [PATCH 1/3] examples/performance-thread: remove reference to execinfo.h Wei Dai
2017-03-10 11:58 ` [PATCH 2/3] config: add support of musl Wei Dai
2017-03-10 11:58 ` [PATCH 3/3] eal: remove references to execinfo.h for musl Wei Dai
2017-03-10 12:40   ` Thomas Monjalon
2017-03-10 14:49     ` Jan Blunck
2017-03-13  8:10       ` Dai, Wei
2017-03-15  8:38         ` Jan Blunck

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.