Fix: Use default visibility for tracepoint provider symbol
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 27 Dec 2020 19:48:46 +0000 (14:48 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 20 Jan 2021 16:59:04 +0000 (11:59 -0500)
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 <mathieu.desnoyers@efficios.com>
Change-Id: I308374f6cac58cca86e8eb19c872286a3da21a75

include/lttng/ust-tracepoint-event.h

index ef9ea692dad9f48703d3e2e360210da9f339b1e6..505b58e7472dadcf204ae21012686e8bbe164630 100644 (file)
@@ -1179,4 +1179,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")));
This page took 0.029863 seconds and 4 git commands to generate.