Fix: java-jul/Makefile should not be marked as a binary

java-jul/Makefile is part of bin_SCRIPTS which causes it to be
installed under /usr/local/bin.

It is already installed as an example.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: handle sysconf errors

CID 1021261 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)10.
negative_returns: "sysconf(30)" is passed to a parameter that cannot be
negative.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: remove logically dead code

CID 1021235 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line:
Execution cannot reach this statement "case LTTNG_UST_LOGLEVEL_ALL:".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: dereference before null check

Found by Coverity:
CID 1090602 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking "stream" suggests that it may be null,
but it has already been dereferenced on all paths leading to the check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: tracepoint out of memory handling

CID 1021247 (#1 of 1): Dereference null return value (NULL_RETURNS)3.
dereference: Dereferencing a null pointer "pl".

Handle more gracefully add_callsite memory allocation failure too.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add assert for NULL dereference

CID 1021248 (#1 of 1): Dereference null return value (NULL_RETURNS)3.
dereference: Dereferencing a null pointer "obj".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Dump executable base-address with readlink

The previous approach only worked if the traced executable was invoked
via its fully qualified path. Using readlink to determine the full
qualified path of the traced executable works reliably even when the
traced executable is started via PATH lookup.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: fix comment

Fixes #652

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Unsynchronized access in LTTngTCPSessiondClient

enabledEventList is shared between the LTTngThread and eventTimer
threads but is not synchronized.

This patch changes enabledEventList's type from an ArrayList to a
synchronized HashSet.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: handle registration done command

This makes the getLTTngAgent() call wait until we receive that message
so that in the meantime the session daemon can enable events.

Fixes #692

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: JUL agent connect to user and root sessiond

In order to achieve such a thing, two tracepoints are used where one is
for the regular user and the other one for root. This is to avoid
duplicating the payload in the user and root traces.

Furthermore, if a root port is found, a new thread is started to handle
the second session daemon.

This is lockstep commit with lttng-tools:
f43f95a9a82e01eed34593260d510bd32e2083ec

Fixes #732

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: dynamically fetch the session daemon port

When connecting to the session daemon, fetch the port at each try. This
moves the read port file functions to the TCP session daemon client
where the connect happens.

If the port file is not found, simply retry 3 seconds later. Also, this
adds a timeout to the acquire semaphore of 3 seconds.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Skip lttng-gen-tp example build if Python is missing

Fixes #665

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: JUL support multiple loglevels

Fixes #744

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

Instead of having base address state dump enabled by default make it
necessary to explicitly enable it with environment variable
LTTNG_UST_WITH_EXPERIMENTAL_BADDR_STATEDUMP.

Documentation is updated to reflect this change and explain about the
experimental nature of this feature.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Cast from pointer to different integer size warning

Occurs on a 32-bit build. Caused by casting pointer arguments to 64-bit
integers (in the filter stack preparation code).

Fixes #691

Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: JUL test: update to API change

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

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: incorrect urcu git URL in README

Reported-by: Ruslan Uvashev <ruslan.uvashev@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: mismatch between code and comments

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>