From cf914d169665d78854f6d0e1c8ff9d9aff6122d1 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 23 Apr 2021 14:06:31 -0400 Subject: [PATCH] Expose a common alloc_tls for liblttng-ust-common Expose a common function to force the allocation of all TLS variables owned by liblttng-ust-common, hide the fd-tracker behind it. Change-Id: I6acfe7f85bce1e8939cd8e1d64ecb979525fa547 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-common.h | 2 ++ src/common/ust-fd.h | 2 -- src/lib/lttng-ust-common/fd-tracker.h | 3 +++ src/lib/lttng-ust-common/ust-common.c | 5 +++++ src/lib/lttng-ust/lttng-ust-comm.c | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/lttng/ust-common.h b/include/lttng/ust-common.h index 8396e6b4..a59a0235 100644 --- a/include/lttng/ust-common.h +++ b/include/lttng/ust-common.h @@ -17,4 +17,6 @@ void lttng_ust_common_ctor(void) __attribute__((constructor)); +void lttng_ust_common_alloc_tls(void); + #endif diff --git a/src/common/ust-fd.h b/src/common/ust-fd.h index b6a078bf..4e6c4a5d 100644 --- a/src/common/ust-fd.h +++ b/src/common/ust-fd.h @@ -26,6 +26,4 @@ int lttng_ust_safe_close_fd(int fd, int (*close_cb)(int)); int lttng_ust_safe_fclose_stream(FILE *stream, int (*fclose_cb)(FILE *stream)); int lttng_ust_safe_closefrom_fd(int lowfd, int (*close_cb)(int)); -void lttng_ust_fd_tracker_alloc_tls(void); - #endif /* _LTTNG_UST_FD_H */ diff --git a/src/lib/lttng-ust-common/fd-tracker.h b/src/lib/lttng-ust-common/fd-tracker.h index 07c13724..2432eaa4 100644 --- a/src/lib/lttng-ust-common/fd-tracker.h +++ b/src/lib/lttng-ust-common/fd-tracker.h @@ -10,4 +10,7 @@ void lttng_ust_fd_tracker_init(void) __attribute__((visibility("hidden"))); +void lttng_ust_fd_tracker_alloc_tls(void) + __attribute__((visibility("hidden"))); + #endif diff --git a/src/lib/lttng-ust-common/ust-common.c b/src/lib/lttng-ust-common/ust-common.c index e163383d..f444c97f 100644 --- a/src/lib/lttng-ust-common/ust-common.c +++ b/src/lib/lttng-ust-common/ust-common.c @@ -25,3 +25,8 @@ void lttng_ust_common_ctor(void) */ lttng_ust_fd_tracker_init(); } + +void lttng_ust_common_alloc_tls(void) +{ + lttng_ust_fd_tracker_alloc_tls(); +} diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/lib/lttng-ust/lttng-ust-comm.c index b7656472..6cdce82d 100644 --- a/src/lib/lttng-ust/lttng-ust-comm.c +++ b/src/lib/lttng-ust/lttng-ust-comm.c @@ -406,7 +406,7 @@ void lttng_ust_alloc_tls(void) lttng_procname_alloc_tls(); lttng_ust_mutex_nest_alloc_tls(); lttng_ust_perf_counter_alloc_tls(); - lttng_ust_fd_tracker_alloc_tls(); + lttng_ust_common_alloc_tls(); lttng_cgroup_ns_alloc_tls(); lttng_ipc_ns_alloc_tls(); lttng_net_ns_alloc_tls(); -- 2.34.1