X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail.efficios.com (mail.efficios.com [167.114.142.138]) by lists.alpinelinux.org (Postfix) with ESMTP id E273DF81718 for ; Wed, 20 Mar 2019 16:34:55 +0000 (UTC) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id EEBEE1C37B6 for ; Wed, 20 Mar 2019 12:34:54 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id h1VqicarTmdF; Wed, 20 Mar 2019 12:34:54 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 9713E1C37B0; Wed, 20 Mar 2019 12:34:54 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 9713E1C37B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1553099694; bh=gXc0FGyQx/5tsVwzYhzJefLwN1jm3xkPD6CxB4mx3Lg=; h=From:To:Date:Message-Id:MIME-Version; b=LemDyv1WQZwPkAuDatHZvFsuv4gEmfuWTz2PMrnCAqy59lwiVCT8ZoH6U4qJLxuEe HnRPCfEATctOAXe+JpWnTl7VI0qedJ+admYPJRMdQfaf9Z5O85qr+arRGhChywN9fa yCr40LJ7YrGmJNyvLPIeYhgrWmN/WgN24a665wZasjCYx/pl8e4XdxcLv7cK5B29AU g3GohkfkeB/aoz29hmVk9Fxu24wHjkPJjkRGXGIBeqgeoDd+qh/kqh9KDiZ68Gt0zf +lopPa7RJsUiOQvfTDgsK00+1kHGD6ZtLr9bBEwRPK05NsxUjxOpVmspzS5l4YcGPF 1ZfwDKWNCyFuQ== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id ExhS6hZgDkIi; Wed, 20 Mar 2019 12:34:54 -0400 (EDT) Received: from alpine.my.domain (192-222-157-41.qc.cable.ebox.net [192.222.157.41]) by mail.efficios.com (Postfix) with ESMTPSA id 5F1411C37AB; Wed, 20 Mar 2019 12:34:54 -0400 (EDT) From: Michael Jeanson To: alpine-aports@lists.alpinelinux.org Cc: Michael Jeanson Subject: [alpine-aports] [PATCH v2] main/lttng-ust: upgrade to 2.10.3 Date: Wed, 20 Mar 2019 11:34:43 -0500 Message-Id: <20190320163443.19099-1-mjeanson@efficios.com> X-Mailer: git-send-email 2.21.0 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable --- ...c5baf1565ba1daa2b96f5e4a297571c505b4.patch | 103 ++++++++++++++++++ main/lttng-ust/APKBUILD | 10 +- 2 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505= b4.patch diff --git a/main/lttng-ust/13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patc= h 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 +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 +Signed-off-by: Mathieu Desnoyers +--- + 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 ++ * Copyright (C) 2019 Michael Jeanson + * + * 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 @@ +=20 + int __num_possible_cpus; +=20 ++#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 =3D result; + } ++ ++#else ++ ++/* ++ * The MUSL libc implementation of the _SC_NPROCESSORS_CONF sysconf doe= s 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 f= rom ++ * sysconf if it fails. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define __max(a,b) ((a)>(b)?(a):(b)) ++ ++void _get_num_possible_cpus(void) ++{ ++ int result, count =3D 0; ++ DIR *cpudir; ++ struct dirent *entry; ++ ++ cpudir =3D opendir("/sys/devices/system/cpu"); ++ if (cpudir =3D=3D NULL) ++ goto end; ++ ++ /* ++ * Count the number of directories named "cpu" followed by and ++ * integer. This is the same strategy as glibc uses. ++ */ ++ while ((entry =3D readdir(cpudir))) { ++ if (entry->d_type =3D=3D DT_DIR && ++ strncmp(entry->d_name, "cpu", 3) =3D=3D 0) { ++ ++ char *endptr; ++ unsigned long cpu_num; ++ ++ cpu_num =3D strtoul(entry->d_name + 3, &endptr, 10); ++ if ((cpu_num < ULONG_MAX) && (endptr !=3D entry->d_name + 3) ++ && (*endptr =3D=3D '\0')) { ++ count++; ++ } ++ } ++ } ++ ++end: ++ /* ++ * Get the sysconf value as a fallback. Keep the highest number. ++ */ ++ result =3D __max(sysconf(_SC_NPROCESSORS_CONF), count); ++ ++ /* ++ * If both methods failed, don't store the value. ++ */ ++ if (result < 1) ++ return; ++ __num_possible_cpus =3D 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 # Maintainer: Michael Jeanson pkgname=3Dlttng-ust -pkgver=3D2.10.1 +pkgver=3D2.10.3 pkgrel=3D0 pkgdesc=3D"LTTng 2.0 Userspace Tracer" url=3D"https://lttng.org" arch=3D"all" -license=3D"LGPL-2.0-or-later" +license=3D"LGPL-2.1-or-later" makedepends=3D"userspace-rcu-dev>0.10 util-linux-dev linux-headers bash" install=3D"" subpackages=3D"$pkgname-doc $pkgname-dev" -source=3D"https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2" +source=3D"https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2 + 13d2c5baf1565ba1daa2b96f5e4a297571c505b4.patch" =20 builddir=3D"$srcdir"/$pkgname-$pkgver =20 @@ -34,4 +35,5 @@ package() { make DESTDIR=3D"$pkgdir" install } =20 -sha512sums=3D"bd9b75ff359a8698ba4f7b6a27d9958c8bd9539fd43d8f1bc4bb400032= 71c9074f1bb4176d074bac290fad1636d5a3226063275006b781f3533567dea71fac96 l= ttng-ust-2.10.1.tar.bz2" +sha512sums=3D"6f646de3a12dbad096014f3069c3e702fb54b824b78770e777f6f877c7= 6ffc48fae863b10c432bff1bba29caafdb5b76cb2b9cb88eb7340d5121300d2c0ff65d l= ttng-ust-2.10.3.tar.bz2 +c91ea6ad2085f13de0508d0f238582bcd12f0460cb00f482a85fa5cfe8ec4ce675c084af= 27387f63cec9cc83430ca80fb995b289f44b515888efb796a97dc320 13d2c5baf1565ba= 1daa2b96f5e4a297571c505b4.patch" --=20 2.21.0 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---