Skip to contentSkip to conversation

Pull request for branch for-2012.02/lttng-uclibc-fixes

GIT PULL New Thomas Petazzoni 2 participants 16 messages Feb 4, 2012 – Feb 5, 2012

lore
Share & tools
lore
#0 lore raw

The following changes since commit 2ba094de31bbc9f986b6d5bce7932d5bb7443829:

crosstool-ng: bump version (2012-02-03 15:24:39 +0100)

are available in the git repository at:
http://free-electrons.com/~thomas/buildroot.git for-2012.02/lttng-uclibc-fixes

Thomas Petazzoni (7):
liburcu: add patch to fix build with uClibc
lttng-tools: fix build on uClibc due to sync_file_range()
lttng-babeltrace: make sure WCHAR and LARGEFILE are enabled
lttng-libust: add the dependency on util-linux
lttng-tools: make the dependency on lttng-libust optional
lttng-libust: add patch to fix build issue when C++ support is not available
lttng-babeltrace: fix build on uClibc due to missing posix_fallocate()

 .../liburcu/liburcu-0.6.7-missing-gnu-source.patch |   13 +++
 package/lttng-babeltrace/Config.in                 |    8 ++
 ...beltrace-0.8-no-posix-fallocate-in-uclibc.patch |   25 ++++++
 package/lttng-libust/Config.in                     |    8 ++
 ...2-dont-build-cxx-tests-when-not-available.patch |   50 +++++++++++
 package/lttng-libust/lttng-libust.mk               |    4 +-
 package/lttng-tools/Config.in                      |    4 +-
 ...ls-2.0-pre15-no-sync-file-range-in-uclibc.patch |   87 ++++++++++++++++++++
 package/lttng-tools/lttng-tools.mk                 |   11 ++-
 9 files changed, 207 insertions(+), 3 deletions(-)
 create mode 100644 package/liburcu/liburcu-0.6.7-missing-gnu-source.patch
 create mode 100644 package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch
 create mode 100644 package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch
 create mode 100644 package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch

Thanks,

Signature · 1 line
Thomas Petazzoni
#1 lore raw

PATCH 1/7 liburcu: add patch to fix build with uClibc

Under uClibc, defining _GNU_SOURCE is strictly needed to access the CPU_*() macros.

---
 .../liburcu/liburcu-0.6.7-missing-gnu-source.patch |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 package/liburcu/liburcu-0.6.7-missing-gnu-source.patch
package/liburcu/liburcu-0.6.7-missing-gnu-source.patch new file +13 -0
new file mode 100644
index 0000000..f34120c
@@ -0,0 +1,13 @@
+Define _GNU_SOURCE to access CPU_ZERO() macro in uClibc
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: userspace-rcu-0.6.7/tests/urcutorture.c
+===================================================================
+--- userspace-rcu-0.6.7.orig/tests/urcutorture.c	2012-02-01 10:17:09.938804402 +0100
++++ userspace-rcu-0.6.7/tests/urcutorture.c	2012-02-01 10:17:15.308713372 +0100
+@@ -1,3 +1,4 @@
++#define _GNU_SOURCE
+ #include <string.h>
+ #include <sys/time.h>
+ #include <poll.h>
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/7 liburcu: add patch to fix build with uClibc

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Under uClibc, defining _GNU_SOURCE is strictly needed to access the Thomas> CPU_*() macros.

Committed, thanks. Don't forget to send patch upstream.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/7 liburcu: add patch to fix build with uClibc

Le Sun, 05 Feb 2012 11:00:57 +0100,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Thomas" == Thomas Petazzoni
<[email protected]> writes:

Thomas> Under uClibc, defining _GNU_SOURCE is strictly needed to Thomas> access the CPU_*() macros.

Committed, thanks. Don't forget to send patch upstream.

This is done:
http://lists.lttng.org/pipermail/lttng-dev/2012-February/017509.html

The other ones need some update, as the upstream version has evolved compared to the version we have in Buildroot, but I intend to send them upstream after updating the patches.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 2/7 lttng-tools: fix build on uClibc due to sync_file_range()

In reply to Thomas Petazzoni

Add a patch to use fdatasync() instead of sync_file_range() when the latter is not available.

---
 ...ls-2.0-pre15-no-sync-file-range-in-uclibc.patch |   87 ++++++++++++++++++++
 package/lttng-tools/lttng-tools.mk                 |    2 +
 2 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch
package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch new file +87 -0
new file mode 100644
index 0000000..861686b
@@ -0,0 +1,87 @@
+Make sync_file_range() usage optional
+
+Under uClibc, sync_file_range() is not available under all
+architectures, so we fall back to fdatasync() in this case.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: lttng-tools-2.0-pre15/configure.ac
+===================================================================
+--- lttng-tools-2.0-pre15.orig/configure.ac	2012-02-01 16:31:31.140978817 +0100
++++ lttng-tools-2.0-pre15/configure.ac	2012-02-01 16:31:42.110783708 +0100
+@@ -96,7 +96,7 @@
+ 
+ AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
+ 
+-AC_CHECK_FUNCS([sched_getcpu sysconf])
++AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
+ 
+ # Option to only build the consumer daemon and its libraries
+ AC_ARG_WITH([consumerd-only],
+Index: lttng-tools-2.0-pre15/liblttng-consumer/lttng-consumer.c
+===================================================================
+--- lttng-tools-2.0-pre15.orig/liblttng-consumer/lttng-consumer.c	2012-02-01 16:36:00.876292596 +0100
++++ lttng-tools-2.0-pre15/liblttng-consumer/lttng-consumer.c	2012-02-01 16:36:23.435901163 +0100
+@@ -527,11 +527,15 @@
+ 	if (orig_offset < stream->chan->max_sb_size) {
+ 		return;
+ 	}
++#ifdef HAVE_SYNC_FILE_RANGE
+ 	sync_file_range(outfd, orig_offset - stream->chan->max_sb_size,
+ 			stream->chan->max_sb_size,
+ 			SYNC_FILE_RANGE_WAIT_BEFORE
+ 			| SYNC_FILE_RANGE_WRITE
+ 			| SYNC_FILE_RANGE_WAIT_AFTER);
++#else
++	fdatasync(outfd);
++#endif
+ 	/*
+ 	 * Give hints to the kernel about how we access the file:
+ 	 * POSIX_FADV_DONTNEED : we won't re-access data in a near future after
+Index: lttng-tools-2.0-pre15/liblttng-kconsumer/lttng-kconsumer.c
+===================================================================
+--- lttng-tools-2.0-pre15.orig/liblttng-kconsumer/lttng-kconsumer.c	2012-02-01 16:36:36.215679416 +0100
++++ lttng-tools-2.0-pre15/liblttng-kconsumer/lttng-kconsumer.c	2012-02-01 16:59:08.622203348 +0100
+@@ -71,8 +71,12 @@
+ 			goto end;
+ 		}
+ 		/* This won't block, but will start writeout asynchronously */
++#ifdef HAVE_SYNC_FILE_RANGE
+ 		sync_file_range(outfd, stream->out_fd_offset, ret,
+ 				SYNC_FILE_RANGE_WRITE);
++#else
++		fdatasync(outfd);
++#endif
+ 		stream->out_fd_offset += ret;
+ 	}
+ 
+@@ -121,8 +125,12 @@
+ 		}
+ 		len -= ret;
+ 		/* This won't block, but will start writeout asynchronously */
++#ifdef HAVE_SYNC_FILE_RANGE
+ 		sync_file_range(outfd, stream->out_fd_offset, ret,
+ 				SYNC_FILE_RANGE_WRITE);
++#else
++		fdatasync(outfd);
++#endif
+ 		stream->out_fd_offset += ret;
+ 	}
+ 	lttng_consumer_sync_trace_file(stream, orig_offset);
+Index: lttng-tools-2.0-pre15/liblttng-ustconsumer/lttng-ustconsumer.c
+===================================================================
+--- lttng-tools-2.0-pre15.orig/liblttng-ustconsumer/lttng-ustconsumer.c	2012-02-01 16:37:11.495067263 +0100
++++ lttng-tools-2.0-pre15/liblttng-ustconsumer/lttng-ustconsumer.c	2012-02-01 16:37:31.224724916 +0100
+@@ -70,8 +70,12 @@
+ 			goto end;
+ 		}
+ 		/* This won't block, but will start writeout asynchronously */
++#ifdef HAVE_SYNC_FILE_RANGE
+ 		sync_file_range(outfd, stream->out_fd_offset, ret,
+ 				SYNC_FILE_RANGE_WRITE);
++#else
++		fdatasync(outfd);
++#endif
+ 		stream->out_fd_offset += ret;
+ 	}
+ 
package/lttng-tools/lttng-tools.mk +2 -0
index 9e87480..bcf2f67 100644
@@ -8,4 +8,6 @@ LTTNG_TOOLS_SOURCE  = lttng-tools-$(LTTNG_TOOLS_VERSION).tar.bz2
 # trace format into an human readable format.
 LTTNG_TOOLS_DEPENDENCIES = liburcu popt host-lttng-babeltrace lttng-libust
 
+LTTNG_AUTORECONF = YES
+
 $(eval $(call AUTOTARGETS))
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 2/7 lttng-tools: fix build on uClibc due to sync_file_range()

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Add a patch to use fdatasync() instead of sync_file_range() when the Thomas> latter is not available.

Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---

 Thomas>  ...ls-2.0-pre15-no-sync-file-range-in-uclibc.patch |   87 ++++++++++++++++++++
 Thomas>  package/lttng-tools/lttng-tools.mk                 |    2 +

Thomas> 2 files changed, 89 insertions(+), 0 deletions(-)
Thomas> create mode 100644 package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch

Thomas> diff --git a/package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch b/package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch Thomas> new file mode 100644
Thomas> index 0000000..861686b
Thomas> --- /dev/null
Thomas> +++ b/package/lttng-tools/lttng-tools-2.0-pre15-no-sync-file-range-in-uclibc.patch
Thomas> @@ -0,0 +1,87 @@
Thomas> +Make sync_file_range() usage optional
Thomas> +
Thomas> +Under uClibc, sync_file_range() is not available under all
Thomas> +architectures, so we fall back to fdatasync() in this case.

And as far as I can see, it's also only available if LFS support is present.

Committed, thanks. Don't forget to send patch upstream.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 3/7 lttng-babeltrace: make sure WCHAR and LARGEFILE are enabled

In reply to Thomas Petazzoni

Since lttng-babeltrace depends on util-linux and libglib2, we need to make sure WCHAR and LARGEFILE are enabled.

---
 package/lttng-babeltrace/Config.in |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
package/lttng-babeltrace/Config.in +8 -0
index e6f3845..6f47304 100644
@@ -4,6 +4,11 @@ config BR2_PACKAGE_LTTNG_BABELTRACE
 	select BR2_PACKAGE_UTIL_LINUX
 	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	select BR2_PACKAGE_LIBGLIB2
+	# libglib2 needs gettext which needs wchar support, and we
+	# also depends on util-linux which needs wchar
+	depends on BR2_USE_WCHAR
+	# util-linux depends on largefile support
+	depends on BR2_LARGEFILE
 	help
 	  Babeltrace is part of the LTTng 2.x project.
 
@@ -20,3 +25,6 @@ config BR2_PACKAGE_LTTNG_BABELTRACE
 	  lttng-tools package.
 
 	  http://lttng.org
+
+comment "lttng-babeltrace needs WCHAR and LARGEFILE support"
+	depends on BR2_PACKAGE_LTTNG_TOOLS && !(BR2_USE_WCHAR || BR2_LARGEFILE)
Signature · 1 line
1.7.4.1
#7 lore raw

PATCH 3/7 lttng-babeltrace: make sure WCHAR and LARGEFILE are enabled

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Since lttng-babeltrace depends on util-linux and libglib2, we need to Thomas> make sure WCHAR and LARGEFILE are enabled.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#8 lore raw

PATCH 4/7 lttng-libust: add the dependency on util-linux

In reply to Thomas Petazzoni

This dependency was missing in the initial addition of the package to Buildroot.

---
 package/lttng-libust/Config.in       |    8 ++++++++
 package/lttng-libust/lttng-libust.mk |    2 +-
 2 files changed, 9 insertions(+), 1 deletions(-)
package/lttng-libust/Config.in +8 -0
index 335a956..ae74bed 100644
@@ -1,6 +1,11 @@
 config BR2_PACKAGE_LTTNG_LIBUST
 	bool "lttng-libust"
 	select BR2_PACKAGE_LIBURCU
+	select BR2_PACKAGE_UTIL_LINUX
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	# util-linux needs wchar and largefile
+	depends on BR2_USE_WCHAR
+	depends on BR2_LARGEFILE
 	help
 	  Userspace tracing library for the Lttng tracing
 	  infrastructure. It allows userspace programs to create
@@ -8,3 +13,6 @@ config BR2_PACKAGE_LTTNG_LIBUST
 	  events gathered by LTTng.
 
 	  http://lttng.org
+
+comment "lttng-libust needs WCHAR and LARGEFILE support"
+	depends on !(BR2_USE_WCHAR || BR2_LARGEFILE)
package/lttng-libust/lttng-libust.mk +1 -1
index a2cef2a..ebe14ca 100644
@@ -3,6 +3,6 @@ LTTNG_LIBUST_VERSION = 1.9.2
 LTTNG_LIBUST_SOURCE  = lttng-ust-$(LTTNG_LIBUST_VERSION).tar.gz
 
 LTTNG_LIBUST_INSTALL_STAGING = YES
-LTTNG_LIBUST_DEPENDENCIES    = liburcu
+LTTNG_LIBUST_DEPENDENCIES    = liburcu util-linux
 
 $(eval $(call AUTOTARGETS))
Signature · 1 line
1.7.4.1
#9 lore raw

PATCH 4/7 lttng-libust: add the dependency on util-linux

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> This dependency was missing in the initial addition of the package to Thomas> Buildroot.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

PATCH 5/7 lttng-tools: make the dependency on lttng-libust optional

In reply to Thomas Petazzoni
---
 package/lttng-tools/Config.in      |    4 +++-
 package/lttng-tools/lttng-tools.mk |    9 ++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
package/lttng-tools/Config.in +3 -1
index cc74966..3040af6 100644
@@ -3,7 +3,6 @@ config BR2_PACKAGE_LTTNG_TOOLS
 	depends on BR2_PACKAGE_LTTNG_MODULES
 	select BR2_PACKAGE_LIBURCU
 	select BR2_PACKAGE_POPT
-	select BR2_PACKAGE_LTTNG_LIBUST
 	help
 	  Userspace utilities for the LTTng 2.0 tracing
 	  infrastructure.
@@ -17,4 +16,7 @@ config BR2_PACKAGE_LTTNG_TOOLS
 	  package for the target, if babeltrace on the target is
 	  interesting.
 
+	  If userspace tracing is desired, you need to enable
+	  lttng-libust.
+
 	  http://lttng.org
package/lttng-tools/lttng-tools.mk +8 -1
index bcf2f67..8e6fc1a 100644
@@ -6,8 +6,15 @@ LTTNG_TOOLS_SOURCE  = lttng-tools-$(LTTNG_TOOLS_VERSION).tar.bz2
 # dependency. However, having the babeltrace utilities built for the
 # host is very useful, since those tools allow to convert the binary
 # trace format into an human readable format.
-LTTNG_TOOLS_DEPENDENCIES = liburcu popt host-lttng-babeltrace lttng-libust
+LTTNG_TOOLS_DEPENDENCIES = liburcu popt host-lttng-babeltrace
 
 LTTNG_AUTORECONF = YES
 
+ifeq ($(BR2_PACKAGE_LTTNG_LIBUST),y)
+LTTNG_TOOLS_CONF_OPT += --enable-lttng-ust
+LTTNG_TOOLS_DEPENDENCIES += lttng-libust
+else
+LTTNG_TOOLS_CONF_OPT += --disable-lttng-ust
+endif
+
 $(eval $(call AUTOTARGETS))
Signature · 1 line
1.7.4.1
#11 lore raw

PATCH 5/7 lttng-tools: make the dependency on lttng-libust optional

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Signed-off-by: Thomas Petazzoni <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#12 lore raw

PATCH 6/7 lttng-libust: add patch to fix build issue when C++ support is not available

In reply to Thomas Petazzoni
---
 ...2-dont-build-cxx-tests-when-not-available.patch |   50 ++++++++++++++++++++
 package/lttng-libust/lttng-libust.mk               |    2 +
 2 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch
package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch new file +50 -0
new file mode 100644
index 0000000..b1b94b0
@@ -0,0 +1,50 @@
+Do not build C++ example if a C++ compiler isn't available
+
+By default lttng-ust builds a hello.cxx C++ example that demonstrates
+the usage of the userspace tracing library in a C++
+program. Unfortunately, when no C++ support isa available, the build
+of lttng-ust fails just because of this example code. So we make the
+compilation of this code conditional on whether a working C++ compiler
+was found.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: lttng-ust-1.9.2/configure.ac
+===================================================================
+--- lttng-ust-1.9.2.orig/configure.ac	2012-02-04 14:49:45.387325814 +0100
++++ lttng-ust-1.9.2/configure.ac	2012-02-04 14:50:08.156920117 +0100
+@@ -38,6 +38,18 @@
+ AC_PROG_MAKE_SET
+ LT_INIT
+ 
++# rw_PROG_CXX_WORKS
++# Check whether the C++ compiler works.
++AC_CACHE_CHECK([whether the C++ compiler works],
++               [rw_cv_prog_cxx_works],
++               [AC_LANG_PUSH([C++])
++                AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
++                               [rw_cv_prog_cxx_works=yes],
++                               [rw_cv_prog_cxx_works=no])
++                AC_LANG_POP([C++])])
++
++AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
++
+ ## Checks for libraries.
+ AC_CHECK_LIB([dl], [dlopen])
+ AC_CHECK_LIB([pthread], [pthread_create])
+Index: lttng-ust-1.9.2/tests/Makefile.am
+===================================================================
+--- lttng-ust-1.9.2.orig/tests/Makefile.am	2012-02-04 14:49:49.157258640 +0100
++++ lttng-ust-1.9.2/tests/Makefile.am	2012-02-04 14:50:15.096796474 +0100
+@@ -1,6 +1,10 @@
+-SUBDIRS = . hello fork ust-basic-tracing ust-multi-test demo hello.cxx
++SUBDIRS = . hello fork ust-basic-tracing ust-multi-test demo
+ #SUBDIRS = . hello2 basic basic_long simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker trace_event register_test tracepoint libustctl_function_tests exit-fast
+ 
++if CXX_WORKS
++SUBDIRS += hello.cxx
++endif
++
+ dist_noinst_SCRIPTS = test_loop runtests trace_matches
+ 
+ noinst_LIBRARIES = libtap.a
package/lttng-libust/lttng-libust.mk +2 -0
index ebe14ca..f54999e 100644
@@ -5,4 +5,6 @@ LTTNG_LIBUST_SOURCE  = lttng-ust-$(LTTNG_LIBUST_VERSION).tar.gz
 LTTNG_LIBUST_INSTALL_STAGING = YES
 LTTNG_LIBUST_DEPENDENCIES    = liburcu util-linux
 
+LTTNG_LIBUST_AUTORECONF = YES
+
 $(eval $(call AUTOTARGETS))
Signature · 1 line
1.7.4.1
#13 lore raw

PATCH 6/7 lttng-libust: add patch to fix build issue when C++ support is not available

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---

 Thomas>  ...2-dont-build-cxx-tests-when-not-available.patch |   50 ++++++++++++++++++++
 Thomas>  package/lttng-libust/lttng-libust.mk               |    2 +

Thomas> 2 files changed, 52 insertions(+), 0 deletions(-)
Thomas> create mode 100644 package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch

Thomas> diff --git a/package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch b/package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch Thomas> new file mode 100644
Thomas> index 0000000..b1b94b0
Thomas> --- /dev/null
Thomas> +++ b/package/lttng-libust/lttng-libust-1.9.2-dont-build-cxx-tests-when-not-available.patch
Thomas> @@ -0,0 +1,50 @@
Thomas> +Do not build C++ example if a C++ compiler isn't available
Thomas> +
Thomas> +By default lttng-ust builds a hello.cxx C++ example that demonstrates
Thomas> +the usage of the userspace tracing library in a C++
Thomas> +program. Unfortunately, when no C++ support isa available, the build

s/isa/is/. Otherwise it looks good, committed - Thanks.

Signature · 1 line
Bye, Peter Korsgaard
#14 lore raw

PATCH 7/7 lttng-babeltrace: fix build on uClibc due to missing posix_fallocate()

In reply to Thomas Petazzoni
---
 ...beltrace-0.8-no-posix-fallocate-in-uclibc.patch |   25 ++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch
package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch new file +25 -0
new file mode 100644
index 0000000..5ba7f1d
@@ -0,0 +1,25 @@
+Do not call posix_fallocate() on uClibc
+
+uClibc does not implement posix_fallocate(), and posix_fallocate() is
+mostly only an hint to the kernel that we will need such or such
+amount of space inside a file. So we just don't call posix_fallocate()
+when building against uClibc.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+
+Index: lttng-babeltrace-0.8/formats/ctf/ctf.c
+===================================================================
+--- lttng-babeltrace-0.8.orig/formats/ctf/ctf.c	2012-02-04 09:01:16.788552141 +0100
++++ lttng-babeltrace-0.8/formats/ctf/ctf.c	2012-02-04 09:01:33.638258644 +0100
+@@ -384,9 +384,11 @@
+ 		}
+ 		pos->content_size = -1U;	/* Unknown at this point */
+ 		pos->packet_size = WRITE_PACKET_LEN;
++#ifndef __UCLIBC__
+ 		off = posix_fallocate(pos->fd, pos->mmap_offset,
+ 				      pos->packet_size / CHAR_BIT);
+ 		assert(off >= 0);
++#endif
+ 		pos->offset = 0;
+ 	} else {
+ 	read_next_packet:
Signature · 1 line
1.7.4.1
#15 lore raw

PATCH 7/7 lttng-babeltrace: fix build on uClibc due to missing posix_fallocate()

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---

 Thomas>  ...beltrace-0.8-no-posix-fallocate-in-uclibc.patch |   25 ++++++++++++++++++++

Thomas> 1 files changed, 25 insertions(+), 0 deletions(-)
Thomas> create mode 100644 package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch

Thomas> diff --git a/package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch b/package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch Thomas> new file mode 100644
Thomas> index 0000000..5ba7f1d
Thomas> --- /dev/null
Thomas> +++ b/package/lttng-babeltrace/lttng-babeltrace-0.8-no-posix-fallocate-in-uclibc.patch
Thomas> @@ -0,0 +1,25 @@
Thomas> +Do not call posix_fallocate() on uClibc
Thomas> +
Thomas> +uClibc does not implement posix_fallocate(), and posix_fallocate() is
Thomas> +mostly only an hint to the kernel that we will need such or such
Thomas> +amount of space inside a file. So we just don't call posix_fallocate()
Thomas> +when building against uClibc.
Thomas> +
Thomas> +Signed-off-by: Thomas Petazzoni <[email protected]>

Normally you need to #include <features.h> to get the __UCLIBC__ define. I don't see any explicit includes of it anywhere in babeltrace, but presumably some of the headers indirectly include it.

I've added the explicit include to the patch and committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard