[lttng-dev] [PATCH v2] Improve tracef/tracelog to use the stack for small strings

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Aug 1 11:24:27 EDT 2022


----- On Aug 1, 2022, at 10:44 AM, Norbert Lange via lttng-dev lttng-dev at lists.lttng.org wrote:
[...]
> 
> Any chance of not having to link liblttng-ust for the tracelog/tracef functions,
> like all other tracepoints (only hard dependency on liblttng-ust-tracepoint)?
> My involvement is limited to "complain-only" for that one, but think of
> how technically great that would be!

Here is how we could do this:

1) move the implementation of src/lib/lttng-ust/tracelog.c to its own .so, e.g.
   liblttng-ust-tracelog.so,
2) modify the tracelog/tracef public headers so they dlopen() this new .so from
   a library constructor, similarly to what tracepoint.h does.

We'd need to make sure the symbols from tracelog.c are still emitted in
liblttng-ust.so, _and_ have another version (with a prefix/suffix) emitted from
liblttng-ust-tracelog.so, so we don't break ABI.

Thoughts ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list