]> git.lttng.org Git - lttng-tools.git/commitdiff
lttng-ctl: Use max possible CPUs for per-CPU memory estimation
authorKienan Stewart <kstewart@efficios.com>
Wed, 13 Nov 2024 19:55:44 +0000 (14:55 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 Dec 2024 18:35:04 +0000 (13:35 -0500)
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 <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/lttng-ctl.cpp

index 24733e82e006fa3a2cd6b0b1bd3da5cc5752c8f4..8ba7d657af924aa0f0312d10bd4dd259f31e7ef3 100644 (file)
@@ -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;
        }
This page took 0.030581 seconds and 4 git commands to generate.