Fix: header inclusion guard typo in lttng-ust-tracef-provider.h

Fix typo potentially allowing for multiple inclusions.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: multiple providers in same C file failure

If we have a C file in an application that is meant to contain both the
instrumentation and the provider, build fails if we have more than one
provider.

Fixed by putting back definitions to the state they were when defined by
tracepoint.h after a probe provider is created. This allows the next
tracepoint provider to define its tracepoints.

Fixes #805

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Wrong configure check for UST perf event counters context support

When building on non-x86 platforms, the build errors out with the following:

  CC       lttng-context-perf-counters.lo
lttng-context-perf-counters.c:95:2: error: #error "Perf event counters are only supported on x86 so far."
lttng-context-perf-counters.c: In function 'read_perf_counter':
lttng-context-perf-counters.c:114:4: warning: implicit declaration of function 'rdpmc' [-Wimplicit-function-declaration]
make[2]: *** [lttng-context-perf-counters.lo] Error 1

The configure script checks for the presence of the "perf_event.h" header to enable support for
perf events counters. However, the current implementation is only available on x86,
hence the build fails on platform where the perf header is available.

Fix this issue by detecting the architecture we are currently building and wether
to enable or not the support for perf event counters context.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
JUL: use root logger to capture events

The JUL agent now uses the root logger ("") to capture all events. This
allows us to remove the Timer thread and cleanup a huge portion of the
code base. It simplifies a great deal the internal structure of the
agent since we don't have to monitor the Logger object anymore.

Since tracepoint filtering is done in UST, we just the LTTng handler to
the root logger and send everything to UST.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: lttng-ust-jul: set thread in daemon mode

This way, when the JVM stops the main thread, the agent's thread will be
automatically shutdown thus making the .dispose() call optional.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Version 2.5.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng ust: support ppc64le within configure

Takes care of https://bugzilla.redhat.com/show_bug.cgi?id=1114691

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add lttng_ust_notrace to static inline functions

The static inline functions
__tracepoint_provider_mismatch_<TRACEPOINT_PROVIDER> and
__tracepoint_provider_check_<TRACEPOINT_PROVIDER> are missing the
lttng_ust_notrace attribute to prevent them from getting instrumented
with -finstrument-functions (if e.g. defined in CFLAGS). This patch is
adding the attribute to those functions.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Move enablers syncing after the channel registration

Fixes possible race condition where an event registration is received
before its channel registration by the consumer.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Bugfix for #745 deadlock with baddr statedump+fork

Fixes #745

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: document ust_fork_mutex nesting

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Revert "Turn base address dump into experimental feature"

This reverts commit b11abb674e50c67e3410ab2bd5d0a263e88b73ba.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mutex while updating statedump_pending is not needed

Take care of coverity warning ** CID 1226392:  Data race condition  (MISSING_LOCK)
/liblttng-ust/lttng-ust-comm.c: 1704 in lttng_ust_sockinfo_session_enabled()

It's not that the lock is missing, it's that we don't need to hold the
lock when doing the other modification.

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

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add probe data to lttng_ust_event struct

Create a lttng_ust_event_probe_attr struct to hold the instrument
target data.

Add 'probe' field to struct lttng_ust_event.
Define instrument target structure for UST ABI

Define a structure for holding instrument target data. The last item
is a flexible array that contains the path of instrument target, whose
length is stored as 'path_len'.
Define a new command LTTNG_UST_TARGET

Define a new command id for sending instrument target to enablers.
Define the structure for passing the command.
Send instrument target data through ustcomm

Define a function ustctl_set_target() that sends the instrument
target through ustcomm with the LTTNG_UST_TARGET command.
Add handler for LTTNG_UST_TARGET in UST ABI

Define a lttng_ust_target_node struct to store the target data.

Add message handler for the LTTNG_UST_TARGET command in
UST ABI. Copy the target data into a lttng_ust_target_node
structure and pass it to the corresponding enabler.
Copy probe data in ustctl_create_event()

Based on the instrumentation type of event, copy probe data in
ustctl_create_event() if necessary.