From 75a29edff3018f56afafbca0a09be444d3f23af6 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 13 Nov 2024 14:55:44 -0500 Subject: [PATCH] lttng-ctl: Use max possible CPUs for per-CPU memory estimation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As of 2.13.4, LTTng-UST uses the max possible CPU count for per-CPU allocations. See lttng-ust commit 66dbdc3448a77043d0fd59f47b17e77a8d59fddb ("fix: num_possible_cpus() with hot-unplugged CPUs"). Change-Id: Ia4eb25988a268f48065903617ed59a5fdecb2ab9 Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- src/lib/lttng-ctl/lttng-ctl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/lttng-ctl/lttng-ctl.cpp b/src/lib/lttng-ctl/lttng-ctl.cpp index 24733e82e..8ba7d657a 100644 --- a/src/lib/lttng-ctl/lttng-ctl.cpp +++ b/src/lib/lttng-ctl/lttng-ctl.cpp @@ -309,8 +309,9 @@ static enum lttng_error_code check_enough_available_memory(uint64_t num_bytes_re * Get the number of CPU currently online to compute the amount of * memory needed to create a buffer for every CPU. */ - num_cpu = sysconf(_SC_NPROCESSORS_ONLN); - if (num_cpu == -1) { + try { + num_cpu = long(utils_get_cpu_count()); + } catch (const std::exception& ex) { ret_code = LTTNG_ERR_FATAL; goto end; } -- 2.39.5