From dc25e9525495e00940da7716cbba6bca96423acd Mon Sep 17 00:00:00 2001 From: Zang Ruochen Date: Wed, 19 Jun 2019 15:14:40 +0800 Subject: lttng-ust:upgrade 2.10.3 -> 2.10.4 -Upgrade from lttng-ust_2.10.3.bb to lttng-ust_2.10.4.bb. -lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch Removed since this is included in 2.10.4 Signed-off-by: Zang Ruochen Signed-off-by: Richard Purdie --- ...-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch | 109 --------------------- meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb | 49 --------- meta/recipes-kernel/lttng/lttng-ust_2.10.4.bb | 48 +++++++++ 3 files changed, 48 insertions(+), 158 deletions(-) delete mode 100644 meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch delete mode 100644 meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb create mode 100644 meta/recipes-kernel/lttng/lttng-ust_2.10.4.bb diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch deleted file mode 100644 index 5c4bd36726..0000000000 --- a/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 5de7c318804a7b1edce8562d4891b4c74aac0677 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. - -Upstream-Status: Accepted [1] [5de7c318804a7b1edce8562d4891b4c74aac0677] -[1] https://lists.lttng.org/pipermail/lttng-dev/2019-March/028616.html - -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 @@ - - 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 -+#include -+#include -+#include -+#include -+ -+#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 --- -2.17.1 - diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb b/meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb deleted file mode 100644 index d546104129..0000000000 --- a/meta/recipes-kernel/lttng/lttng-ust_2.10.3.bb +++ /dev/null @@ -1,49 +0,0 @@ -SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x" -DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes." -HOMEPAGE = "http://lttng.org/ust" -BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust" - -LICENSE = "LGPLv2.1+ & MIT & GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \ - file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \ - file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44" - -PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ - am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ - PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ -" - -inherit autotools lib_package manpages python3native - -DEPENDS = "liburcu util-linux" -RDEPENDS_${PN}-bin = "python3-core" - -# For backwards compatibility after rename -RPROVIDES_${PN} = "lttng2-ust" -RREPLACES_${PN} = "lttng2-ust" -RCONFLICTS_${PN} = "lttng2-ust" - -PE = "2" - -SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \ - file://lttng-ust-doc-examples-disable.patch \ - file://0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch \ - " - -SRC_URI[md5sum] = "ffcfa8c1ba9a52f002d240e936e9afa2" -SRC_URI[sha256sum] = "9e8420f90d5f963f7aa32bc6d44adc1e491136f687c69ffb7a3075d33b40852b" - -CVE_PRODUCT = "ust" - -PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" -PACKAGECONFIG[python3-agent] = "--enable-python-agent ${PYTHON_OPTION}, --disable-python-agent, python3, python3" - -FILES_${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*" -FILES_${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a" -FILES_${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la" - -do_install_append() { - # Patch python tools to use Python 3; they should be source compatible, but - # still refer to Python 2 in the shebang - sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp -} diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.10.4.bb b/meta/recipes-kernel/lttng/lttng-ust_2.10.4.bb new file mode 100644 index 0000000000..a8eebb223b --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust_2.10.4.bb @@ -0,0 +1,48 @@ +SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x" +DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes." +HOMEPAGE = "http://lttng.org/ust" +BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust" + +LICENSE = "LGPLv2.1+ & MIT & GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \ + file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \ + file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44" + +PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ + am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ + PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ +" + +inherit autotools lib_package manpages python3native + +DEPENDS = "liburcu util-linux" +RDEPENDS_${PN}-bin = "python3-core" + +# For backwards compatibility after rename +RPROVIDES_${PN} = "lttng2-ust" +RREPLACES_${PN} = "lttng2-ust" +RCONFLICTS_${PN} = "lttng2-ust" + +PE = "2" + +SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \ + file://lttng-ust-doc-examples-disable.patch \ + " + +SRC_URI[md5sum] = "19916ff0dec23c90f985586a8cbd1fd2" +SRC_URI[sha256sum] = "75d5b4bb205c444a343e1297e14cd3a2503fc645a26710531cbd319c72c1a967" + +CVE_PRODUCT = "ust" + +PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" +PACKAGECONFIG[python3-agent] = "--enable-python-agent ${PYTHON_OPTION}, --disable-python-agent, python3, python3" + +FILES_${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*" +FILES_${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a" +FILES_${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la" + +do_install_append() { + # Patch python tools to use Python 3; they should be source compatible, but + # still refer to Python 2 in the shebang + sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp +} -- cgit 1.2.3-korg