diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-04-05 22:28:33 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-04-05 22:31:28 +0300 |
commit | 193236933b0f4ab91b1625b64e2187e2db4e0e8f (patch) | |
tree | e12769d7c76d8b0517d6de3d3c72189753d253ed /poky/meta/recipes-kernel/lttng/lttng-ust | |
parent | bd93df9478f2f56ffcbc8cb88f1709c735dcd85b (diff) | |
download | openbmc-193236933b0f4ab91b1625b64e2187e2db4e0e8f.tar.xz |
reset upstream subtrees to HEAD
Reset the following subtrees on HEAD:
poky: 8217b477a1(master)
meta-xilinx: 64aa3d35ae(master)
meta-openembedded: 0435c9e193(master)
meta-raspberrypi: 490a4441ac(master)
meta-security: cb6d1c85ee(master)
Squashed patches:
meta-phosphor: drop systemd 239 patches
meta-phosphor: mrw-api: use correct install path
Change-Id: I268e2646d9174ad305630c6bbd3fbc1a6105f43d
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-kernel/lttng/lttng-ust')
-rw-r--r-- | poky/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/poky/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch b/poky/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch new file mode 100644 index 000000000..5c4bd3672 --- /dev/null +++ b/poky/meta/recipes-kernel/lttng/lttng-ust/0001-compat-work-around-broken-_SC_NPROCESSORS_CONF-on-MU.patch @@ -0,0 +1,109 @@ +From 5de7c318804a7b1edce8562d4891b4c74aac0677 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. + +Upstream-Status: Accepted [1] [5de7c318804a7b1edce8562d4891b4c74aac0677] +[1] https://lists.lttng.org/pipermail/lttng-dev/2019-March/028616.html + +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 +-- +2.17.1 + |