Use autoconf AM_MAINTAINER_MODE

Give distribution maintainers the option to skip rebuilding
autoconf and automake generated files. The default behaviour
is still to have the rebuild rules enabled.

Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add 'unused' attribute to tracepoint callback

Compiling tracepoint provider with clang generates 'Wunused-function'
warnings. Add 'unused' attribute to silence these warnings.

Fixes #760

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Implement tracef() instrumentation API

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add missing header files for tracef

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add demo-tracef to dist tarball

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: liblttng-ust-libc-wrapper recursive use of calloc

When built with URCU with --disable-compiler-tls, URCU tls-compat.h uses
calloc in its TLS compat layer. This is used by RCU read-side, which is
used by tracepoint. So using a tracepoint in calloc triggers an infinite
recursion, since its first use of the TLS (with TLS compat) calls
calloc.

Fix this issue by keeping a per-thread nesting counter, and as soon as
we are allocating memory from a context nested within the memory
allocator, don't trace.

Don't trace from the static allocator: keep it as simple as possible,
since this is our fallback.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: typo in lttng-ust.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: lttng-ust needs -ldl for tracef()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: malloc wrapper: infinite recursion with compat TLS

Fixes #765

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: configure.ac: add missing result to alignment req. check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: don't accept configure --disable-shared

Building LTTng-UST with --disable-shared compiles fine, but the
resulting installed static libraries silently fails to trace, because
tracepoint fails to dlopen liblttng-ust-tracepoint.so. So don't allow
this unsupported configure option.

Also document this requirement in the README.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>