[lttng-dev] [PATCH lttng-ust] Fix: include config.h to resolve HAVE_DLMOPEN

2017-02-21 Thread Jonathan Rajotte
Fixes commit 42330adcefcd1830dad89e2a960c93d8dd1da125

Signed-off-by: Jonathan Rajotte 
---
 liblttng-ust-dl/ust_dl.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/liblttng-ust-dl/ust_dl.h b/liblttng-ust-dl/ust_dl.h
index afa8e84..c8a0695 100644
--- a/liblttng-ust-dl/ust_dl.h
+++ b/liblttng-ust-dl/ust_dl.h
@@ -33,6 +33,7 @@ extern "C" {
 
 #include 
 #include 
+#include 
 
 #define LTTNG_UST_DL_PROVIDER
 #include 
-- 
2.7.4

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [PATCH lttng-ust] Validate the presence of dlmopen at configure time

2017-02-21 Thread Mathieu Desnoyers
merged into master and stable-2.9, thanks!

Mathieu

- On Feb 21, 2017, at 4:00 PM, Jonathan Rajotte 
jonathan.rajotte-jul...@efficios.com wrote:

> Signed-off-by: Michael Jeanson 
> Signed-off-by: Jonathan Rajotte 
> ---
> configure.ac   | 8 
> liblttng-ust-dl/lttng-ust-dl.c | 8 
> liblttng-ust-dl/ust_dl.h   | 2 ++
> 3 files changed, 18 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 450b43b..023cfd4 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -125,15 +125,23 @@ AS_IF([test "x${ax_cv_sys_weak_alias}" = "xno"], [
> # Checks for libraries.
> AC_CHECK_LIB([dl], [dlopen], [
>   have_libdl=yes
> + libdl_name=dl
> ], [
>   #libdl not found, check for dlopen in libc.
>   AC_CHECK_LIB([c], [dlopen], [
>   have_libc_dl=yes
> + libdl_name=c
>   ], [
>   AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use 
> [LDFLAGS]=-Ldir to
>   specify their location.])
>   ])
> ])
> 
> +# Check if libdl has dlmopen support.
> +AH_TEMPLATE([HAVE_DLMOPEN], ["Define to 1 if dlmopen is available."])
> +AC_CHECK_LIB([$libdl_name], [dlmopen],
> + [AC_DEFINE([HAVE_DLMOPEN], [1])]
> +)
> +
> AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
> AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = 
> "xyes"])
> 
> diff --git a/liblttng-ust-dl/lttng-ust-dl.c b/liblttng-ust-dl/lttng-ust-dl.c
> index b0737b6..ce2ae0e 100644
> --- a/liblttng-ust-dl/lttng-ust-dl.c
> +++ b/liblttng-ust-dl/lttng-ust-dl.c
> @@ -38,8 +38,10 @@
> #include "ust_dl.h"
> 
> static void *(*__lttng_ust_plibc_dlopen)(const char *filename, int flags);
> +#ifdef HAVE_DLMOPEN
> static void *(*__lttng_ust_plibc_dlmopen)(Lmid_t nsid, const char *filename,
>   int flags);
> +#endif
> static int (*__lttng_ust_plibc_dlclose)(void *handle);
> 
> static
> @@ -55,6 +57,7 @@ void *_lttng_ust_dl_libc_dlopen(const char *filename, int
> flags)
>   return __lttng_ust_plibc_dlopen(filename, flags);
> }
> 
> +#ifdef HAVE_DLMOPEN
> static
> void *_lttng_ust_dl_libc_dlmopen(Lmid_t nsid, const char *filename,
>   int flags)
> @@ -68,6 +71,7 @@ void *_lttng_ust_dl_libc_dlmopen(Lmid_t nsid, const char
> *filename,
>   }
>   return __lttng_ust_plibc_dlmopen(nsid, filename, flags);
> }
> +#endif
> 
> static
> int _lttng_ust_dl_libc_dlclose(void *handle)
> @@ -143,6 +147,7 @@ end:
>   return;
> }
> 
> +#ifdef HAVE_DLMOPEN
> static
> void lttng_ust_dl_dlmopen(void *so_base, Lmid_t nsid, const char *so_name,
>   int flags, void *ip)
> @@ -203,6 +208,7 @@ end:
>   lttng_ust_elf_destroy(elf);
>   return;
> }
> +#endif
> 
> void *dlopen(const char *filename, int flags)
> {
> @@ -223,6 +229,7 @@ void *dlopen(const char *filename, int flags)
>   return handle;
> }
> 
> +#ifdef HAVE_DLMOPEN
> void *dlmopen(Lmid_t nsid, const char *filename, int flags)
> {
>   void *handle;
> @@ -243,6 +250,7 @@ void *dlmopen(Lmid_t nsid, const char *filename, int 
> flags)
>   return handle;
> 
> }
> +#endif
> 
> int dlclose(void *handle)
> {
> diff --git a/liblttng-ust-dl/ust_dl.h b/liblttng-ust-dl/ust_dl.h
> index b8cfe82..afa8e84 100644
> --- a/liblttng-ust-dl/ust_dl.h
> +++ b/liblttng-ust-dl/ust_dl.h
> @@ -51,6 +51,7 @@ TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
>   )
> )
> 
> +#ifdef HAVE_DLMOPEN
> TRACEPOINT_EVENT(lttng_ust_dl, dlmopen,
>   TP_ARGS(void *, ip, void *, baddr, Lmid_t, nsid,
>   const char *, path, int, flags,
> @@ -66,6 +67,7 @@ TRACEPOINT_EVENT(lttng_ust_dl, dlmopen,
>   ctf_integer(uint8_t, has_debug_link, has_debug_link)
>   )
> )
> +#endif
> 
> TRACEPOINT_EVENT(lttng_ust_dl, build_id,
>   TP_ARGS(
> --
> 2.7.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [PATCH lttng-ust] Validate the presence of dlmopen at configure time

2017-02-21 Thread Jonathan Rajotte
Signed-off-by: Michael Jeanson 
Signed-off-by: Jonathan Rajotte 
---
 configure.ac   | 8 
 liblttng-ust-dl/lttng-ust-dl.c | 8 
 liblttng-ust-dl/ust_dl.h   | 2 ++
 3 files changed, 18 insertions(+)

diff --git a/configure.ac b/configure.ac
index 450b43b..023cfd4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,15 +125,23 @@ AS_IF([test "x${ax_cv_sys_weak_alias}" = "xno"], [
 # Checks for libraries.
 AC_CHECK_LIB([dl], [dlopen], [
have_libdl=yes
+   libdl_name=dl
 ], [
#libdl not found, check for dlopen in libc.
AC_CHECK_LIB([c], [dlopen], [
have_libc_dl=yes
+   libdl_name=c
], [
AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use 
[LDFLAGS]=-Ldir to specify their location.])
])
 ])
 
+# Check if libdl has dlmopen support.
+AH_TEMPLATE([HAVE_DLMOPEN], ["Define to 1 if dlmopen is available."])
+AC_CHECK_LIB([$libdl_name], [dlmopen],
+   [AC_DEFINE([HAVE_DLMOPEN], [1])]
+)
+
 AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
 AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = 
"xyes"])
 
diff --git a/liblttng-ust-dl/lttng-ust-dl.c b/liblttng-ust-dl/lttng-ust-dl.c
index b0737b6..ce2ae0e 100644
--- a/liblttng-ust-dl/lttng-ust-dl.c
+++ b/liblttng-ust-dl/lttng-ust-dl.c
@@ -38,8 +38,10 @@
 #include "ust_dl.h"
 
 static void *(*__lttng_ust_plibc_dlopen)(const char *filename, int flags);
+#ifdef HAVE_DLMOPEN
 static void *(*__lttng_ust_plibc_dlmopen)(Lmid_t nsid, const char *filename,
int flags);
+#endif
 static int (*__lttng_ust_plibc_dlclose)(void *handle);
 
 static
@@ -55,6 +57,7 @@ void *_lttng_ust_dl_libc_dlopen(const char *filename, int 
flags)
return __lttng_ust_plibc_dlopen(filename, flags);
 }
 
+#ifdef HAVE_DLMOPEN
 static
 void *_lttng_ust_dl_libc_dlmopen(Lmid_t nsid, const char *filename,
int flags)
@@ -68,6 +71,7 @@ void *_lttng_ust_dl_libc_dlmopen(Lmid_t nsid, const char 
*filename,
}
return __lttng_ust_plibc_dlmopen(nsid, filename, flags);
 }
+#endif
 
 static
 int _lttng_ust_dl_libc_dlclose(void *handle)
@@ -143,6 +147,7 @@ end:
return;
 }
 
+#ifdef HAVE_DLMOPEN
 static
 void lttng_ust_dl_dlmopen(void *so_base, Lmid_t nsid, const char *so_name,
int flags, void *ip)
@@ -203,6 +208,7 @@ end:
lttng_ust_elf_destroy(elf);
return;
 }
+#endif
 
 void *dlopen(const char *filename, int flags)
 {
@@ -223,6 +229,7 @@ void *dlopen(const char *filename, int flags)
return handle;
 }
 
+#ifdef HAVE_DLMOPEN
 void *dlmopen(Lmid_t nsid, const char *filename, int flags)
 {
void *handle;
@@ -243,6 +250,7 @@ void *dlmopen(Lmid_t nsid, const char *filename, int flags)
return handle;
 
 }
+#endif
 
 int dlclose(void *handle)
 {
diff --git a/liblttng-ust-dl/ust_dl.h b/liblttng-ust-dl/ust_dl.h
index b8cfe82..afa8e84 100644
--- a/liblttng-ust-dl/ust_dl.h
+++ b/liblttng-ust-dl/ust_dl.h
@@ -51,6 +51,7 @@ TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
)
 )
 
+#ifdef HAVE_DLMOPEN
 TRACEPOINT_EVENT(lttng_ust_dl, dlmopen,
TP_ARGS(void *, ip, void *, baddr, Lmid_t, nsid,
const char *, path, int, flags,
@@ -66,6 +67,7 @@ TRACEPOINT_EVENT(lttng_ust_dl, dlmopen,
ctf_integer(uint8_t, has_debug_link, has_debug_link)
)
 )
+#endif
 
 TRACEPOINT_EVENT(lttng_ust_dl, build_id,
TP_ARGS(
-- 
2.7.4

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [PATCH babeltrace] Set the minimum Python version to 3.0

2017-02-21 Thread Francis Deslauriers
To be applied on Babeltrace v1.5

Signed-off-by: Francis Deslauriers 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index fd80fd9..7d9b66e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -239,7 +239,7 @@ AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" 
= xyes])
 
 if test "x${enable_python:-yes}" = xyes; then
   AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer 
is needed]) ])
-  AM_PATH_PYTHON
+  AM_PATH_PYTHON([3.0], [], [ AC_MSG_ERROR([Python 3.0 or newer is needed]) ])
 
   AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing 
python-config])
   AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
-- 
2.7.4

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [PATCH babeltrace v2] Build Python bindings with distutils for consistent installs

2017-02-21 Thread Francis Deslauriers
This patch changes the build system used to compile and install the
Python Bindings. Distutils is used to find the right install directory.
When the install directory generated from the install prefix is not in
the Python search path (PYTHON_PATH), we print a warning explaining what
can be done to include it.
It uses Distutils which is part of the Python standard library.

To be applied on Babeltrace v1.5

Signed-off-by: Francis Deslauriers 
---
 .gitignore| 10 +++-
 bindings/python/Makefile.am   | 58 +-
 bindings/python/babeltrace/Makefile.am| 30 ++
 bindings/python/babeltrace/__init__.py.in | 25 
 bindings/python/setup.py.in   | 85 +++
 configure.ac  | 13 ++--
 m4/python_modules.m4  | 23 
 tests/bin/intersection/bt_python_helper.py.in |  8 +--
 8 files changed, 187 insertions(+), 65 deletions(-)
 create mode 100644 bindings/python/babeltrace/__init__.py.in
 create mode 100644 bindings/python/setup.py.in
 delete mode 100644 m4/python_modules.m4

diff --git a/.gitignore b/.gitignore
index a7c9e3c..9259b6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,8 +47,12 @@ converter/babeltrace-log
 core
 formats/ctf/metadata/ctf-parser.output
 stamp-h1
-bindings/python/babeltrace.i
-bindings/python/babeltrace.py
-bindings/python/babeltrace_wrap.c
+bindings/python/setup.py
+bindings/python/installed_files.txt
+bindings/python/build
+bindings/python/babeltrace/__init__.py
+bindings/python/babeltrace/babeltrace.i
+bindings/python/babeltrace/babeltrace.py
+bindings/python/babeltrace/babeltrace_wrap.c
 babeltrace.pc
 babeltrace-ctf.pc
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index d6b3648..37ae14e 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -1,3 +1,59 @@
 if USE_PYTHON
-SUBDIRS = babeltrace
+SUBDIRS = babeltrace .
+
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(srcdir)/babeltrace/
+
+# Since the shared object used by the python bindings is not built with libtool
+# we need to manually set the `rpath` during linkage
+AM_LDFLAGS=-L$(top_builddir)/formats/ctf/.libs -L$(top_builddir)/lib/.libs 
-Wl,-rpath,$(prefix)/lib
+
+INSTALLED_FILES=installed_files.txt
+
+all-local: build-python-bindings.stamp
+
+$(builddir)/babeltrace/__init__.py: $(srcdir)/babeltrace/__init__.py.in
+   cd babeltrace && $(MAKE) __init__.py
+
+$(builddir)/babeltrace/babeltrace.i: $(srcdir)/babeltrace/babeltrace.i.in
+   cd babeltrace && $(MAKE) babeltrace.i
+
+BINDINGS_DEPS=setup.py \
+   babeltrace/__init__.py \
+   babeltrace/babeltrace.i \
+   babeltrace/python-complements.c \
+   babeltrace/python-complements.h
+
+BUILD_FLAGS=CC="$(CC)" \
+   CFLAGS="$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(GLIB_CFLAGS) 
$(AM_CFLAGS)" \
+   CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS)" \
+   LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)"
+
+build-python-bindings.stamp: $(BINDINGS_DEPS)
+   $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build_ext
+   $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build
+   touch $@
+
+# This target installs the Python package and saves the path of all the
+# installed files in the INSTALLED_FILES text file to be used during this
+# uninstallation
+install-exec-local:
+   @opts="--prefix=$(prefix) --verbose --record $(INSTALLED_FILES) 
--no-compile $(DISTSETUPOPTS)"; \
+   if [ "$(DESTDIR)" != "" ]; then \
+   opts="$$opts --root=$(DESTDIR)"; \
+   fi; \
+   $(PYTHON) $(builddir)/setup.py install $$opts;
+
+clean-local:
+   rm -rf $(builddir)/build
+
+# Distutils' setup.py does not include an uninstall target, we thus need to do 
it
+# manually. We use the INSTALLED_FILES file produced during the install to
+# clean up the install folder and delete the folder it self.
+uninstall-local:
+   cat $(builddir)/$(INSTALLED_FILES) | xargs rm -rf
+   cat $(builddir)/$(INSTALLED_FILES) | $(GREP) "__init__.py" | xargs 
dirname | xargs rmdir
+   rm -f $(builddir)/$(INSTALLED_FILES)
+
+CLEANFILES = babeltrace/babeltrace_wrap.c babeltrace/babeltrace.py 
build-python-bindings.stamp
+DISTCLEANFILES = setup.py
 endif
diff --git a/bindings/python/babeltrace/Makefile.am 
b/bindings/python/babeltrace/Makefile.am
index 11dcdf0..f612aa6 100644
--- a/bindings/python/babeltrace/Makefile.am
+++ b/bindings/python/babeltrace/Makefile.am
@@ -1,31 +1,9 @@
+if USE_PYTHON
 babeltrace.i: babeltrace.i.in
sed "s/BABELTRACE_VERSION_STR/Babeltrace $(PACKAGE_VERSION)/g" < \
$(top_srcdir)/bindings/python/babeltrace/babeltrace.i.in > \
$(top_builddir)/bindings/python/babeltrace/babeltrace.i
 
-AM_CFLAGS = $(PYTHON_INCLUDE) -I$(top_srcdir)/include/ \
-   -I$(top_srcdir)/bindings/python/babeltrace
-
-EXTRA_DIST = babeltrace.i

Re: [lttng-dev] [RFC PATCH lttng-ust 2/2] dl instrumentation: add dlmopen event, trace dlopen flags

2017-02-21 Thread Jonathan Rajotte-Julien
On Tue, Feb 21, 2017 at 02:40:28PM +, Mathieu Desnoyers wrote:
> - On Feb 21, 2017, at 9:19 AM, Thomas Petazzoni 
> thomas.petazz...@free-electrons.com wrote:
> 
> > Hello,
> > 
> > On Tue, 21 Feb 2017 14:08:08 + (UTC), Mathieu Desnoyers wrote:
> > 
> >> My expectation is that the dlmopen override symbol gets generated,
> >> but it is never invoked in builds where the libc does not implement
> >> it, so we never have to look it up dynamically through dlsym().
> > 
> > The main issue is that the Lmid_t type doesn't exist I believe.
> 
> Ah yes, good point. This typedef is only there with glibc header
> files.
> 
> So we'd have to add a configure.ac test that would detect if dlmopen()
> is there, and expose a define to lttng-ust to skip the dlmopen() bits
> accordingly.
> 
> Jonathan, can you have a look and prepare a patch please ?

Sure.

> 
> Thanks,
> 
> Mathieu
> 
> > 
> >> How does the build fail with musl ? Can you provide the build
> >> output ?
> > 
> > Sure:
> > 
> >  
> > http://autobuild.buildroot.net/results/113/113fa95a054df183014b43ec36b329f9c59bd356/build-end.log
> > 
> > If you want to reproduce:
> > 
> > $ git clone git://git.busybox.net/buildroot
> > $ cd buildroot/
> > $ git checkout 2017.02-rc2
> > $ cat > .config
> > BR2_arm=y
> > BR2_cortex_a9=y
> > BR2_ARM_ENABLE_VFP=y
> > BR2_TOOLCHAIN_EXTERNAL=y
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> > BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> > BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2017.02-rc1-2-g133c5ac.tar.bz2";
> > BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
> > BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
> > BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
> > BR2_TOOLCHAIN_EXTERNAL_CXX=y
> > BR2_INIT_NONE=y
> > BR2_SYSTEM_BIN_SH_NONE=y
> > # BR2_PACKAGE_BUSYBOX is not set
> > BR2_PACKAGE_LTTNG_LIBUST=y
> > # BR2_TARGET_ROOTFS_TAR is not set
> > $ make olddefconfig
> > $ make
> > 
> > Takes ~5 minutes maybe for the all build to proceed until it breaks on
> > lttng-ust.
> > 
> > Thanks!
> > 
> > Thomas
> > --
> > Thomas Petazzoni, CTO, Free Electrons
> > Embedded Linux and Kernel engineering
> > http://free-electrons.com
> 
> -- 
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com

-- 
Jonathan Rajotte-Julien
EfficiOS
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [RFC PATCH lttng-ust 2/2] dl instrumentation: add dlmopen event, trace dlopen flags

2017-02-21 Thread Mathieu Desnoyers
- On Feb 21, 2017, at 9:19 AM, Thomas Petazzoni 
thomas.petazz...@free-electrons.com wrote:

> Hello,
> 
> On Tue, 21 Feb 2017 14:08:08 + (UTC), Mathieu Desnoyers wrote:
> 
>> My expectation is that the dlmopen override symbol gets generated,
>> but it is never invoked in builds where the libc does not implement
>> it, so we never have to look it up dynamically through dlsym().
> 
> The main issue is that the Lmid_t type doesn't exist I believe.

Ah yes, good point. This typedef is only there with glibc header
files.

So we'd have to add a configure.ac test that would detect if dlmopen()
is there, and expose a define to lttng-ust to skip the dlmopen() bits
accordingly.

Jonathan, can you have a look and prepare a patch please ?

Thanks,

Mathieu

> 
>> How does the build fail with musl ? Can you provide the build
>> output ?
> 
> Sure:
> 
>  
> http://autobuild.buildroot.net/results/113/113fa95a054df183014b43ec36b329f9c59bd356/build-end.log
> 
> If you want to reproduce:
> 
> $ git clone git://git.busybox.net/buildroot
> $ cd buildroot/
> $ git checkout 2017.02-rc2
> $ cat > .config
> BR2_arm=y
> BR2_cortex_a9=y
> BR2_ARM_ENABLE_VFP=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2017.02-rc1-2-g133c5ac.tar.bz2";
> BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_LTTNG_LIBUST=y
> # BR2_TARGET_ROOTFS_TAR is not set
> $ make olddefconfig
> $ make
> 
> Takes ~5 minutes maybe for the all build to proceed until it breaks on
> lttng-ust.
> 
> Thanks!
> 
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [RFC PATCH lttng-ust 2/2] dl instrumentation: add dlmopen event, trace dlopen flags

2017-02-21 Thread Thomas Petazzoni
Hello,

On Tue, 21 Feb 2017 14:08:08 + (UTC), Mathieu Desnoyers wrote:

> My expectation is that the dlmopen override symbol gets generated,
> but it is never invoked in builds where the libc does not implement
> it, so we never have to look it up dynamically through dlsym().

The main issue is that the Lmid_t type doesn't exist I believe.

> How does the build fail with musl ? Can you provide the build
> output ?

Sure:

  
http://autobuild.buildroot.net/results/113/113fa95a054df183014b43ec36b329f9c59bd356/build-end.log

If you want to reproduce:

$ git clone git://git.busybox.net/buildroot
$ cd buildroot/
$ git checkout 2017.02-rc2
$ cat > .config
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2017.02-rc1-2-g133c5ac.tar.bz2";
BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_LTTNG_LIBUST=y
# BR2_TARGET_ROOTFS_TAR is not set
$ make olddefconfig
$ make

Takes ~5 minutes maybe for the all build to proceed until it breaks on
lttng-ust.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [RFC PATCH lttng-ust 2/2] dl instrumentation: add dlmopen event, trace dlopen flags

2017-02-21 Thread Mathieu Desnoyers
- On Feb 21, 2017, at 4:03 AM, Thomas Petazzoni 
thomas.petazz...@free-electrons.com wrote:

> Hello,
> 
> On Mon,  4 Jul 2016 18:53:48 -0400, Mathieu Desnoyers wrote:
>> Add missing dlmopen(3) instrumentation, and add the "flags" field to
>> dlopen instrumentation.
>> 
>> Link: http://man7.org/linux/man-pages/man3/dlopen.3.html
>> Signed-off-by: Mathieu Desnoyers 
> 
> FYI, this commit (7b0fdd83c137bea1d7302df1a45252dfdccd8172) breaks the
> build with the musl C library, because it doesn't implement the
> dlmopen() extension.
> 
> Perhaps there should be an autoconf test to check if the C library
> provides dlmopen() functionality or not?

My expectation is that the dlmopen override symbol gets generated,
but it is never invoked in builds where the libc does not implement
it, so we never have to look it up dynamically through dlsym().

How does the build fail with musl ? Can you provide the build
output ?

Thanks,

Mathieu

> 
> Best regards,
> 
> Thomas Petazzoni
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [RFC PATCH lttng-ust 2/2] dl instrumentation: add dlmopen event, trace dlopen flags

2017-02-21 Thread Thomas Petazzoni
Hello,

On Mon,  4 Jul 2016 18:53:48 -0400, Mathieu Desnoyers wrote:
> Add missing dlmopen(3) instrumentation, and add the "flags" field to
> dlopen instrumentation.
> 
> Link: http://man7.org/linux/man-pages/man3/dlopen.3.html
> Signed-off-by: Mathieu Desnoyers 

FYI, this commit (7b0fdd83c137bea1d7302df1a45252dfdccd8172) breaks the
build with the musl C library, because it doesn't implement the
dlmopen() extension.

Perhaps there should be an autoconf test to check if the C library
provides dlmopen() functionality or not?

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev