Patches for aports can be sent to this list

2 2

[alpine-aports] [PATCH v2] main/lttng-ust: upgrade to 2.10.3

Michael Jeanson
Details
Message ID
<20190320163443.19099-1-mjeanson@efficios.com>
Sender timestamp
1553099683
DKIM signature
missing
Download raw message
Patch: +109 -4
---
 ...c5baf1565ba1daa2b96f5e4a297571c505b4.patch | 103 ++++++++++++++++++
 main/lttng-ust/APKBUILD                       |  10 +-
 2 files changed, 109 insertions(+), 4 deletions(-)
 create mode 100644 main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch

diff --git a/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch b/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch
new file mode 100644
index 0000000000..6d770e30f8
--- /dev/null
+++ b/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch
@@ -0,0 +1,103 @@
+From 13d2c5baf1565ba1daa2b96f5e4a297571c505b4 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Wed, 20 Mar 2019 11:07:35 -0400
+Subject: [PATCH] compat: work around broken _SC_NPROCESSORS_CONF on MUSL libc
+
+On MUSL libc the _SC_NPROCESSORS_CONF sysconf will report the number of
+CPUs allocated to the task based on the affinity mask instead of the
+total number of CPUs configured on the system.
+
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ libringbuffer/smp.c | 66 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+
+diff --git a/libringbuffer/smp.c b/libringbuffer/smp.c
+index 9e7114be..656a75da 100644
+--- a/libringbuffer/smp.c
+@@ -2,6 +2,7 @@
+  * libringbuffer/smp.c
+  *
+  * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
++ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -26,6 +27,7 @@
+ 
+ int __num_possible_cpus;
+ 
++#if (defined(__GLIBC__) || defined( __UCLIBC__))
+ void _get_num_possible_cpus(void)
+ {
+ 	int result;
+@@ -43,3 +45,67 @@ void _get_num_possible_cpus(void)
+ 		return;
+ 	__num_possible_cpus = result;
+ }
++
++#else
++
++/*
++ * The MUSL libc implementation of the _SC_NPROCESSORS_CONF sysconf does not
++ * return the number of configured CPUs in the system but relies on the cpu
++ * affinity mask of the current task.
++ *
++ * So instead we use a strategy similar to GLIBC's, counting the cpu
++ * directories in "/sys/devices/system/cpu" and fallback on the value from
++ * sysconf if it fails.
++ */
++
++#include <dirent.h>
++#include <limits.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/types.h>
++
++#define __max(a,b) ((a)>(b)?(a):(b))
++
++void _get_num_possible_cpus(void)
++{
++	int result, count = 0;
++	DIR *cpudir;
++	struct dirent *entry;
++
++	cpudir = opendir("/sys/devices/system/cpu");
++	if (cpudir == NULL)
++		goto end;
++
++	/*
++	 * Count the number of directories named "cpu" followed by and
++	 * integer. This is the same strategy as glibc uses.
++	 */
++	while ((entry = readdir(cpudir))) {
++		if (entry->d_type == DT_DIR &&
++			strncmp(entry->d_name, "cpu", 3) == 0) {
++
++			char *endptr;
++			unsigned long cpu_num;
++
++			cpu_num = strtoul(entry->d_name + 3, &endptr, 10);
++			if ((cpu_num < ULONG_MAX) && (endptr != entry->d_name + 3)
++					&& (*endptr == '\0')) {
++				count++;
++			}
++		}
++	}
++
++end:
++	/*
++	 * Get the sysconf value as a fallback. Keep the highest number.
++	 */
++	result = __max(sysconf(_SC_NPROCESSORS_CONF), count);
++
++	/*
++	 * If both methods failed, don't store the value.
++	 */
++	if (result < 1)
++		return;
++	__num_possible_cpus = result;
++}
++#endif
diff --git a/main/lttng-ust/APKBUILD b/main/lttng-ust/APKBUILD
index d78437b316..1c37424c6a 100644
--- a/main/lttng-ust/APKBUILD
+++ b/main/lttng-ust/APKBUILD
@@ -1,16 +1,17 @@
 # Contributor: Michael Jeanson <mjeanson@efficios.com>
 # Maintainer: Michael Jeanson <mjeanson@efficios.com>
 pkgname=lttng-ust
-pkgver=2.10.1
+pkgver=2.10.3
 pkgrel=0
 pkgdesc="LTTng 2.0 Userspace Tracer"
 url="https://lttng.org"
 arch="all"
-license="LGPL-2.0-or-later"
+license="LGPL-2.1-or-later"
 makedepends="userspace-rcu-dev>0.10 util-linux-dev linux-headers bash"
 install=""
 subpackages="$pkgname-doc $pkgname-dev"
-source="https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2"
+source="https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2
+	13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch"
 
 builddir="$srcdir"/$pkgname-$pkgver
 
@@ -34,4 +35,5 @@ package() {
 	make DESTDIR="$pkgdir" install
 }
 
-sha512sums="bd9b75ff359a8698ba4f7b6a27d9958c8bd9539fd43d8f1bc4bb40003271c9074f1bb4176d074bac290fad1636d5a3226063275006b781f3533567dea71fac96  lttng-ust-2.10.1.tar.bz2"
+sha512sums="6f646de3a12dbad096014f3069c3e702fb54b824b78770e777f6f877c76ffc48fae863b10c432bff1bba29caafdb5b76cb2b9cb88eb7340d5121300d2c0ff65d  lttng-ust-2.10.3.tar.bz2
+c91ea6ad2085f13de0508d0f238582bcd12f0460cb00f482a85fa5cfe8ec4ce675c084af27387f63cec9cc83430ca80fb995b289f44b515888efb796a97dc320  13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch"
-- 
2.21.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Leonardo
Details
Message ID
<40966c57-4b33-8c7a-7ae9-a44c9d26da46@gmail.com>
In-Reply-To
<20190320163443.19099-1-mjeanson@efficios.com> (view parent)
Sender timestamp
1554282567
DKIM signature
missing
Download raw message
Hi,

On 3/20/19 5:34 PM, Michael Jeanson wrote:
> ---
>   ...c5baf1565ba1daa2b96f5e4a297571c505b4.patch | 103 ++++++++++++++++++
>   main/lttng-ust/APKBUILD                       |  10 +-
>   2 files changed, 109 insertions(+), 4 deletions(-)
>   create mode 100644 main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch

it fails here with:

make[4]: Leaving directory 
'/home/larena/aports/main/lttng-ust/src/lttng-ust-2.10.3/doc/examples/demo-tracelog'
/bin/sh: ../../config/install-sh: not found
make[3]: *** [Makefile:979: all-local] Error 1

Can you replicate the issue?

Thanks!

/eo






> diff --git a/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch b/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch
> new file mode 100644
> index 0000000000..6d770e30f8
> --- /dev/null
> +++ b/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch
> @@ -0,0 +1,103 @@
> +From 13d2c5baf1565ba1daa2b96f5e4a297571c505b4 Mon Sep 17 00:00:00 2001
> +From: Michael Jeanson <mjeanson@efficios.com>
> +Date: Wed, 20 Mar 2019 11:07:35 -0400
> +Subject: [PATCH] compat: work around broken _SC_NPROCESSORS_CONF on MUSL libc
> +
> +On MUSL libc the _SC_NPROCESSORS_CONF sysconf will report the number of
> +CPUs allocated to the task based on the affinity mask instead of the
> +total number of CPUs configured on the system.
> +
> +Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> +Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> +---
> + libringbuffer/smp.c | 66 +++++++++++++++++++++++++++++++++++++++++++++
> + 1 file changed, 66 insertions(+)
> +
> +diff --git a/libringbuffer/smp.c b/libringbuffer/smp.c
> +index 9e7114be..656a75da 100644
> +--- a/libringbuffer/smp.c
> ++++ b/libringbuffer/smp.c
> +@@ -2,6 +2,7 @@
> +  * libringbuffer/smp.c
> +  *
> +  * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> ++ * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
> +  *
> +  * This library is free software; you can redistribute it and/or
> +  * modify it under the terms of the GNU Lesser General Public
> +@@ -26,6 +27,7 @@
> +
> + int __num_possible_cpus;
> +
> ++#if (defined(__GLIBC__) || defined( __UCLIBC__))
> + void _get_num_possible_cpus(void)
> + {
> + 	int result;
> +@@ -43,3 +45,67 @@ void _get_num_possible_cpus(void)
> + 		return;
> + 	__num_possible_cpus = result;
> + }
> ++
> ++#else
> ++
> ++/*
> ++ * The MUSL libc implementation of the _SC_NPROCESSORS_CONF sysconf does not
> ++ * return the number of configured CPUs in the system but relies on the cpu
> ++ * affinity mask of the current task.
> ++ *
> ++ * So instead we use a strategy similar to GLIBC's, counting the cpu
> ++ * directories in "/sys/devices/system/cpu" and fallback on the value from
> ++ * sysconf if it fails.
> ++ */
> ++
> ++#include <dirent.h>
> ++#include <limits.h>
> ++#include <stdlib.h>
> ++#include <string.h>
> ++#include <sys/types.h>
> ++
> ++#define __max(a,b) ((a)>(b)?(a):(b))
> ++
> ++void _get_num_possible_cpus(void)
> ++{
> ++	int result, count = 0;
> ++	DIR *cpudir;
> ++	struct dirent *entry;
> ++
> ++	cpudir = opendir("/sys/devices/system/cpu");
> ++	if (cpudir == NULL)
> ++		goto end;
> ++
> ++	/*
> ++	 * Count the number of directories named "cpu" followed by and
> ++	 * integer. This is the same strategy as glibc uses.
> ++	 */
> ++	while ((entry = readdir(cpudir))) {
> ++		if (entry->d_type == DT_DIR &&
> ++			strncmp(entry->d_name, "cpu", 3) == 0) {
> ++
> ++			char *endptr;
> ++			unsigned long cpu_num;
> ++
> ++			cpu_num = strtoul(entry->d_name + 3, &endptr, 10);
> ++			if ((cpu_num < ULONG_MAX) && (endptr != entry->d_name + 3)
> ++					&& (*endptr == '\0')) {
> ++				count++;
> ++			}
> ++		}
> ++	}
> ++
> ++end:
> ++	/*
> ++	 * Get the sysconf value as a fallback. Keep the highest number.
> ++	 */
> ++	result = __max(sysconf(_SC_NPROCESSORS_CONF), count);
> ++
> ++	/*
> ++	 * If both methods failed, don't store the value.
> ++	 */
> ++	if (result < 1)
> ++		return;
> ++	__num_possible_cpus = result;
> ++}
> ++#endif
> diff --git a/main/lttng-ust/APKBUILD b/main/lttng-ust/APKBUILD
> index d78437b316..1c37424c6a 100644
> --- a/main/lttng-ust/APKBUILD
> +++ b/main/lttng-ust/APKBUILD
> @@ -1,16 +1,17 @@
>   # Contributor: Michael Jeanson <mjeanson@efficios.com>
>   # Maintainer: Michael Jeanson <mjeanson@efficios.com>
>   pkgname=lttng-ust
> -pkgver=2.10.1
> +pkgver=2.10.3
>   pkgrel=0
>   pkgdesc="LTTng 2.0 Userspace Tracer"
>   url="https://lttng.org"
>   arch="all"
> -license="LGPL-2.0-or-later"
> +license="LGPL-2.1-or-later"
>   makedepends="userspace-rcu-dev>0.10 util-linux-dev linux-headers bash"
>   install=""
>   subpackages="$pkgname-doc $pkgname-dev"
> -source="https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2"
> +source="https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2
> +	13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch"
>   
>   builddir="$srcdir"/$pkgname-$pkgver
>   
> @@ -34,4 +35,5 @@ package() {
>   	make DESTDIR="$pkgdir" install
>   }
>   
> -sha512sums="bd9b75ff359a8698ba4f7b6a27d9958c8bd9539fd43d8f1bc4bb40003271c9074f1bb4176d074bac290fad1636d5a3226063275006b781f3533567dea71fac96  lttng-ust-2.10.1.tar.bz2"
> +sha512sums="6f646de3a12dbad096014f3069c3e702fb54b824b78770e777f6f877c76ffc48fae863b10c432bff1bba29caafdb5b76cb2b9cb88eb7340d5121300d2c0ff65d  lttng-ust-2.10.3.tar.bz2
> +c91ea6ad2085f13de0508d0f238582bcd12f0460cb00f482a85fa5cfe8ec4ce675c084af27387f63cec9cc83430ca80fb995b289f44b515888efb796a97dc320  13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch"


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Michael Jeanson
Details
Message ID
<6f794e4f-66e4-0e3f-3dba-84abc77421a0@efficios.com>
In-Reply-To
<40966c57-4b33-8c7a-7ae9-a44c9d26da46@gmail.com> (view parent)
Sender timestamp
1554825251
DKIM signature
missing
Download raw message
Hi,

On 2019-04-03 5:09 a.m., Leonardo wrote:
> Hi,
> 
> On 3/20/19 5:34 PM, Michael Jeanson wrote:
>> ---
>>   ...c5baf1565ba1daa2b96f5e4a297571c505b4.patch | 103 ++++++++++++++++++
>>   main/lttng-ust/APKBUILD                       |  10 +-
>>   2 files changed, 109 insertions(+), 4 deletions(-)
>>   create mode 100644
>> main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch
> 
> it fails here with:
> 
> make[4]: Leaving directory
> '/home/larena/aports/main/lttng-ust/src/lttng-ust-2.10.3/doc/examples/demo-tracelog'
> 
> /bin/sh: ../../config/install-sh: not found
> make[3]: *** [Makefile:979: all-local] Error 1
> 
> Can you replicate the issue?
> 
> Thanks!
> 
> /eo

I rebuilt the package on my alpine edge system and I can't replicate the
problem, can you try a fresh build and send the full log?

Thanks,

Michael



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---