From: Michael Jeanson Date: Fri, 23 Apr 2021 18:06:31 +0000 (-0400) Subject: Expose a common alloc_tls for liblttng-ust-common X-Git-Tag: v2.13.0-rc1~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cf914d169665d78854f6d0e1c8ff9d9aff6122d1;p=lttng-ust.git 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 --- 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();