From 397b64418eca71b5f9c1bdc427589ac0505b996b Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 27 Dec 2020 14:48:46 -0500 Subject: [PATCH] Fix: Use default visibility for tracepoint provider symbol When building a probe provider `someprobe` with -fvisibility=hidden into a shared library, the `__tracepoint_provider_someprobe` symbol is hidden, which does not allow tracepoint instrumentation to link to it. Fix this by using the "default" visibility attribute. For a shared library built with -fvisibility=hidden, this changes the output of nm for that symbol from: 000000000000417c b __tracepoint_provider_someprobe (local BSS symbol) to 000000000000417c B __tracepoint_provider_someprobe (global (external) BSS symbol) Fixes: #1296 Signed-off-by: Mathieu Desnoyers Change-Id: I308374f6cac58cca86e8eb19c872286a3da21a75 --- include/lttng/ust-tracepoint-event.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 63b3bd49..da52162c 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -1056,4 +1056,5 @@ _TP_COMBINE_TOKENS(__lttng_events_exit__, TRACEPOINT_PROVIDER)(void) lttng_probe_unregister(&_TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER)); } -int _TP_COMBINE_TOKENS(__tracepoint_provider_, TRACEPOINT_PROVIDER); +int _TP_COMBINE_TOKENS(__tracepoint_provider_, TRACEPOINT_PROVIDER) +__attribute__((visibility("default"))); -- 2.34.1