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>
* 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;
}