From: Michael Jeanson Date: Wed, 10 Mar 2021 19:09:52 +0000 (-0500) Subject: Remove LTTNG_HIDDEN macro X-Git-Tag: v2.13.0-rc1~281 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ddabe860f4cf41a4206a8157d83e6b9354f85cb5;p=lttng-ust.git Remove LTTNG_HIDDEN macro We already use __attribute__((visibility("hidden"))) directly in the public API and in some parts of the code. Remove the LTTNG_HIDDEN macro and replace it with the literal attribute. Change-Id: I9aa0698ba08c742c2a25aec24560b7789e303eaa Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust-comm.h b/include/ust-comm.h index aaf7c6ef..da10b408 100644 --- a/include/ust-comm.h +++ b/include/ust-comm.h @@ -21,7 +21,6 @@ #include #include #include -#include "ust-helper.h" #ifndef LTTNG_PACKED #error "LTTNG_PACKED should be defined" @@ -199,56 +198,70 @@ struct ustcomm_notify_channel_reply { * struct lttng_ust_field_iter field. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ustcomm_create_unix_sock(const char *pathname); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_connect_unix_sock(const char *pathname, long timeout); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_accept_unix_sock(int sock); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_listen_unix_sock(int sock); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_close_unix_sock(int sock); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) ssize_t ustcomm_recv_unix_sock(int sock, void *buf, size_t len); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) ssize_t ustcomm_send_unix_sock(int sock, const void *buf, size_t len); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) ssize_t ustcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) ssize_t ustcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) const char *ustcomm_get_readable_code(int code); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_send_app_msg(int sock, struct ustcomm_ust_msg *lum); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_recv_app_reply(int sock, struct ustcomm_ust_reply *lur, uint32_t expected_handle, uint32_t expected_cmd); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_send_app_cmd(int sock, struct ustcomm_ust_msg *lum, struct ustcomm_ust_reply *lur); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_recv_fd(int sock); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) ssize_t ustcomm_recv_channel_from_sessiond(int sock, void **chan_data, uint64_t len, int *wakeup_fd); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_recv_stream_from_sessiond(int sock, uint64_t *memory_map_size, int *shm_fd, int *wakeup_fd); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) ssize_t ustcomm_recv_event_notifier_notif_fd_from_sessiond(int sock, int *event_notifier_notif_fd); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) ssize_t ustcomm_recv_counter_from_sessiond(int sock, void **counter_data, uint64_t len); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_recv_counter_shm_from_sessiond(int sock, int *shm_fd); @@ -256,7 +269,7 @@ int ustcomm_recv_counter_shm_from_sessiond(int sock, * Returns 0 on success, negative error value on error. * Returns -EPIPE or -ECONNRESET if other end has hung up. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ustcomm_send_reg_msg(int sock, enum ustctl_socket_type type, uint32_t bits_per_long, @@ -270,7 +283,7 @@ int ustcomm_send_reg_msg(int sock, * Returns 0 on success, negative error value on error. * Returns -EPIPE or -ECONNRESET if other end has hung up. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ustcomm_register_event(int sock, struct lttng_session *session, int session_objd, /* session descriptor */ @@ -287,7 +300,7 @@ int ustcomm_register_event(int sock, * Returns 0 on success, negative error value on error. * Returns -EPIPE or -ECONNRESET if other end has hung up. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ustcomm_register_enum(int sock, int session_objd, /* session descriptor */ const char *enum_name, /* enum name (input) */ @@ -299,7 +312,7 @@ int ustcomm_register_enum(int sock, * Returns 0 on success, negative error value on error. * Returns -EPIPE or -ECONNRESET if other end has hung up. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ustcomm_register_channel(int sock, struct lttng_session *session, int session_objd, /* session descriptor */ @@ -309,9 +322,10 @@ int ustcomm_register_channel(int sock, uint32_t *chan_id, /* channel id (output) */ int *header_type); /* header type (output) */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ustcomm_setsockopt_rcv_timeout(int sock, unsigned int msec); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ustcomm_setsockopt_snd_timeout(int sock, unsigned int msec); #endif /* _LTTNG_UST_COMM_H */ diff --git a/include/ust-dynamic-type.h b/include/ust-dynamic-type.h index e7425048..7a6b1b15 100644 --- a/include/ust-dynamic-type.h +++ b/include/ust-dynamic-type.h @@ -9,14 +9,14 @@ #include -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_ust_dynamic_type_choices(size_t *nr_choices, const struct lttng_ust_event_field ***choices); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) const struct lttng_ust_event_field *lttng_ust_dynamic_type_field(int64_t value); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) const struct lttng_ust_event_field *lttng_ust_dynamic_type_tag_field(void); #endif /* _LTTNG_UST_DYNAMIC_TYPE_H */ diff --git a/include/ust-helper.h b/include/ust-helper.h index e529ba08..609a1028 100644 --- a/include/ust-helper.h +++ b/include/ust-helper.h @@ -43,15 +43,4 @@ void *zmalloc(size_t len) #define LTTNG_UST_CALLER_IP() __builtin_return_address(0) #endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */ -/* - * LTTNG_HIDDEN: set the hidden attribute for internal functions - * On Windows, symbols are local unless explicitly exported, - * see https://gcc.gnu.org/wiki/Visibility - */ -#if defined(_WIN32) || defined(__CYGWIN__) -#define LTTNG_HIDDEN -#else -#define LTTNG_HIDDEN __attribute__((visibility("hidden"))) -#endif - #endif /* _LTTNG_UST_HELPER_H */ diff --git a/include/ust-share.h b/include/ust-share.h index b9490e4d..6f93cdfd 100644 --- a/include/ust-share.h +++ b/include/ust-share.h @@ -10,13 +10,13 @@ #include #include -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) ssize_t ust_patient_write(int fd, const void *buf, size_t count); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) ssize_t ust_patient_writev(int fd, struct iovec *iov, int iovcnt); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) ssize_t ust_patient_send(int fd, const void *buf, size_t count, int flags); #endif /* _LTTNG_SHARE_H */ diff --git a/include/ust-snprintf.h b/include/ust-snprintf.h index 19248f38..da932139 100644 --- a/include/ust-snprintf.h +++ b/include/ust-snprintf.h @@ -10,11 +10,10 @@ #include #include -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ust_safe_vsnprintf(char *str, size_t n, const char *fmt, va_list ap); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int ust_safe_snprintf(char *str, size_t n, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); diff --git a/include/usterr-signal-safe.h b/include/usterr-signal-safe.h index bbdad049..868a0d8b 100644 --- a/include/usterr-signal-safe.h +++ b/include/usterr-signal-safe.h @@ -15,7 +15,6 @@ #include #include #include -#include "ust-helper.h" #include "ust-tid.h" #include "ust-snprintf.h" @@ -25,9 +24,10 @@ enum ust_err_loglevel { UST_ERR_LOGLEVEL_DEBUG, }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern volatile enum ust_err_loglevel ust_err_loglevel; -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void ust_err_init(void); #ifdef LTTNG_UST_DEBUG diff --git a/libcounter/counter.h b/libcounter/counter.h index 6b5382f5..3d11f132 100644 --- a/libcounter/counter.h +++ b/libcounter/counter.h @@ -12,10 +12,9 @@ #include #include #include "counter-types.h" -#include "ust-helper.h" /* max_nr_elem is for each dimension. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lib_counter *lttng_counter_create(const struct lib_counter_config *config, size_t nr_dimensions, const size_t *max_nr_elem, @@ -24,32 +23,36 @@ struct lib_counter *lttng_counter_create(const struct lib_counter_config *config int nr_counter_cpu_fds, const int *counter_cpu_fds, bool is_daemon); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_counter_destroy(struct lib_counter *counter); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_counter_set_global_shm(struct lib_counter *counter, int fd); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_counter_set_cpu_shm(struct lib_counter *counter, int cpu, int fd); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_counter_get_global_shm(struct lib_counter *counter, int *fd, size_t *len); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_counter_get_cpu_shm(struct lib_counter *counter, int cpu, int *fd, size_t *len); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_counter_read(const struct lib_counter_config *config, struct lib_counter *counter, const size_t *dimension_indexes, int cpu, int64_t *value, bool *overflow, bool *underflow); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_counter_aggregate(const struct lib_counter_config *config, struct lib_counter *counter, const size_t *dimension_indexes, int64_t *value, bool *overflow, bool *underflow); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_counter_clear(const struct lib_counter_config *config, struct lib_counter *counter, const size_t *dimension_indexes); diff --git a/libcounter/shm.h b/libcounter/shm.h index b162e98f..7be88605 100644 --- a/libcounter/shm.h +++ b/libcounter/shm.h @@ -13,7 +13,6 @@ #include #include #include "shm_types.h" -#include "ust-helper.h" /* lttng_counter_handle_create - for UST. */ extern @@ -24,7 +23,8 @@ extern int lttng_counter_handle_add_cpu(struct lttng_counter_shm_handle *handle, int shm_fd, uint32_t cpu_nr, uint64_t memory_map_size); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) unsigned int lttng_counter_handle_get_nr_cpus(struct lttng_counter_shm_handle *handle); /* @@ -73,22 +73,26 @@ void _lttng_counter_set_shmp(struct lttng_counter_shm_ref *ref, struct lttng_cou #define lttng_counter_set_shmp(ref, src) _lttng_counter_set_shmp(&(ref)._ref, src) -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_counter_shm_object_table *lttng_counter_shm_object_table_create(size_t max_nb_obj); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) struct lttng_counter_shm_object *lttng_counter_shm_object_table_alloc(struct lttng_counter_shm_object_table *table, size_t memory_map_size, enum lttng_counter_shm_object_type type, const int cpu_fd, int cpu); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) struct lttng_counter_shm_object *lttng_counter_shm_object_table_append_shm(struct lttng_counter_shm_object_table *table, int shm_fd, size_t memory_map_size); + /* mem ownership is passed to lttng_counter_shm_object_table_append_mem(). */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_counter_shm_object *lttng_counter_shm_object_table_append_mem(struct lttng_counter_shm_object_table *table, void *mem, size_t memory_map_size); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_counter_shm_object_table_destroy(struct lttng_counter_shm_object_table *table, int consumer); /* @@ -98,9 +102,10 @@ void lttng_counter_shm_object_table_destroy(struct lttng_counter_shm_object_tabl * *NOT* multithread-safe (should be protected by mutex). * Returns a -1, -1 tuple on error. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_counter_shm_ref lttng_counter_zalloc_shm(struct lttng_counter_shm_object *obj, size_t len); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_counter_align_shm(struct lttng_counter_shm_object *obj, size_t align); static inline diff --git a/libcounter/smp.h b/libcounter/smp.h index 6b3de287..9bfe724c 100644 --- a/libcounter/smp.h +++ b/libcounter/smp.h @@ -7,16 +7,15 @@ #ifndef _LIBCOUNTER_SMP_H #define _LIBCOUNTER_SMP_H -#include "ust-helper.h" - /* * 4kB of per-cpu data available. */ #define LTTNG_COUNTER_PER_CPU_MEM_SIZE 4096 -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int __lttng_counter_num_possible_cpus; -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void _lttng_counter_get_num_possible_cpus(void); static inline diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 0d2d1176..8af55ea7 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -94,13 +94,17 @@ extern void lttng_ring_buffer_client_overwrite_rt_exit(void); 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); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_32_modular_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_32_modular_exit(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_64_modular_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_64_modular_exit(void); int ustctl_release_handle(int sock, int handle) diff --git a/liblttng-ust/context-internal.h b/liblttng-ust/context-internal.h index 43c5513b..2a3cb317 100644 --- a/liblttng-ust/context-internal.h +++ b/liblttng-ust/context-internal.h @@ -8,112 +8,151 @@ #define _LTTNG_UST_CONTEXT_INTERNAL_H #include -#include "ust-helper.h" #include "ust-events-internal.h" -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_context_init_all(struct lttng_ctx **ctx); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_attach_context(struct lttng_ust_abi_context *context_param, union lttng_ust_abi_args *uargs, struct lttng_ctx **ctx, struct lttng_session *session); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_find_context(struct lttng_ctx *ctx, const char *name); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_get_context_index(struct lttng_ctx *ctx, const char *name); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_update(struct lttng_ctx *ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_remove_context_field(struct lttng_ctx **ctx_p, struct lttng_ctx_field *field); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_destroy_context(struct lttng_ctx *ctx); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_context_add_rcu(struct lttng_ctx **ctx_p, const struct lttng_ctx_field *f); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_context_is_app(const char *name); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_context_vtid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_vpid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_cgroup_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_ipc_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_mnt_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_net_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_pid_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_user_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_uts_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_time_ns_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_vuid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_veuid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_vsuid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_vgid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_vegid_reset(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_context_vsgid_reset(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_procname_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_ip_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_dyntest_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx); #endif /* _LTTNG_UST_CONTEXT_INTERNAL_H */ diff --git a/liblttng-ust/context-provider-internal.h b/liblttng-ust/context-provider-internal.h index 6834343f..0ada2ccf 100644 --- a/liblttng-ust/context-provider-internal.h +++ b/liblttng-ust/context-provider-internal.h @@ -9,9 +9,8 @@ #include #include -#include "ust-helper.h" -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_context_set_event_notifier_group_provider(const char *name, size_t (*get_size)(struct lttng_ctx_field *field, size_t offset), void (*record)(struct lttng_ctx_field *field, diff --git a/liblttng-ust/futex.h b/liblttng-ust/futex.h index 9560eaf1..95e3aa15 100644 --- a/liblttng-ust/futex.h +++ b/liblttng-ust/futex.h @@ -14,8 +14,6 @@ #include #include -#include "ust-helper.h" - #ifdef __cplusplus extern "C" { #endif @@ -37,10 +35,11 @@ extern "C" { * (returns EINTR). */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lttng_ust_compat_futex_noasync(int32_t *uaddr, int op, int32_t val, const struct timespec *timeout, int32_t *uaddr2, int32_t val3); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int lttng_ust_compat_futex_async(int32_t *uaddr, int op, int32_t val, const struct timespec *timeout, int32_t *uaddr2, int32_t val3); diff --git a/liblttng-ust/getenv.h b/liblttng-ust/getenv.h index f8e7bc37..a5dffb24 100644 --- a/liblttng-ust/getenv.h +++ b/liblttng-ust/getenv.h @@ -7,8 +7,6 @@ #ifndef _COMPAT_GETENV_H #define _COMPAT_GETENV_H -#include "ust-helper.h" - /* * Always add the lttng-ust environment variables using the lttng_ust_getenv() * infrastructure rather than using getenv() directly. This ensures that we @@ -18,10 +16,10 @@ * lttng-ust) */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) char *lttng_ust_getenv(const char *name); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_getenv_init(void); #endif /* _COMPAT_GETENV_H */ diff --git a/liblttng-ust/lttng-bytecode-specialize.c b/liblttng-ust/lttng-bytecode-specialize.c index 3cb31ba2..1ba4ffeb 100644 --- a/liblttng-ust/lttng-bytecode-specialize.c +++ b/liblttng-ust/lttng-bytecode-specialize.c @@ -15,6 +15,7 @@ #include "context-internal.h" #include "lttng-bytecode.h" #include "ust-events-internal.h" +#include "ust-helper.h" static int lttng_fls(int val) { diff --git a/liblttng-ust/lttng-bytecode-validator.c b/liblttng-ust/lttng-bytecode-validator.c index b5bc4904..ea86c5e7 100644 --- a/liblttng-ust/lttng-bytecode-validator.c +++ b/liblttng-ust/lttng-bytecode-validator.c @@ -17,6 +17,7 @@ #include "lttng-hash-helper.h" #include "string-utils.h" #include "ust-events-internal.h" +#include "ust-helper.h" /* * Number of merge points for hash table size. Hash table initialized to diff --git a/liblttng-ust/lttng-bytecode.c b/liblttng-ust/lttng-bytecode.c index a16b35cc..6c86c634 100644 --- a/liblttng-ust/lttng-bytecode.c +++ b/liblttng-ust/lttng-bytecode.c @@ -15,6 +15,7 @@ #include "context-internal.h" #include "lttng-bytecode.h" #include "ust-events-internal.h" +#include "ust-helper.h" static const char *opnames[] = { [ BYTECODE_OP_UNKNOWN ] = "UNKNOWN", diff --git a/liblttng-ust/lttng-bytecode.h b/liblttng-ust/lttng-bytecode.h index b84a9930..180dfbda 100644 --- a/liblttng-ust/lttng-bytecode.h +++ b/liblttng-ust/lttng-bytecode.h @@ -314,32 +314,36 @@ struct lttng_interpreter_output { } u; }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) const char *lttng_bytecode_print_op(enum bytecode_op op); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_bytecode_filter_sync_state(struct lttng_ust_bytecode_runtime *runtime); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_bytecode_capture_sync_state(struct lttng_ust_bytecode_runtime *runtime); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_bytecode_validate(struct bytecode_runtime *bytecode); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_bytecode_specialize(const struct lttng_ust_event_desc *event_desc, struct bytecode_runtime *bytecode); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) uint64_t lttng_bytecode_filter_interpret_false(void *filter_data, const char *filter_stack_data); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) uint64_t lttng_bytecode_filter_interpret(void *filter_data, const char *filter_stack_data); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) uint64_t lttng_bytecode_capture_interpret_false(void *capture_data, const char *capture_stack_data, struct lttng_interpreter_output *output); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) uint64_t lttng_bytecode_capture_interpret(void *capture_data, const char *capture_stack_data, struct lttng_interpreter_output *output); diff --git a/liblttng-ust/lttng-tracer-core.h b/liblttng-ust/lttng-tracer-core.h index e9d5622f..59b2700e 100644 --- a/liblttng-ust/lttng-tracer-core.h +++ b/liblttng-ust/lttng-tracer-core.h @@ -16,7 +16,6 @@ #include #include #include -#include /* * The longuest possible namespace proc path is with the cgroup ns @@ -34,78 +33,93 @@ struct lttng_ust_lib_ring_buffer_ctx; struct lttng_ctx_value; struct lttng_ust_event_notifier; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int ust_lock(void) __attribute__ ((warn_unused_result)); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void ust_lock_nocheck(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void ust_unlock(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_fixup_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_event_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_vtid_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_procname_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_cgroup_ns_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_ipc_ns_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_net_ns_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_time_ns_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_fixup_uts_ns_tls(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_fixup_fd_tracker_tls(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) const char *lttng_ust_obj_get_name(int id); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_get_notify_socket(void *owner); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) char* lttng_ust_sockinfo_get_procname(void *owner); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_sockinfo_session_enabled(void *owner); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) ssize_t lttng_ust_read(int fd, void *buf, size_t len); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_ust_dummy_record(struct lttng_ctx_field *field, struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_channel *chan); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_dummy_get_value(struct lttng_ctx_field *field, struct lttng_ctx_value *value); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_event_notifier_notification_send( struct lttng_ust_event_notifier *event_notifier, const char *stack_data); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_counter_transport *lttng_counter_transport_find(const char *name); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_counter_transport_register(struct lttng_counter_transport *transport); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_counter_transport_unregister(struct lttng_counter_transport *transport); #ifdef HAVE_PERF_EVENT -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_fixup_perf_counter_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_perf_lock(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_perf_unlock(void); #else /* #ifdef HAVE_PERF_EVENT */ static inline diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index 1b21b80e..38de2259 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -47,6 +46,7 @@ #include "string-utils.h" #include "ust-events-internal.h" #include "context-internal.h" +#include "ust-helper.h" #define OBJ_NAME_LEN 16 @@ -762,7 +762,7 @@ long lttng_event_notifier_group_error_counter_cmd(int objd, unsigned int cmd, un return ret; } -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_release_event_notifier_group_error_counter(int objd) { struct lttng_counter *counter = objd_private(objd); diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 0797ef3c..fcf2cb14 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -361,13 +361,17 @@ extern void lttng_ring_buffer_client_overwrite_rt_exit(void); 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); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_32_modular_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_32_modular_exit(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_64_modular_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lttng_counter_client_percpu_64_modular_exit(void); static char *get_map_shm(struct sock_info *sock_info); @@ -455,7 +459,6 @@ int lttng_get_notify_socket(void *owner) } -LTTNG_HIDDEN char* lttng_ust_sockinfo_get_procname(void *owner) { struct sock_info *info = owner; diff --git a/liblttng-ust/lttng-ust-elf.c b/liblttng-ust/lttng-ust-elf.c index ce3b1ccc..fc4029c9 100644 --- a/liblttng-ust/lttng-ust-elf.c +++ b/liblttng-ust/lttng-ust-elf.c @@ -20,6 +20,7 @@ #include "lttng-tracer-core.h" #include "lttng-ust-elf.h" +#include "ust-helper.h" #define BUF_LEN 4096 diff --git a/liblttng-ust/lttng-ust-statedump.h b/liblttng-ust/lttng-ust-statedump.h index 887b8616..059aac93 100644 --- a/liblttng-ust/lttng-ust-statedump.h +++ b/liblttng-ust/lttng-ust-statedump.h @@ -10,14 +10,13 @@ #include -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_statedump_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_ust_statedump_destroy(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int do_lttng_ust_statedump(void *owner); #endif /* LTTNG_UST_STATEDUMP_H */ diff --git a/liblttng-ust/rculfhash-internal.h b/liblttng-ust/rculfhash-internal.h index 39b20ed5..2725008b 100644 --- a/liblttng-ust/rculfhash-internal.h +++ b/liblttng-ust/rculfhash-internal.h @@ -14,7 +14,6 @@ #include #include #include -#include "ust-helper.h" #ifdef DEBUG #define dbg_printf(fmt, args...) printf("[debug lttng-ust rculfhash] " fmt, ## args) @@ -126,11 +125,13 @@ struct lttng_ust_lfht { */ }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern unsigned int lttng_ust_lfht_fls_ulong(unsigned long x); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int lttng_ust_lfht_get_count_order_u32(uint32_t x); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int lttng_ust_lfht_get_count_order_ulong(unsigned long x); #ifdef POISON_FREE diff --git a/liblttng-ust/rculfhash.h b/liblttng-ust/rculfhash.h index 39f8e5a3..902618e5 100644 --- a/liblttng-ust/rculfhash.h +++ b/liblttng-ust/rculfhash.h @@ -13,7 +13,6 @@ #include #include #include -#include "ust-helper.h" #ifdef __cplusplus extern "C" { @@ -97,11 +96,13 @@ struct lttng_ust_lfht_mm_type { unsigned long index); }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_order; -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_chunk; -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_mmap; /* @@ -121,7 +122,7 @@ extern const struct lttng_ust_lfht_mm_type lttng_ust_lfht_mm_mmap; * Return NULL on error. * Note: the RCU flavor must be already included before the hash table header. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern struct lttng_ust_lfht *lttng_ust_lfht_new(unsigned long init_size, unsigned long min_nr_alloc_buckets, unsigned long max_nr_buckets, @@ -145,7 +146,7 @@ extern struct lttng_ust_lfht *lttng_ust_lfht_new(unsigned long init_size, * thread to handle resize operations, which removes RCU requirements on * lttng_ust_lfht_destroy. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lttng_ust_lfht_destroy(struct lttng_ust_lfht *ht); /* @@ -158,7 +159,7 @@ extern int lttng_ust_lfht_destroy(struct lttng_ust_lfht *ht); * Call with rcu_read_lock held. * Threads calling this API need to be registered RCU read-side threads. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_count_nodes(struct lttng_ust_lfht *ht, long *split_count_before, unsigned long *count, @@ -176,7 +177,7 @@ extern void lttng_ust_lfht_count_nodes(struct lttng_ust_lfht *ht, * Threads calling this API need to be registered RCU read-side threads. * This function acts as a rcu_dereference() to read the node pointer. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_lookup(struct lttng_ust_lfht *ht, unsigned long hash, lttng_ust_lfht_match_fct match, const void *key, struct lttng_ust_lfht_iter *iter); @@ -201,7 +202,7 @@ extern void lttng_ust_lfht_lookup(struct lttng_ust_lfht *ht, unsigned long hash, * Threads calling this API need to be registered RCU read-side threads. * This function acts as a rcu_dereference() to read the node pointer. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht, lttng_ust_lfht_match_fct match, const void *key, struct lttng_ust_lfht_iter *iter); @@ -216,7 +217,7 @@ extern void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht, * Threads calling this API need to be registered RCU read-side threads. * This function acts as a rcu_dereference() to read the node pointer. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_first(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter); /* @@ -231,7 +232,7 @@ extern void lttng_ust_lfht_first(struct lttng_ust_lfht *ht, struct lttng_ust_lfh * Threads calling this API need to be registered RCU read-side threads. * This function acts as a rcu_dereference() to read the node pointer. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_next(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter); /* @@ -246,7 +247,7 @@ extern void lttng_ust_lfht_next(struct lttng_ust_lfht *ht, struct lttng_ust_lfht * This function issues a full memory barrier before and after its * atomic commit. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_add(struct lttng_ust_lfht *ht, unsigned long hash, struct lttng_ust_lfht_node *node); @@ -277,7 +278,7 @@ extern void lttng_ust_lfht_add(struct lttng_ust_lfht *ht, unsigned long hash, * node pointer. The failure case does not guarantee any other memory * barrier. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_unique(struct lttng_ust_lfht *ht, unsigned long hash, lttng_ust_lfht_match_fct match, @@ -314,7 +315,7 @@ extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_unique(struct lttng_ust_lf * This function issues a full memory barrier before and after its * atomic commit. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_replace(struct lttng_ust_lfht *ht, unsigned long hash, lttng_ust_lfht_match_fct match, @@ -350,7 +351,7 @@ extern struct lttng_ust_lfht_node *lttng_ust_lfht_add_replace(struct lttng_ust_l * after its atomic commit. Upon failure, this function does not issue * any memory barrier. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lttng_ust_lfht_replace(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *old_iter, unsigned long hash, @@ -379,7 +380,7 @@ extern int lttng_ust_lfht_replace(struct lttng_ust_lfht *ht, * after its atomic commit. Upon failure, this function does not issue * any memory barrier. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lttng_ust_lfht_del(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_node *node); /* @@ -395,7 +396,7 @@ extern int lttng_ust_lfht_del(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_n * Threads calling this API need to be registered RCU read-side threads. * This function does not issue any memory barrier. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lttng_ust_lfht_is_node_deleted(const struct lttng_ust_lfht_node *node); /* @@ -408,7 +409,7 @@ extern int lttng_ust_lfht_is_node_deleted(const struct lttng_ust_lfht_node *node * lttng_ust_lfht_resize should *not* be called from a RCU read-side critical * section. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lttng_ust_lfht_resize(struct lttng_ust_lfht *ht, unsigned long new_size); /* diff --git a/liblttng-ust/string-utils.h b/liblttng-ust/string-utils.h index 84c48f00..21860529 100644 --- a/liblttng-ust/string-utils.h +++ b/liblttng-ust/string-utils.h @@ -10,13 +10,13 @@ #include #include -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) bool strutils_is_star_glob_pattern(const char *pattern); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) bool strutils_is_star_at_the_end_only_glob_pattern(const char *pattern); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) bool strutils_star_glob_match(const char *pattern, size_t pattern_len, const char *candidate, size_t candidate_len); diff --git a/liblttng-ust/tracepoint-internal.h b/liblttng-ust/tracepoint-internal.h index 424b9e65..26473b33 100644 --- a/liblttng-ust/tracepoint-internal.h +++ b/liblttng-ust/tracepoint-internal.h @@ -11,8 +11,6 @@ #include #include -#include "ust-helper.h" - #define TRACE_DEFAULT TRACE_DEBUG_LINE struct tracepoint_lib { @@ -22,19 +20,26 @@ struct tracepoint_lib { struct cds_list_head callsites; }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int tracepoint_probe_register_noupdate(const char *name, void (*callback)(void), void *priv, const char *signature); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int tracepoint_probe_unregister_noupdate(const char *name, void (*callback)(void), void *priv); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void tracepoint_probe_update_all(void); + +__attribute__((visibility("hidden"))) void *lttng_ust_tp_check_weak_hidden1(void); + +__attribute__((visibility("hidden"))) void *lttng_ust_tp_check_weak_hidden2(void); + +__attribute__((visibility("hidden"))) void *lttng_ust_tp_check_weak_hidden3(void); /* diff --git a/liblttng-ust/tracepoint-weak-test.c b/liblttng-ust/tracepoint-weak-test.c index 71e3f433..50afe005 100644 --- a/liblttng-ust/tracepoint-weak-test.c +++ b/liblttng-ust/tracepoint-weak-test.c @@ -11,19 +11,16 @@ struct { char a[24]; } __tracepoint_test_symbol3 __attribute__((weak, visibility("hidden"))); -__attribute__((visibility("hidden"))) void *lttng_ust_tp_check_weak_hidden1(void) { return &__tracepoint_test_symbol1; } -__attribute__((visibility("hidden"))) void *lttng_ust_tp_check_weak_hidden2(void) { return &__tracepoint_test_symbol2; } -__attribute__((visibility("hidden"))) void *lttng_ust_tp_check_weak_hidden3(void) { return &__tracepoint_test_symbol3; diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index 15025b09..01b13c44 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -12,7 +12,6 @@ #include #include -#include #include @@ -334,7 +333,7 @@ struct lttng_enabler *lttng_event_notifier_enabler_as_enabler( * On success, returns a `struct lttng_event_enabler`, * On memory error, returns NULL. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_event_enabler *lttng_event_enabler_create( enum lttng_enabler_format_type format_type, struct lttng_ust_abi_event *event_param, @@ -343,28 +342,28 @@ struct lttng_event_enabler *lttng_event_enabler_create( /* * Destroy a `struct lttng_event_enabler` object. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_event_enabler_destroy(struct lttng_event_enabler *enabler); /* * Enable a `struct lttng_event_enabler` object and all events related to this * enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_enabler_enable(struct lttng_event_enabler *enabler); /* * Disable a `struct lttng_event_enabler` object and all events related to this * enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_enabler_disable(struct lttng_event_enabler *enabler); /* * Attach filter bytecode program to `struct lttng_event_enabler` and all * events related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_enabler_attach_filter_bytecode( struct lttng_event_enabler *enabler, struct lttng_ust_bytecode_node **bytecode); @@ -374,7 +373,7 @@ int lttng_event_enabler_attach_filter_bytecode( * * Not implemented. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, struct lttng_ust_abi_context *ctx); @@ -382,7 +381,7 @@ int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, * Attach exclusion list to `struct lttng_event_enabler` and all * events related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler, struct lttng_ust_excluder_node **excluder); @@ -393,7 +392,7 @@ int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler, * This function goes over all bytecode programs of the enabler (event or * event_notifier enabler) to ensure each is linked to the provided instance. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc, struct lttng_ctx **ctx, struct cds_list_head *instance_bytecode_runtime_head, @@ -405,13 +404,13 @@ void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc, * On success, returns a `struct lttng_triggre_group`, * on memory error, returns NULL. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_event_notifier_group *lttng_event_notifier_group_create(void); /* * Destroy a `struct lttng_event_notifier_group` object. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_event_notifier_group_destroy( struct lttng_event_notifier_group *event_notifier_group); @@ -421,7 +420,7 @@ void lttng_event_notifier_group_destroy( * On success, returns a `struct lttng_event_notifier_enabler`, * On memory error, returns NULL. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( struct lttng_event_notifier_group *event_notifier_group, enum lttng_enabler_format_type format_type, @@ -430,7 +429,7 @@ struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( /* * Destroy a `struct lttng_event_notifier_enabler` object. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_event_notifier_enabler_destroy( struct lttng_event_notifier_enabler *event_notifier_enabler); @@ -438,7 +437,7 @@ void lttng_event_notifier_enabler_destroy( * Enable a `struct lttng_event_notifier_enabler` object and all event * notifiers related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_notifier_enabler_enable( struct lttng_event_notifier_enabler *event_notifier_enabler); @@ -446,7 +445,7 @@ int lttng_event_notifier_enabler_enable( * Disable a `struct lttng_event_notifier_enabler` object and all event * notifiers related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_notifier_enabler_disable( struct lttng_event_notifier_enabler *event_notifier_enabler); @@ -454,7 +453,7 @@ int lttng_event_notifier_enabler_disable( * Attach filter bytecode program to `struct lttng_event_notifier_enabler` and * all event notifiers related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_notifier_enabler_attach_filter_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, struct lttng_ust_bytecode_node **bytecode); @@ -463,7 +462,7 @@ int lttng_event_notifier_enabler_attach_filter_bytecode( * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and * all event_notifiers related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_notifier_enabler_attach_capture_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, struct lttng_ust_bytecode_node **bytecode); @@ -472,36 +471,38 @@ int lttng_event_notifier_enabler_attach_capture_bytecode( * Attach exclusion list to `struct lttng_event_notifier_enabler` and all * event notifiers related to this enabler. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_event_notifier_enabler_attach_exclusion( struct lttng_event_notifier_enabler *event_notifier_enabler, struct lttng_ust_excluder_node **excluder); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_free_event_filter_runtime(struct lttng_ust_event_common *event); /* * Connect the probe on all enablers matching this event description. * Called on library load. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_fix_pending_event_notifiers(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_counter *lttng_ust_counter_create( const char *counter_transport_name, size_t number_dimensions, const struct lttng_counter_dimension *dimensions); #ifdef HAVE_PERF_EVENT -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_add_perf_counter_to_ctx(uint32_t type, uint64_t config, const char *name, struct lttng_ctx **ctx); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_perf_counter_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_perf_counter_exit(void); #else /* #ifdef HAVE_PERF_EVENT */ @@ -525,41 +526,48 @@ void lttng_perf_counter_exit(void) } #endif /* #else #ifdef HAVE_PERF_EVENT */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list *list); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_probes_get_field_list(struct lttng_ust_field_list *list); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_probes_prune_field_list(struct lttng_ust_field_list *list); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_ust_abi_tracepoint_iter * lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list *list); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) struct lttng_ust_abi_field_iter * lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list *list); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_session *lttng_session_create(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_session_enable(struct lttng_session *session); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_session_disable(struct lttng_session *session); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_session_statedump(struct lttng_session *session); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_session_destroy(struct lttng_session *session); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct cds_list_head *lttng_get_sessions(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_handle_pending_statedump(void *owner); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_channel *lttng_channel_create(struct lttng_session *session, const char *transport_name, void *buf_addr, @@ -570,41 +578,47 @@ struct lttng_channel *lttng_channel_create(struct lttng_session *session, uint64_t **memory_map_size, struct lttng_channel *chan_priv_init); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_channel_enable(struct lttng_channel *channel); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_channel_disable(struct lttng_channel *channel); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_transport_register(struct lttng_transport *transport); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_transport_unregister(struct lttng_transport *transport); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_probe_provider_unregister_events(struct lttng_ust_probe_desc *desc); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_fix_pending_events(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct cds_list_head *lttng_get_probe_list_head(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_session *session, const struct lttng_ust_enum_desc *enum_desc); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_abi_create_root_handle(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) const struct lttng_ust_abi_objd_ops *lttng_ust_abi_objd_ops(int id); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_ust_abi_objd_unref(int id, int is_owner); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_ust_abi_exit(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_ust_abi_events_exit(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_ust_abi_objd_table_owner_cleanup(void *owner); #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */ diff --git a/libmsgpack/msgpack.h b/libmsgpack/msgpack.h index 04606306..f75be91a 100644 --- a/libmsgpack/msgpack.h +++ b/libmsgpack/msgpack.h @@ -12,7 +12,6 @@ #include #else /* __KERNEL__ */ #include -#include "ust-helper.h" #endif /* __KERNEL__ */ struct lttng_msgpack_writer { @@ -23,39 +22,49 @@ struct lttng_msgpack_writer { uint8_t map_nesting; }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_msgpack_writer_init( struct lttng_msgpack_writer *writer, uint8_t *buffer, size_t size); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_msgpack_writer_fini(struct lttng_msgpack_writer *writer); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lttng_msgpack_write_nil(struct lttng_msgpack_writer *writer); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_write_true(struct lttng_msgpack_writer *writer); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_write_false(struct lttng_msgpack_writer *writer); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_write_unsigned_integer( struct lttng_msgpack_writer *writer, uint64_t value); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_write_signed_integer( struct lttng_msgpack_writer *writer, int64_t value); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_write_double(struct lttng_msgpack_writer *writer, double value); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_write_str(struct lttng_msgpack_writer *writer, const char *value); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_begin_map(struct lttng_msgpack_writer *writer, size_t count); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_end_map(struct lttng_msgpack_writer *writer); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_begin_array( struct lttng_msgpack_writer *writer, size_t count); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int lttng_msgpack_end_array(struct lttng_msgpack_writer *writer); #endif /* _LTTNG_UST_MSGPACK_H */ diff --git a/libringbuffer/backend.h b/libringbuffer/backend.h index dbb5d735..e95bb7bc 100644 --- a/libringbuffer/backend.h +++ b/libringbuffer/backend.h @@ -15,8 +15,6 @@ #include #include -#include "ust-helper.h" - /* Internal helpers */ #include "backend_internal.h" #include "frontend_internal.h" @@ -25,12 +23,12 @@ /* Ring buffer backend access (read/write) */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern size_t lib_ring_buffer_read(struct lttng_ust_lib_ring_buffer_backend *bufb, size_t offset, void *dest, size_t len, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_read_cstr(struct lttng_ust_lib_ring_buffer_backend *bufb, size_t offset, void *dest, size_t len, struct lttng_ust_shm_handle *handle); @@ -41,12 +39,13 @@ extern int lib_ring_buffer_read_cstr(struct lttng_ust_lib_ring_buffer_backend *b * it's never on a page boundary, it's safe to write directly to this address, * as long as the write is never bigger than a page size. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void * lib_ring_buffer_offset_address(struct lttng_ust_lib_ring_buffer_backend *bufb, size_t offset, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void * lib_ring_buffer_read_offset_address(struct lttng_ust_lib_ring_buffer_backend *bufb, size_t offset, diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index 9e57a6c6..f0a66d46 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -18,44 +18,49 @@ #include "backend_types.h" #include "frontend_types.h" #include "shm.h" -#include "ust-helper.h" /* Ring buffer backend API presented to the frontend */ /* Ring buffer and channel backend create/free */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lib_ring_buffer_backend_create(struct lttng_ust_lib_ring_buffer_backend *bufb, struct channel_backend *chan, int cpu, struct lttng_ust_shm_handle *handle, struct shm_object *shmobj); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void channel_backend_unregister_notifiers(struct channel_backend *chanb); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lib_ring_buffer_backend_free(struct lttng_ust_lib_ring_buffer_backend *bufb); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int channel_backend_init(struct channel_backend *chanb, const char *name, const struct lttng_ust_lib_ring_buffer_config *config, size_t subbuf_size, size_t num_subbuf, struct lttng_ust_shm_handle *handle, const int *stream_fds); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void channel_backend_free(struct channel_backend *chanb, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lib_ring_buffer_backend_reset(struct lttng_ust_lib_ring_buffer_backend *bufb, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void channel_backend_reset(struct channel_backend *chanb); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int lib_ring_buffer_backend_init(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lib_ring_buffer_backend_exit(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void _lib_ring_buffer_write(struct lttng_ust_lib_ring_buffer_backend *bufb, size_t offset, const void *src, size_t len, ssize_t pagecpy); diff --git a/libringbuffer/frontend.h b/libringbuffer/frontend.h index 9bc22df8..2ab369e5 100644 --- a/libringbuffer/frontend.h +++ b/libringbuffer/frontend.h @@ -18,7 +18,6 @@ #include #include "smp.h" -#include "ust-helper.h" /* Internal helpers */ #include "frontend_internal.h" @@ -41,7 +40,7 @@ * private data area. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buffer_config *config, const char *name, @@ -60,7 +59,7 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff * channel_destroy finalizes all channel's buffers, waits for readers to * release all references, and destroys the channel. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle, int consumer); @@ -77,7 +76,7 @@ void channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle, #define for_each_channel_cpu(cpu, chan) \ for_each_possible_cpu(cpu) -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern struct lttng_ust_lib_ring_buffer *channel_get_ring_buffer( const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, int cpu, @@ -85,33 +84,38 @@ extern struct lttng_ust_lib_ring_buffer *channel_get_ring_buffer( int *shm_fd, int *wait_fd, int *wakeup_fd, uint64_t *memory_map_size); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int ring_buffer_channel_close_wait_fd(const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int ring_buffer_channel_close_wakeup_fd(const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int ring_buffer_stream_close_wait_fd(const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, struct lttng_ust_shm_handle *handle, int cpu); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int ring_buffer_stream_close_wakeup_fd(const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, struct lttng_ust_shm_handle *handle, int cpu); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_open_read(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lib_ring_buffer_release_read(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle); @@ -119,33 +123,35 @@ extern void lib_ring_buffer_release_read(struct lttng_ust_lib_ring_buffer *buf, * Initialize signals for ring buffer. Should be called early e.g. by * main() in the program to affect all threads. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lib_ringbuffer_signal_init(void); /* * Read sequence: snapshot, many get_subbuf/put_subbuf, move_consumer. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_snapshot(struct lttng_ust_lib_ring_buffer *buf, unsigned long *consumed, unsigned long *produced, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_snapshot_sample_positions( struct lttng_ust_lib_ring_buffer *buf, unsigned long *consumed, unsigned long *produced, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lib_ring_buffer_move_consumer(struct lttng_ust_lib_ring_buffer *buf, unsigned long consumed_new, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_get_subbuf(struct lttng_ust_lib_ring_buffer *buf, unsigned long consumed, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lib_ring_buffer_put_subbuf(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle); @@ -180,9 +186,10 @@ void lib_ring_buffer_put_next_subbuf(struct lttng_ust_lib_ring_buffer *buf, handle); } -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void channel_reset(struct channel *chan); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lib_ring_buffer_reset(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle); diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index c8a54e96..690f7f7a 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -21,7 +21,6 @@ #include "backend_types.h" #include "frontend_types.h" #include "shm.h" -#include "ust-helper.h" /* Buffer offset macros */ @@ -139,18 +138,18 @@ int last_tsc_overflow(const struct lttng_ust_lib_ring_buffer_config *config, } #endif -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_reserve_slow(struct lttng_ust_lib_ring_buffer_ctx *ctx, void *client_ctx); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void lib_ring_buffer_switch_slow(struct lttng_ust_lib_ring_buffer *buf, enum switch_mode mode, struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lib_ring_buffer_check_deliver_slow(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer *buf, struct channel *chan, @@ -341,17 +340,18 @@ void lib_ring_buffer_write_commit_counter(const struct lttng_ust_lib_ring_buffer v_set(config, &cc_hot->seq, commit_count); } -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int lib_ring_buffer_create(struct lttng_ust_lib_ring_buffer *buf, struct channel_backend *chanb, int cpu, struct lttng_ust_shm_handle *handle, struct shm_object *shmobj); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void lib_ring_buffer_free(struct lttng_ust_lib_ring_buffer *buf, struct lttng_ust_shm_handle *handle); /* Keep track of trap nesting inside ring buffer code */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern DECLARE_URCU_TLS(unsigned int, lib_ring_buffer_nesting); #endif /* _LTTNG_RING_BUFFER_FRONTEND_INTERNAL_H */ diff --git a/libringbuffer/getcpu.h b/libringbuffer/getcpu.h index 8785d496..701deeb2 100644 --- a/libringbuffer/getcpu.h +++ b/libringbuffer/getcpu.h @@ -11,12 +11,10 @@ #include #include -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_ust_getcpu_init(void); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int (*lttng_get_cpu)(void); #ifdef LTTNG_UST_DEBUG_VALGRIND diff --git a/libringbuffer/nohz.h b/libringbuffer/nohz.h index 2898cc43..011d88e2 100644 --- a/libringbuffer/nohz.h +++ b/libringbuffer/nohz.h @@ -7,14 +7,14 @@ #ifndef _LTTNG_RING_BUFFER_NOHZ_H #define _LTTNG_RING_BUFFER_NOHZ_H -#include "ust-helper.h" - #ifdef CONFIG_LIB_RING_BUFFER -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lib_ring_buffer_tick_nohz_flush(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lib_ring_buffer_tick_nohz_stop(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lib_ring_buffer_tick_nohz_restart(void); #else static inline void lib_ring_buffer_tick_nohz_flush(void) diff --git a/libringbuffer/rb-init.h b/libringbuffer/rb-init.h index 319cf414..7dccebe6 100644 --- a/libringbuffer/rb-init.h +++ b/libringbuffer/rb-init.h @@ -7,11 +7,10 @@ #ifndef _LTTNG_UST_LIB_RINGBUFFER_RB_INIT_H #define _LTTNG_UST_LIB_RINGBUFFER_RB_INIT_H -#include "ust-helper.h" - -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) void lttng_fixup_ringbuffer_tls(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void lttng_ust_ringbuffer_set_allow_blocking(void); #endif /* _LTTNG_UST_LIB_RINGBUFFER_RB_INIT_H */ diff --git a/libringbuffer/shm.h b/libringbuffer/shm.h index ee843858..b5584647 100644 --- a/libringbuffer/shm.h +++ b/libringbuffer/shm.h @@ -13,22 +13,24 @@ #include #include #include "shm_types.h" -#include "ust-helper.h" /* channel_handle_create - for UST. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern struct lttng_ust_shm_handle *channel_handle_create(void *data, uint64_t memory_map_size, int wakeup_fd); + /* channel_handle_add_stream - for UST. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int channel_handle_add_stream(struct lttng_ust_shm_handle *handle, int shm_fd, int wakeup_fd, uint32_t stream_nr, uint64_t memory_map_size); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) unsigned int channel_handle_get_nr_streams(struct lttng_ust_shm_handle *handle); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle, int consumer); @@ -78,23 +80,27 @@ void _set_shmp(struct shm_ref *ref, struct shm_ref src) #define set_shmp(ref, src) _set_shmp(&(ref)._ref, src) -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct shm_object_table *shm_object_table_create(size_t max_nb_obj); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) struct shm_object *shm_object_table_alloc(struct shm_object_table *table, size_t memory_map_size, enum shm_object_type type, const int stream_fd, int cpu); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) struct shm_object *shm_object_table_append_shm(struct shm_object_table *table, int shm_fd, int wakeup_fd, uint32_t stream_nr, size_t memory_map_size); + /* mem ownership is passed to shm_object_table_append_mem(). */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct shm_object *shm_object_table_append_mem(struct shm_object_table *table, void *mem, size_t memory_map_size, int wakeup_fd); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void shm_object_table_destroy(struct shm_object_table *table, int consumer); /* @@ -104,9 +110,10 @@ void shm_object_table_destroy(struct shm_object_table *table, int consumer); * *NOT* multithread-safe (should be protected by mutex). * Returns a -1, -1 tuple on error. */ -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) struct shm_ref zalloc_shm(struct shm_object *obj, size_t len); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void align_shm(struct shm_object *obj, size_t align); static inline diff --git a/libringbuffer/smp.h b/libringbuffer/smp.h index b04401e1..78b1851f 100644 --- a/libringbuffer/smp.h +++ b/libringbuffer/smp.h @@ -7,7 +7,6 @@ #ifndef _LIBRINGBUFFER_SMP_H #define _LIBRINGBUFFER_SMP_H -#include "ust-helper.h" #include "getcpu.h" /* @@ -16,9 +15,10 @@ */ #define PER_CPU_MEM_SIZE 4096 -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int __num_possible_cpus; -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern void _get_num_possible_cpus(void); static inline diff --git a/snprintf/floatio.h b/snprintf/floatio.h index ad696314..db4a3c73 100644 --- a/snprintf/floatio.h +++ b/snprintf/floatio.h @@ -10,8 +10,6 @@ * Chris Torek. */ -#include "ust-helper.h" - /* * Floating point scanf/printf (input/output) definitions. */ @@ -33,9 +31,11 @@ #error "floating point buffers too small" #endif -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) char *__hdtoa(double, const char *, int, int *, int *, char **); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) char *__hldtoa(long double, const char *, int, int *, int *, char **); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) char *__ldtoa(long double *, int, int, int *, int *, char **); diff --git a/snprintf/fvwrite.h b/snprintf/fvwrite.h index a758b508..42f77a93 100644 --- a/snprintf/fvwrite.h +++ b/snprintf/fvwrite.h @@ -15,8 +15,6 @@ */ #include -#include "ust-helper.h" - struct __lttng_ust_siov { void *iov_base; size_t iov_len; @@ -27,5 +25,5 @@ struct __lttng_ust_suio { int uio_resid; }; -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int __sfvwrite(LTTNG_UST_LFILE *, struct __lttng_ust_suio *); diff --git a/snprintf/local.h b/snprintf/local.h index e4af0ea2..06e72632 100644 --- a/snprintf/local.h +++ b/snprintf/local.h @@ -17,45 +17,59 @@ #include #include -#include "ust-helper.h" #include "various.h" #include "wcio.h" #include "fileext.h" -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) int __sflush(LTTNG_UST_LFILE *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) LTTNG_UST_LFILE *__sfp(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __srefill(LTTNG_UST_LFILE *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __sread(void *, char *, int); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __swrite(void *, const char *, int); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) fpos_t __sseek(void *, fpos_t, int); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __sclose(void *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void __sinit(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void _cleanup(void); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) void __smakebuf(LTTNG_UST_LFILE *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __swhatbuf(LTTNG_UST_LFILE *, size_t *, int *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int _fwalk(int (*)(LTTNG_UST_LFILE *)); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __swsetup(LTTNG_UST_LFILE *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) int __sflags(const char *, int *); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) wint_t __fgetwc_unlock(LTTNG_UST_LFILE *); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern void __atexit_register_cleanup(void (*)(void)); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int __sdidinit; /* diff --git a/snprintf/various.h b/snprintf/various.h index 7bf14298..4fb3145b 100644 --- a/snprintf/various.h +++ b/snprintf/various.h @@ -16,8 +16,6 @@ #include #include -#include "ust-helper.h" - struct __lttng_ust_sbuf { unsigned char *_base; int _size; @@ -100,12 +98,13 @@ typedef struct __lttng_ust_sFILE { #define __sferror(p) (((p)->_flags & __SERR) != 0) -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern int ust_safe_fflush(LTTNG_UST_LFILE *fp); -LTTNG_HIDDEN + +__attribute__((visibility("hidden"))) extern int ust_safe_vfprintf(LTTNG_UST_LFILE *fp, const char *fmt0, va_list ap); -LTTNG_HIDDEN +__attribute__((visibility("hidden"))) extern size_t ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); #endif /* UST_SNPRINTF_VARIOUS_H */