From: Mathieu Desnoyers Date: Tue, 30 Mar 2021 19:59:02 +0000 (-0400) Subject: Fix: liblttng-ust-ctl: missing ring buffer and counter clients init/exit symbols X-Git-Tag: v2.13.0-rc1~172 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f27f1026353ae61083b7a2221f912b0299095a04;p=lttng-ust.git Fix: liblttng-ust-ctl: missing ring buffer and counter clients init/exit symbols Move init/exit functions to ust-core.c which is linked against by both liblttng-ust and liblttng-ust-ctl to make them available to the control library. Signed-off-by: Mathieu Desnoyers Change-Id: I70bd2841c941df8e4d25629a0747aaebe57e0569 --- diff --git a/liblttng-ust/lttng-counter-client.h b/liblttng-ust/lttng-counter-client.h index 5aa86619..dcb01de5 100644 --- a/liblttng-ust/lttng-counter-client.h +++ b/liblttng-ust/lttng-counter-client.h @@ -10,12 +10,20 @@ #define _LTTNG_UST_COUNTER_CLIENT_H /* - * These symbol are part of the private ABI between liblttng-ust and - * liblttng-ust-ctl. + * The counter clients init/exit symbols are private ABI for + * liblttng-ust-ctl, which is why they are not hidden. */ + +void lttng_ust_counter_clients_init(void); +void lttng_ust_counter_clients_exit(void); + +__attribute__((visibility("hidden"))) void lttng_counter_client_percpu_32_modular_init(void); +__attribute__((visibility("hidden"))) void lttng_counter_client_percpu_32_modular_exit(void); +__attribute__((visibility("hidden"))) void lttng_counter_client_percpu_64_modular_init(void); +__attribute__((visibility("hidden"))) void lttng_counter_client_percpu_64_modular_exit(void); #endif diff --git a/liblttng-ust/lttng-rb-clients.h b/liblttng-ust/lttng-rb-clients.h index 4b6999e4..4ebc0dee 100644 --- a/liblttng-ust/lttng-rb-clients.h +++ b/liblttng-ust/lttng-rb-clients.h @@ -8,6 +8,7 @@ #define _LTTNG_RB_CLIENT_H #include +#include "../libringbuffer/ringbuffer-config.h" struct lttng_ust_client_lib_ring_buffer_client_cb { struct lttng_ust_lib_ring_buffer_client_cb parent; @@ -40,13 +41,41 @@ struct lttng_ust_client_lib_ring_buffer_client_cb { }; /* - * The ring buffer and counter clients init/exit symbols are private ABI - * for liblttng-ust-ctl, which is why they are not hidden. + * The ring buffer clients init/exit symbols are private ABI for + * liblttng-ust-ctl, which is why they are not hidden. */ void lttng_ust_ring_buffer_clients_init(void); void lttng_ust_ring_buffer_clients_exit(void); -void lttng_ust_counter_clients_init(void); -void lttng_ust_counter_clients_exit(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_overwrite_init(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_overwrite_rt_init(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_discard_init(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_discard_rt_init(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_metadata_client_init(void); + +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_overwrite_exit(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_overwrite_rt_exit(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_discard_exit(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_client_discard_rt_exit(void); +__attribute__((visibility("hidden"))) +void lttng_ring_buffer_metadata_client_exit(void); + +__attribute__((visibility("hidden"))) +void lttng_ust_fixup_ring_buffer_client_overwrite_tls(void); +__attribute__((visibility("hidden"))) +void lttng_ust_fixup_ring_buffer_client_overwrite_rt_tls(void); +__attribute__((visibility("hidden"))) +void lttng_ust_fixup_ring_buffer_client_discard_tls(void); +__attribute__((visibility("hidden"))) +void lttng_ust_fixup_ring_buffer_client_discard_rt_tls(void); #endif /* _LTTNG_RB_CLIENT_H */ diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 07ae9a34..7e587499 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -54,6 +54,7 @@ #include "context-internal.h" #include "ust-compat.h" #include "lttng-counter-client.h" +#include "lttng-rb-clients.h" /* * Has lttng ust comm constructor been called ? @@ -2062,36 +2063,6 @@ void lttng_ust_libc_wrapper_malloc_init(void) { } -void lttng_ust_ring_buffer_clients_init(void) -{ - lttng_ring_buffer_metadata_client_init(); - lttng_ring_buffer_client_overwrite_init(); - lttng_ring_buffer_client_overwrite_rt_init(); - lttng_ring_buffer_client_discard_init(); - lttng_ring_buffer_client_discard_rt_init(); -} - -void lttng_ust_ring_buffer_clients_exit(void) -{ - lttng_ring_buffer_client_discard_rt_exit(); - lttng_ring_buffer_client_discard_exit(); - lttng_ring_buffer_client_overwrite_rt_exit(); - lttng_ring_buffer_client_overwrite_exit(); - lttng_ring_buffer_metadata_client_exit(); -} - -void lttng_ust_counter_clients_init(void) -{ - lttng_counter_client_percpu_64_modular_init(); - lttng_counter_client_percpu_32_modular_init(); -} - -void lttng_ust_counter_clients_exit(void) -{ - lttng_counter_client_percpu_32_modular_exit(); - lttng_counter_client_percpu_64_modular_exit(); -} - /* * sessiond monitoring thread: monitor presence of global and per-user * sessiond by polling the application common named pipe. diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 88d4f558..61293d13 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -13,6 +13,8 @@ #include "ust-events-internal.h" #include #include "lttng-tracer-core.h" +#include "lttng-rb-clients.h" +#include "lttng-counter-client.h" #include "jhash.h" static CDS_LIST_HEAD(lttng_transport_list); @@ -190,3 +192,33 @@ void lttng_ust_free_channel_common(struct lttng_ust_channel_common *chan) abort(); } } + +void lttng_ust_ring_buffer_clients_init(void) +{ + lttng_ring_buffer_metadata_client_init(); + lttng_ring_buffer_client_overwrite_init(); + lttng_ring_buffer_client_overwrite_rt_init(); + lttng_ring_buffer_client_discard_init(); + lttng_ring_buffer_client_discard_rt_init(); +} + +void lttng_ust_ring_buffer_clients_exit(void) +{ + lttng_ring_buffer_client_discard_rt_exit(); + lttng_ring_buffer_client_discard_exit(); + lttng_ring_buffer_client_overwrite_rt_exit(); + lttng_ring_buffer_client_overwrite_exit(); + lttng_ring_buffer_metadata_client_exit(); +} + +void lttng_ust_counter_clients_init(void) +{ + lttng_counter_client_percpu_64_modular_init(); + lttng_counter_client_percpu_32_modular_init(); +} + +void lttng_ust_counter_clients_exit(void) +{ + lttng_counter_client_percpu_32_modular_exit(); + lttng_counter_client_percpu_64_modular_exit(); +} diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index e8c44be4..055e4f6e 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -908,35 +908,4 @@ __attribute__((visibility("hidden"))) void lttng_ust_format_event_name(const struct lttng_ust_event_desc *desc, char *name); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_overwrite_init(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_overwrite_rt_init(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_discard_init(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_discard_rt_init(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_metadata_client_init(void); - -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_overwrite_exit(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_overwrite_rt_exit(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_discard_exit(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_client_discard_rt_exit(void); -__attribute__((visibility("hidden"))) -void lttng_ring_buffer_metadata_client_exit(void); - -__attribute__((visibility("hidden"))) -void lttng_ust_fixup_ring_buffer_client_overwrite_tls(void); -__attribute__((visibility("hidden"))) -void lttng_ust_fixup_ring_buffer_client_overwrite_rt_tls(void); -__attribute__((visibility("hidden"))) -void lttng_ust_fixup_ring_buffer_client_discard_tls(void); -__attribute__((visibility("hidden"))) -void lttng_ust_fixup_ring_buffer_client_discard_rt_tls(void); - #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */