get_possible_cpus_array_len internally opens and closes file
descriptors. Initialize the cache with fd tracker lock held to prevent
concurrent use of close/closeall/closefrom.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ib16c73f11af0b0cb163b38b0b096a86f6ae86325
#include "lib/lttng-ust/futex.h"
#include "common/ustcomm.h"
#include "common/ust-fd.h"
#include "lib/lttng-ust/futex.h"
#include "common/ustcomm.h"
#include "common/ust-fd.h"
#include "common/logging.h"
#include "common/macros.h"
#include "common/tracepoint.h"
#include "common/logging.h"
#include "common/macros.h"
#include "common/tracepoint.h"
lttng_ust_tp_init();
lttng_ust_statedump_init();
lttng_ust_tp_init();
lttng_ust_statedump_init();
+ /*
+ * Populate possible cpus array len cache with the fd tracker
+ * lock held.
+ */
+ lttng_ust_lock_fd_tracker();
+ (void) get_possible_cpus_array_len();
+ lttng_ust_unlock_fd_tracker();
lttng_ust_ring_buffer_clients_init();
lttng_ust_counter_clients_init();
lttng_perf_counter_init();
lttng_ust_ring_buffer_clients_init();
lttng_ust_counter_clients_init();
lttng_perf_counter_init();