From: Michael Jeanson Date: Tue, 9 Mar 2021 19:56:44 +0000 (-0500) Subject: Hide or namespace the remaining tracepoint internal symbols X-Git-Tag: v2.13.0-rc1~282 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d10a220587d0a41c85da916a65e9dfc9f61062fa;p=lttng-ust.git Hide or namespace the remaining tracepoint internal symbols The major SONAME bump to '1' gives us the opportunity to hide private symbols that should never have been visible. Namespace the symbols that are part of the liblttng-ust-tracepoint ABI but are not part of the public API. Change-Id: I46125715e88f88891fe0c02a95adbbf6792a33e2 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index e7b59b1b..ad71efef 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -254,7 +254,7 @@ void register_event(struct lttng_ust_event_common *event) assert(event->priv->registered == 0); desc = event->priv->desc; - ret = __tracepoint_probe_register_queue_release(desc->name, + ret = lttng_ust_tp_probe_register_queue_release(desc->name, desc->probe_callback, event, desc->signature); WARN_ON_ONCE(ret); @@ -270,7 +270,7 @@ void unregister_event(struct lttng_ust_event_common *event) assert(event->priv->registered == 1); desc = event->priv->desc; - ret = __tracepoint_probe_unregister_queue_release(desc->name, + ret = lttng_ust_tp_probe_unregister_queue_release(desc->name, desc->probe_callback, event); WARN_ON_ONCE(ret); @@ -297,7 +297,7 @@ void lttng_session_destroy(struct lttng_session *session) _lttng_event_unregister(event_recorder_priv->parent.pub); } lttng_ust_urcu_synchronize_rcu(); /* Wait for in-flight events to complete */ - __tracepoint_probe_prune_release_queue(); + lttng_ust_tp_probe_prune_release_queue(); cds_list_for_each_entry_safe(event_enabler, event_tmpenabler, &session->priv->enablers_head, node) lttng_event_enabler_destroy(event_enabler); @@ -1186,7 +1186,7 @@ void lttng_probe_provider_unregister_events( /* Wait for grace period. */ lttng_ust_urcu_synchronize_rcu(); /* Prune the unregistration queue. */ - __tracepoint_probe_prune_release_queue(); + lttng_ust_tp_probe_prune_release_queue(); /* * It is now safe to destroy the events and remove them from the event list @@ -1703,7 +1703,7 @@ void lttng_session_sync_event_enablers(struct lttng_session *session) lttng_bytecode_filter_sync_state(runtime); } } - __tracepoint_probe_prune_release_queue(); + lttng_ust_tp_probe_prune_release_queue(); } /* Support for event notifier is introduced by probe provider major version 2. */ @@ -1921,7 +1921,7 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group lttng_bytecode_capture_sync_state(runtime); } } - __tracepoint_probe_prune_release_queue(); + lttng_ust_tp_probe_prune_release_queue(); } /* diff --git a/liblttng-ust/tracepoint-internal.h b/liblttng-ust/tracepoint-internal.h index 18705e8b..424b9e65 100644 --- a/liblttng-ust/tracepoint-internal.h +++ b/liblttng-ust/tracepoint-internal.h @@ -11,6 +11,8 @@ #include #include +#include "ust-helper.h" + #define TRACE_DEFAULT TRACE_DEBUG_LINE struct tracepoint_lib { @@ -20,23 +22,33 @@ struct tracepoint_lib { struct cds_list_head callsites; }; -extern int tracepoint_probe_register_noupdate(const char *name, +LTTNG_HIDDEN +int tracepoint_probe_register_noupdate(const char *name, void (*callback)(void), void *priv, const char *signature); -extern int tracepoint_probe_unregister_noupdate(const char *name, + +LTTNG_HIDDEN +int tracepoint_probe_unregister_noupdate(const char *name, void (*callback)(void), void *priv); -extern void tracepoint_probe_update_all(void); -extern int __tracepoint_probe_register_queue_release(const char *name, +LTTNG_HIDDEN +void tracepoint_probe_update_all(void); + +void *lttng_ust_tp_check_weak_hidden1(void); +void *lttng_ust_tp_check_weak_hidden2(void); +void *lttng_ust_tp_check_weak_hidden3(void); + +/* + * These symbols are ABI between liblttng-ust-tracepoint and liblttng-ust, + * which is why they are not hidden and not part of the public API. + */ +int lttng_ust_tp_probe_register_queue_release(const char *name, void (*func)(void), void *data, const char *signature); -extern int __tracepoint_probe_unregister_queue_release(const char *name, +int lttng_ust_tp_probe_unregister_queue_release(const char *name, void (*func)(void), void *data); -extern void __tracepoint_probe_prune_release_queue(void); +void lttng_ust_tp_probe_prune_release_queue(void); void lttng_ust_tp_init(void); void lttng_ust_tp_exit(void); -void *lttng_ust_tp_check_weak_hidden1(void); -void *lttng_ust_tp_check_weak_hidden2(void); -void *lttng_ust_tp_check_weak_hidden3(void); #endif /* _LTTNG_TRACEPOINT_INTERNAL_H */ diff --git a/liblttng-ust/tracepoint.c b/liblttng-ust/tracepoint.c index b966d76b..8d41d97a 100644 --- a/liblttng-ust/tracepoint.c +++ b/liblttng-ust/tracepoint.c @@ -619,10 +619,10 @@ end: /* * Caller needs to invoke __tracepoint_probe_release_queue() after - * calling __tracepoint_probe_register_queue_release() one or multiple + * calling lttng_ust_tp_probe_register_queue_release() one or multiple * times to ensure it does not leak memory. */ -int __tracepoint_probe_register_queue_release(const char *name, +int lttng_ust_tp_probe_register_queue_release(const char *name, void (*probe)(void), void *data, const char *signature) { void *old; @@ -690,10 +690,10 @@ end: /* * Caller needs to invoke __tracepoint_probe_release_queue() after - * calling __tracepoint_probe_unregister_queue_release() one or multiple + * calling lttng_ust_tp_probe_unregister_queue_release() one or multiple * times to ensure it does not leak memory. */ -int __tracepoint_probe_unregister_queue_release(const char *name, +int lttng_ust_tp_probe_unregister_queue_release(const char *name, void (*probe)(void), void *data) { void *old; @@ -714,7 +714,7 @@ end: return ret; } -void __tracepoint_probe_prune_release_queue(void) +void lttng_ust_tp_probe_prune_release_queue(void) { CDS_LIST_HEAD(release_probes); struct tp_probes *pos, *next;