From b62f8205216d20d7ef16b536efd81389dc6fdd2f Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 24 Mar 2021 14:44:05 -0400 Subject: [PATCH] Move private ABI counter client symbols to dedicated header The counter client percpu functions are provided by liblttng-ust and used by liblttng-ust-ctl. Make them part of the private ABI. Change-Id: I5fe3c16cb46ac3998dbdc037ccdb71170fc03f61 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- liblttng-ust-ctl/ustctl.c | 13 +----------- liblttng-ust/Makefile.am | 1 + .../lttng-counter-client-percpu-32-modular.c | 1 + .../lttng-counter-client-percpu-64-modular.c | 1 + liblttng-ust/lttng-counter-client.h | 21 +++++++++++++++++++ liblttng-ust/lttng-ust-comm.c | 13 +----------- liblttng-ust/ust-core.c | 1 + 7 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 liblttng-ust/lttng-counter-client.h diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 28385990..a498f70c 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -30,6 +30,7 @@ #include "../liblttng-ust/clock.h" #include "../liblttng-ust/getenv.h" #include "../liblttng-ust/lttng-tracer-core.h" +#include "../liblttng-ust/lttng-counter-client.h" #include "../libcounter/shm.h" #include "../libcounter/smp.h" @@ -94,18 +95,6 @@ extern void lttng_ring_buffer_client_discard_exit(void); extern void lttng_ring_buffer_client_discard_rt_exit(void); extern void lttng_ring_buffer_metadata_client_exit(void); -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_32_modular_init(void); - -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_32_modular_exit(void); - -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_64_modular_init(void); - -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_64_modular_exit(void); - int ustctl_release_handle(int sock, int handle) { struct ustcomm_ust_msg lum; diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index 8665be87..42362e72 100644 --- a/liblttng-ust/Makefile.am +++ b/liblttng-ust/Makefile.am @@ -119,6 +119,7 @@ liblttng_ust_support_la_SOURCES = \ lttng-ring-buffer-client-overwrite-rt.c \ lttng-ring-buffer-metadata-client.h \ lttng-ring-buffer-metadata-client.c \ + lttng-counter-client.h \ lttng-counter-client-percpu-32-modular.c \ lttng-counter-client-percpu-64-modular.c \ lttng-clock.c lttng-getcpu.c diff --git a/liblttng-ust/lttng-counter-client-percpu-32-modular.c b/liblttng-ust/lttng-counter-client-percpu-32-modular.c index abcdd480..f6e5bdfd 100644 --- a/liblttng-ust/lttng-counter-client-percpu-32-modular.c +++ b/liblttng-ust/lttng-counter-client-percpu-32-modular.c @@ -12,6 +12,7 @@ #include "../libcounter/counter.h" #include "../libcounter/counter-api.h" #include "lttng-tracer-core.h" +#include "lttng-counter-client.h" static const struct lib_counter_config client_config = { .alloc = COUNTER_ALLOC_PER_CPU, diff --git a/liblttng-ust/lttng-counter-client-percpu-64-modular.c b/liblttng-ust/lttng-counter-client-percpu-64-modular.c index a572ec8c..0a49cfd3 100644 --- a/liblttng-ust/lttng-counter-client-percpu-64-modular.c +++ b/liblttng-ust/lttng-counter-client-percpu-64-modular.c @@ -12,6 +12,7 @@ #include "../libcounter/counter.h" #include "../libcounter/counter-api.h" #include "lttng-tracer-core.h" +#include "lttng-counter-client.h" static const struct lib_counter_config client_config = { .alloc = COUNTER_ALLOC_PER_CPU, diff --git a/liblttng-ust/lttng-counter-client.h b/liblttng-ust/lttng-counter-client.h new file mode 100644 index 00000000..5aa86619 --- /dev/null +++ b/liblttng-ust/lttng-counter-client.h @@ -0,0 +1,21 @@ +/* + * SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * + * Copyright (C) 2020 Mathieu Desnoyers + * + * LTTng lib counter client. + */ + +#ifndef _LTTNG_UST_COUNTER_CLIENT_H +#define _LTTNG_UST_COUNTER_CLIENT_H + +/* + * These symbol are part of the private ABI between liblttng-ust and + * liblttng-ust-ctl. + */ +void lttng_counter_client_percpu_32_modular_init(void); +void lttng_counter_client_percpu_32_modular_exit(void); +void lttng_counter_client_percpu_64_modular_init(void); +void lttng_counter_client_percpu_64_modular_exit(void); + +#endif diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 204db9de..cb9f8c88 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -53,6 +53,7 @@ #include "ust-events-internal.h" #include "context-internal.h" #include "ust-compat.h" +#include "lttng-counter-client.h" /* * Has lttng ust comm constructor been called ? @@ -361,18 +362,6 @@ extern void lttng_ring_buffer_client_discard_exit(void); extern void lttng_ring_buffer_client_discard_rt_exit(void); extern void lttng_ring_buffer_metadata_client_exit(void); -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_32_modular_init(void); - -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_32_modular_exit(void); - -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_64_modular_init(void); - -__attribute__((visibility("hidden"))) -extern void lttng_counter_client_percpu_64_modular_exit(void); - static char *get_map_shm(struct sock_info *sock_info); ssize_t lttng_ust_read(int fd, void *buf, size_t len) diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 7bd55aba..089dd910 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -9,6 +9,7 @@ #include #include +#include "context-internal.h" #include "ust-events-internal.h" #include #include "lttng-tracer-core.h" -- 2.34.1