X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Flib%2Flttng-ust%2Flttng-ust-comm.c;h=ff7b5939ae05cade2d07d1338c73184e67fa8d3c;hb=f73bcf5eafdc10b2bbb32de0bcef709de0f8f5e5;hp=442ca892c3b13dd10c7cb5e8447cf53677b00445;hpb=249cffb5cdf9cff45298a44580b24d4dd9d63ba0;p=lttng-ust.git diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/lib/lttng-ust/lttng-ust-comm.c index 442ca892..ff7b5939 100644 --- a/src/lib/lttng-ust/lttng-ust-comm.c +++ b/src/lib/lttng-ust/lttng-ust-comm.c @@ -39,7 +39,7 @@ #include #include #include -#include "common/compat/futex.h" +#include "lib/lttng-ust/futex.h" #include "common/ustcomm.h" #include "common/ust-fd.h" #include "common/logging.h" @@ -50,8 +50,7 @@ #include "common/procname.h" #include "common/ringbuffer/rb-init.h" #include "lttng-ust-statedump.h" -#include "clock.h" -#include "lib/lttng-ust/getcpu.h" +#include "common/clock.h" #include "common/getenv.h" #include "lib/lttng-ust/events.h" #include "context-internal.h" @@ -264,7 +263,7 @@ struct sock_info { }; /* Socket from app (connect) to session daemon (listen) for communication */ -struct sock_info global_apps = { +static struct sock_info global_apps = { .name = "global", .global = 1, @@ -286,7 +285,7 @@ struct sock_info global_apps = { /* TODO: allow global_apps_sock_path override */ -struct sock_info local_apps = { +static struct sock_info local_apps = { .name = "local", .global = 0, .root_handle = -1, @@ -374,48 +373,48 @@ const char *get_lttng_home_dir(void) } /* - * 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_common_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(); } /* @@ -436,7 +435,7 @@ void lttng_ust_init_thread(void) * 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) @@ -1741,7 +1740,7 @@ void *ust_listener_thread(void *arg) 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 @@ -2069,11 +2068,11 @@ void lttng_ust_ctor(void) 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; @@ -2118,8 +2117,6 @@ void lttng_ust_ctor(void) lttng_ust_common_ctor(); lttng_ust_tp_init(); - lttng_ust_clock_init(); - lttng_ust_getcpu_plugin_init(); lttng_ust_statedump_init(); lttng_ust_ring_buffer_clients_init(); lttng_ust_counter_clients_init(); @@ -2378,8 +2375,8 @@ void lttng_ust_before_fork(sigset_t *save_sigset) 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;