From ef7649497e06f4dfc4db78f52d53bae50c01b7e4 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 26 May 2016 15:49:40 -0500 Subject: testing/lttng-ust: new aport https://lttng.org LTTng 2.0 Userspace Tracer --- testing/lttng-ust/APKBUILD | 70 +++++++++++++++++++++++++++++++ testing/lttng-ust/add-glibc-ifdef.patch | 21 ++++++++++ testing/lttng-ust/glibc-strerr-r.patch | 11 +++++ testing/lttng-ust/limits-h.patch | 11 +++++ testing/lttng-ust/musl-sched-getcpu.patch | 39 +++++++++++++++++ 5 files changed, 152 insertions(+) create mode 100644 testing/lttng-ust/APKBUILD create mode 100644 testing/lttng-ust/add-glibc-ifdef.patch create mode 100644 testing/lttng-ust/glibc-strerr-r.patch create mode 100644 testing/lttng-ust/limits-h.patch create mode 100644 testing/lttng-ust/musl-sched-getcpu.patch (limited to 'testing') diff --git a/testing/lttng-ust/APKBUILD b/testing/lttng-ust/APKBUILD new file mode 100644 index 0000000000..9205f0aa9f --- /dev/null +++ b/testing/lttng-ust/APKBUILD @@ -0,0 +1,70 @@ +# Contributor: Michael Jeanson +# Maintainer: Michael Jeanson +pkgname=lttng-ust +pkgver=2.8.0 +pkgrel=0 +pkgdesc="LTTng 2.0 Userspace Tracer" +url="https://lttng.org" +arch="all" +license="LGPL2+" +depends="" +depends_dev="" +makedepends="$depends_dev userspace-rcu-dev util-linux-dev bash" +install="" +subpackages="$pkgname-dev $pkgname-doc" +source="https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2 + add-glibc-ifdef.patch + musl-sched-getcpu.patch + limits-h.patch + glibc-strerr-r.patch" + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure \ + --prefix=/usr \ + || return 1 + make || return 1 + make check || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 +} + +dev() { + default_dev + # Move back examples files that are wrongly included + # by the default dev splitfunc + cp -pr "$subpkgdir"/usr/share/doc/$pkgname \ + "$pkgdir"/usr/share/doc/ + rm -rf "$subpkgdir"/usr/share/doc/$pkgname +} + +md5sums="7b14452e7303dc4bc8475f1415223318 lttng-ust-2.8.0.tar.bz2 +4bd907494a789071aab14608285b3191 add-glibc-ifdef.patch +2189378d85923ce21a1cb4041596cd6c musl-sched-getcpu.patch +425eca46145ddfcb2efb1409a4904311 limits-h.patch +6eac280be76be9b4b1e1236ff52d9c9b glibc-strerr-r.patch" +sha256sums="6df651e56951ac233d36992f306aca8dbf065d2b0f0986d9a4863b6544ae7bb3 lttng-ust-2.8.0.tar.bz2 +985c6c15790117b6c8280342cc3ab310b58c3766d9585955f2530e3cdf2d89e1 add-glibc-ifdef.patch +581c59bd2766b0afd0e8ee1a6b0a7711210b8e3915b7592282c5dcb5a4a0537e musl-sched-getcpu.patch +e7ddc8ee806ed3cfc8df4788f537c8ca59c9d376352ba89e4ab692ea20032228 limits-h.patch +be829191bfbd5fa6004d6de73704cd49fd7a612b1685218912f660de30fbf0be glibc-strerr-r.patch" +sha512sums="7705e950539d61ec599d762d2a7aef59a10c2f692e2cfe735cd887ba706d478ae99b16292c2043ed868e93211e413c04c684d679cedd822e9ed22485288f5868 lttng-ust-2.8.0.tar.bz2 +dabe48d51370bc1063c18a215b9820b8217f8c84b6c2fa11ee823edc89222c3c3d8712be32fce61c9fd2da5902a881b0bdd451c3420583dffc36e41ea4f5fc2d add-glibc-ifdef.patch +29d5e856966a9489a608c6aa915a3a9a800cdfd13af0df28f3420fa1438bb0361e0670182b96710adb49076a254c48225410b52a3f6a67f96a024f4bc93e2494 musl-sched-getcpu.patch +e5b7549c25b4ed9aeb0240dda00f6010424d7d2747c6e19325d0b162b89aa7ef609667f7564d4b0a703e967ca1f0b3dda110a2d3e0b81b281e0d82566d9f74ec limits-h.patch +8d3ff539d07eafd66a83ac6196706c7eda6bfef9a86d32df307a6fa9860675b2e610419e9009021f01236298be43da9f7b883eff9586354768ad767e8482db2b glibc-strerr-r.patch" diff --git a/testing/lttng-ust/add-glibc-ifdef.patch b/testing/lttng-ust/add-glibc-ifdef.patch new file mode 100644 index 0000000000..b367b922b9 --- /dev/null +++ b/testing/lttng-ust/add-glibc-ifdef.patch @@ -0,0 +1,21 @@ +--- lttng-ust-2.8.0.orig/include/lttng/ust-dlfcn.h ++++ lttng-ust-2.8.0/include/lttng/ust-dlfcn.h +@@ -31,6 +31,8 @@ + #error "Please include lttng/ust-dlfcn.h before dlfcn.h." + #endif /* _DLFCN_H */ + ++#ifdef __GLIBC__ ++ + /* + * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see + * THROW annotation). Unfortunately, this is not in sync with reality, +@@ -57,5 +59,9 @@ + extern void *dlsym(void *__restrict __handle, + __const char *__restrict __name) __nonnull ((2)); + extern char *dlerror(void); ++ ++#else ++#include ++#endif /* __GLIBC__ */ + + #endif /* _LTTNG_UST_DLFCN_H */ diff --git a/testing/lttng-ust/glibc-strerr-r.patch b/testing/lttng-ust/glibc-strerr-r.patch new file mode 100644 index 0000000000..fa774139d9 --- /dev/null +++ b/testing/lttng-ust/glibc-strerr-r.patch @@ -0,0 +1,11 @@ +--- lttng-ust-2.8.0.orig/include/usterr-signal-safe.h ++++ lttng-ust-2.8.0/include/usterr-signal-safe.h +@@ -106,7 +106,7 @@ + #define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args) + #define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args) + +-#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) ++#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) + /* + * Version using XSI strerror_r. + */ diff --git a/testing/lttng-ust/limits-h.patch b/testing/lttng-ust/limits-h.patch new file mode 100644 index 0000000000..6492823a09 --- /dev/null +++ b/testing/lttng-ust/limits-h.patch @@ -0,0 +1,11 @@ +--- lttng-ust-2.8.0.orig/tests/ust-elf/prog.c ++++ lttng-ust-2.8.0/tests/ust-elf/prog.c +@@ -16,7 +16,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#include ++#include + #include + #include + #include diff --git a/testing/lttng-ust/musl-sched-getcpu.patch b/testing/lttng-ust/musl-sched-getcpu.patch new file mode 100644 index 0000000000..48f3b43e51 --- /dev/null +++ b/testing/lttng-ust/musl-sched-getcpu.patch @@ -0,0 +1,39 @@ +--- lttng-ust-2.8.0.orig/libringbuffer/getcpu.h ++++ lttng-ust-2.8.0/libringbuffer/getcpu.h +@@ -47,10 +47,6 @@ + */ + #ifdef __linux__ + +-/* old uClibc versions didn't have sched_getcpu */ +-#if defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && \ +- (__UCLIBC_MINOR__ < 9 || \ +- (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32)) + #include + #define __getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache) + /* +@@ -64,25 +60,8 @@ + ret = __getcpu(&cpu, NULL, NULL); + if (caa_unlikely(ret < 0)) + return 0; +- return c; +-} +-#else /* __UCLIBC__ */ +-#include +- +-/* +- * If getcpu is not implemented in the kernel, use cpu 0 as fallback. +- */ +-static inline +-int lttng_ust_get_cpu_internal(void) +-{ +- int cpu; +- +- cpu = sched_getcpu(); +- if (caa_unlikely(cpu < 0)) +- return 0; + return cpu; + } +-#endif /* __UCLIBC__ */ + + #elif (defined(__FreeBSD__) || defined(__CYGWIN__)) + -- cgit v1.2.3