[lttng-dev] [RFC PATCH lttng-ust] Implement register_done waiting via LD_AUDIT

Alexander Monakov amonakov at ispras.ru
Tue Jul 1 13:14:16 EDT 2014


On Tue, 1 Jul 2014, Woegerer, Paul wrote:
> Unfortunately the current approach of delaying execution of main until
> lttng-ust is available has several drawbacks. E.g. the dynamic linker
> lock is taken during the execution the static ctor. Using glibc
> functions that also require the same lock as part of the lttng-ust
> initialization easily gets us into a deadlock situation.

That's surprising; in my experience dlopen/dlsym from a static DSO ctor work,
so I wonder what functions are causing a deadlock for you.

> This patch is trying to delay execution of main with a different
> technique (using a named semaphore in la_preinit to wait for lttng-ust
> initialization).

Frankly I don't think LD_AUDIT is the right tool for the job in this case,
even ignoring its flakiness in glibc; better to fix your current approach if
possible.

> Having a stable LD_AUDIT interface would be extremely valuable in the
> context of tracing.

Oh, but the interface is extremely stable, it was unchanging for a long time
now; it's just the implementation... ;)  (sorry, could not resist)

Also note that LD_AUDIT on Linux is glibc-specific, not available on other
libcs that are otherwise quite useful, such as Bionic.

Alexander



More information about the lttng-dev mailing list