#ifndef _LTTNG_UST_RINGBUFFER_RB_INIT_H
#define _LTTNG_UST_RINGBUFFER_RB_INIT_H
-void lttng_fixup_ringbuffer_tls(void)
+void lttng_ringbuffer_alloc_tls(void)
__attribute__((visibility("hidden")));
void lttng_ust_ringbuffer_set_allow_blocking(void)
}
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
-void lttng_fixup_ringbuffer_tls(void)
+void lttng_ringbuffer_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(lib_ring_buffer_nesting)));
}
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_fixup_fd_tracker_tls(void);
+void lttng_ust_fd_tracker_alloc_tls(void);
#endif /* _LTTNG_UST_FD_H */
/*
* Protect the lttng_fd_set. Nests within the ust_lock, and therefore
- * within the libc dl lock. Therefore, we need to fixup the TLS before
+ * within the libc dl lock. Therefore, we need to allocate the TLS before
* nesting into this lock.
*
* The ust_safe_guard_fd_mutex nests within the ust_mutex. This mutex
static int init_done;
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
-void lttng_ust_fixup_fd_tracker_tls(void)
+void lttng_ust_fd_tracker_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(ust_fd_mutex_nest)));
}
{
int ret = 0;
- lttng_ust_fixup_fd_tracker_tls();
+ lttng_ust_fd_tracker_alloc_tls();
/*
* Ensure the tracker is initialized when called from
{
int ret = 0, fd;
- lttng_ust_fixup_fd_tracker_tls();
+ lttng_ust_fd_tracker_alloc_tls();
/*
* Ensure the tracker is initialized when called from
{
int ret = 0, close_success = 0, i;
- lttng_ust_fixup_fd_tracker_tls();
+ lttng_ust_fd_tracker_alloc_tls();
/*
* Ensure the tracker is initialized when called from
}
static
-void lttng_ust_fixup_malloc_nesting_tls(void)
+void lttng_ust_malloc_nesting_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(malloc_nesting)));
}
if (cur_alloc.calloc) {
return;
}
- lttng_ust_fixup_malloc_nesting_tls();
+ lttng_ust_malloc_nesting_alloc_tls();
/*
* Ensure the allocator is in place before the process becomes
* multithreaded.
}
/*
- * * Force a read (imply TLS fixup for dlopen) of TLS variables.
- * */
-void lttng_fixup_cgroup_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_cgroup_ns_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_cgroup_ns)));
}
}
/*
- * * Force a read (imply TLS fixup for dlopen) of TLS variables.
- * */
-void lttng_fixup_ipc_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_ipc_ns_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_ipc_ns)));
}
}
/*
- * * Force a read (imply TLS fixup for dlopen) of TLS variables.
- * */
-void lttng_fixup_net_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_net_ns_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_net_ns)));
}
* lttng_perf_lock - Protect lttng-ust perf counter data structures
*
* Nests within the ust_lock, and therefore within the libc dl lock.
- * Therefore, we need to fixup the TLS before nesting into this lock.
+ * Therefore, we need to allocate the TLS before nesting into this lock.
* Nests inside RCU bp read-side lock. Protects against concurrent
* fork.
*/
static DEFINE_URCU_TLS(int, ust_perf_mutex_nest);
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
-void lttng_ust_fixup_perf_counter_tls(void)
+void lttng_ust_perf_counter_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(ust_perf_mutex_nest)));
}
}
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
-void lttng_fixup_procname_tls(void)
+void lttng_procname_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_procname)[0]));
}
size_t name_len = strlen(provider->name);
uint32_t hash;
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
/* Provider name starts with "$app.". */
if (strncmp("$app.", provider->name, strlen("$app.")) != 0)
void lttng_ust_context_provider_unregister(struct lttng_ust_registered_context_provider *reg_provider)
{
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
if (ust_lock())
goto end;
}
/*
- * * Force a read (imply TLS fixup for dlopen) of TLS variables.
- * */
-void lttng_fixup_time_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_time_ns_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_time_ns)));
}
}
/*
- * * Force a read (imply TLS fixup for dlopen) of TLS variables.
- * */
-void lttng_fixup_uts_ns_tls(void)
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
+ */
+void lttng_uts_ns_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_uts_ns)));
}
}
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
-void lttng_fixup_vtid_tls(void)
+void lttng_vtid_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(cached_vtid)));
}
{
struct lttng_ust_registered_probe *reg_probe = NULL;
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
/*
* If version mismatch, don't register, but don't trigger assert
void lttng_ust_probe_unregister(struct lttng_ust_registered_probe *reg_probe)
{
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
if (!reg_probe)
return;
__attribute__((visibility("hidden")));
-void lttng_ust_fixup_ring_buffer_client_overwrite_tls(void)
+void lttng_ust_ring_buffer_client_overwrite_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_ust_fixup_ring_buffer_client_overwrite_rt_tls(void)
+void lttng_ust_ring_buffer_client_overwrite_rt_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_ust_fixup_ring_buffer_client_discard_tls(void)
+void lttng_ust_ring_buffer_client_discard_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_ust_fixup_ring_buffer_client_discard_rt_tls(void)
+void lttng_ust_ring_buffer_client_discard_rt_alloc_tls(void)
__attribute__((visibility("hidden")));
#endif /* _LTTNG_RB_CLIENT_H */
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_DISCARD
#define RING_BUFFER_MODE_TEMPLATE_STRING "discard-rt"
-#define RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP \
- lttng_ust_fixup_ring_buffer_client_discard_rt_tls
+#define RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS \
+ lttng_ust_ring_buffer_client_discard_rt_alloc_tls
#define RING_BUFFER_MODE_TEMPLATE_INIT \
lttng_ring_buffer_client_discard_rt_init
#define RING_BUFFER_MODE_TEMPLATE_EXIT \
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_DISCARD
#define RING_BUFFER_MODE_TEMPLATE_STRING "discard"
-#define RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP \
- lttng_ust_fixup_ring_buffer_client_discard_tls
+#define RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS \
+ lttng_ust_ring_buffer_client_discard_alloc_tls
#define RING_BUFFER_MODE_TEMPLATE_INIT \
lttng_ring_buffer_client_discard_init
#define RING_BUFFER_MODE_TEMPLATE_EXIT \
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_OVERWRITE
#define RING_BUFFER_MODE_TEMPLATE_STRING "overwrite-rt"
-#define RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP \
- lttng_ust_fixup_ring_buffer_client_overwrite_rt_tls
+#define RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS \
+ lttng_ust_ring_buffer_client_overwrite_rt_alloc_tls
#define RING_BUFFER_MODE_TEMPLATE_INIT \
lttng_ring_buffer_client_overwrite_rt_init
#define RING_BUFFER_MODE_TEMPLATE_EXIT \
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_OVERWRITE
#define RING_BUFFER_MODE_TEMPLATE_STRING "overwrite"
-#define RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP \
- lttng_ust_fixup_ring_buffer_client_overwrite_tls
+#define RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS \
+ lttng_ust_ring_buffer_client_overwrite_alloc_tls
#define RING_BUFFER_MODE_TEMPLATE_INIT \
lttng_ring_buffer_client_overwrite_init
#define RING_BUFFER_MODE_TEMPLATE_EXIT \
static DEFINE_URCU_TLS(private_ctx_stack_t, private_ctx_stack);
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
-void RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP(void)
+void RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS(void)
{
asm volatile ("" : : "m" (URCU_TLS(private_ctx_stack)));
}
void ust_unlock(void)
__attribute__((visibility("hidden")));
-void lttng_ust_fixup_tls(void)
+void lttng_ust_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_event_tls(void)
+void lttng_vtid_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_vtid_tls(void)
+void lttng_procname_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_procname_tls(void)
+void lttng_cgroup_ns_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_cgroup_ns_tls(void)
+void lttng_ipc_ns_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_ipc_ns_tls(void)
+void lttng_net_ns_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_net_ns_tls(void)
+void lttng_time_ns_alloc_tls(void)
__attribute__((visibility("hidden")));
-void lttng_fixup_time_ns_tls(void)
- __attribute__((visibility("hidden")));
-
-void lttng_fixup_uts_ns_tls(void)
+void lttng_uts_ns_alloc_tls(void)
__attribute__((visibility("hidden")));
const char *lttng_ust_obj_get_name(int id)
__attribute__((visibility("hidden")));
#ifdef HAVE_LINUX_PERF_EVENT_H
-void lttng_ust_fixup_perf_counter_tls(void)
+void lttng_ust_perf_counter_alloc_tls(void)
__attribute__((visibility("hidden")));
void lttng_perf_lock(void)
__attribute__((visibility("hidden")));
#else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
static inline
-void lttng_ust_fixup_perf_counter_tls(void)
+void lttng_ust_perf_counter_alloc_tls(void)
{
}
static inline
}
/*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
*/
static
-void lttng_fixup_nest_count_tls(void)
+void lttng_nest_count_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(lttng_ust_nest_count)));
}
static
-void lttng_fixup_ust_mutex_nest_tls(void)
+void lttng_ust_mutex_nest_alloc_tls(void)
{
asm volatile ("" : : "m" (URCU_TLS(ust_mutex_nest)));
}
/*
- * Fixup lttng-ust urcu TLS.
+ * Allocate lttng-ust urcu TLS.
*/
static
-void lttng_fixup_lttng_ust_urcu_tls(void)
+void lttng_lttng_ust_urcu_alloc_tls(void)
{
(void) lttng_ust_urcu_read_ongoing();
}
-void lttng_ust_fixup_tls(void)
+void lttng_ust_alloc_tls(void)
{
- lttng_fixup_lttng_ust_urcu_tls();
- lttng_fixup_ringbuffer_tls();
- lttng_fixup_vtid_tls();
- lttng_fixup_nest_count_tls();
- lttng_fixup_procname_tls();
- lttng_fixup_ust_mutex_nest_tls();
- lttng_ust_fixup_perf_counter_tls();
- lttng_ust_fixup_fd_tracker_tls();
- lttng_fixup_cgroup_ns_tls();
- lttng_fixup_ipc_ns_tls();
- lttng_fixup_net_ns_tls();
- lttng_fixup_time_ns_tls();
- lttng_fixup_uts_ns_tls();
- lttng_ust_fixup_ring_buffer_client_discard_tls();
- lttng_ust_fixup_ring_buffer_client_discard_rt_tls();
- lttng_ust_fixup_ring_buffer_client_overwrite_tls();
- lttng_ust_fixup_ring_buffer_client_overwrite_rt_tls();
+ lttng_lttng_ust_urcu_alloc_tls();
+ lttng_ringbuffer_alloc_tls();
+ lttng_vtid_alloc_tls();
+ lttng_nest_count_alloc_tls();
+ lttng_procname_alloc_tls();
+ lttng_ust_mutex_nest_alloc_tls();
+ lttng_ust_perf_counter_alloc_tls();
+ lttng_ust_fd_tracker_alloc_tls();
+ lttng_cgroup_ns_alloc_tls();
+ lttng_ipc_ns_alloc_tls();
+ lttng_net_ns_alloc_tls();
+ lttng_time_ns_alloc_tls();
+ lttng_uts_ns_alloc_tls();
+ lttng_ust_ring_buffer_client_discard_alloc_tls();
+ lttng_ust_ring_buffer_client_discard_rt_alloc_tls();
+ lttng_ust_ring_buffer_client_overwrite_alloc_tls();
+ lttng_ust_ring_buffer_client_overwrite_rt_alloc_tls();
}
/*
* ensure those are initialized before a signal handler nesting over
* this thread attempts to use them.
*/
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
}
int lttng_get_notify_socket(void *owner)
int sock, ret, prev_connect_failed = 0, has_waited = 0, fd;
long timeout;
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
/*
* If available, add '-ust' to the end of this thread's
* process name
return;
/*
- * Fixup interdependency between TLS fixup mutex (which happens
+ * Fixup interdependency between TLS allocation mutex (which happens
* to be the dynamic linker mutex) and ust_lock, taken within
* the ust lock.
*/
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
lttng_ust_loaded = 1;
sigset_t all_sigs;
int ret;
- /* Fixup lttng-ust TLS. */
- lttng_ust_fixup_tls();
+ /* Allocate lttng-ust TLS. */
+ lttng_ust_alloc_tls();
if (URCU_TLS(lttng_ust_nest_count))
return;
return;
/*
- * Fixup lttng-ust TLS when called from dlopen/dlclose
- * instrumentation.
+ * Force the allocation of lttng-ust TLS variables when called from
+ * dlopen/dlclose instrumentation.
*/
- lttng_ust_fixup_tls();
+ lttng_ust_alloc_tls();
data.exec_found = 0;
data.first = true;