Fix: missing valid return code when adding an URI to consumer

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: allow empty URL for live session creation

This is actually very important so -C/-D can be used with lttng create
--live command and also the load command can set the control and data
URL independently.

This also adds a small test to make sure -C/-D works in live mode.

Fixes #769

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: use NULL url for load live session

For a live session, the control and data URI are mandatory thus pass
NULL to the create session so we can set them afterwards by a set
consumer URL call.

net:// can't be used for control and data so this fixes the uri to url
string by printing "tcp://" instead of net:// which is more accurate and
the good way to actually print the URL to the user.

Fixes #767

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: set full path in .gitignore

Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: add tests for the save and load feature

This commit integrates the tests to the fast make check.

Fixes #757

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: missing test file in EXTRA dist

Fixes #753

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: don't ask data pending if session was not started

Fixes #770

Signed-off-by: David Goulet <dgoulet@efficios.com>
Rename variable in session.h for clarity

The "started" var. is changed to the flag "has_been_started" indicating
if at least ONE start command has been seen.

The "enabled" var. is changed to the flag "active" and the semantic is
the same.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Rename kernel and ust trace variable for clarity

Signed-off-by: David Goulet <dgoulet@efficios.com>
Update ChangeLog and configure to 2.4.0 stable

Signed-off-by: David Goulet <dgoulet@efficios.com>
Remove -s option from lttng load command

This is to help usability and also provide the same usage as lttng save
command that does not require this option.

Fixes #755

Signed-off-by: David Goulet <dgoulet@efficios.com>
Print message on a successful load command

Fixes #754

Signed-off-by: David Goulet <dgoulet@efficios.com>
Update load help message

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: bad errno handling in load session from path

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: allow loading session file with -i option

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: update test to use correct lttng load option

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: don't spawn relayd if URL is provided

In the lttng command line tool, relayd should only be spawned for the
default use case which is no URL provided.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: add consumer wake up pipe to avoid race

UST application will notify the wait_fd pipe for every subbuffer that it
writes and ready to be consumed. However, on *high* load systems, this
1:1 property can fail if the pipe gets filled up. For performance
reason, UST will ignore this error and continue since it can't wait for
the pipe to clear up.

This triggers a race condition where we have *one* wake up on the UST
pipe for potentially multiple subbuffers. A data pending command will
wait forever on streams that still has data but the data thread could'nt
consumed them because of this 1:n possible race. Using the stop command
without waiting would mean a memory/fd leak of the stream.

Thus, we add a consumer wake up pipe here that notifies the data thread
if there is still data to be read after a successful read subbuffer
call. With this, we end up handling the residual buffers if any since
the data thread is always notified when there is still data to be read.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: take session list lock when listing tp

This is important since the list tracepoints command access the
application socket to ask the application for its TPs. The session list
lock protects the ordering of message for those sockets.

This was triggering out of order message between the session daemon and
an application thus triggering undefined behavior.

Fixes #774

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: don't print stream name in error message

The stream received, in per UID, is actually a temporary stream object
that only contains the UST object data which is the relevant part for
UST to use.

Thus on error the name was random data thus print the valid handle
descriptor instead of invalid data.

Signed-off-by: David Goulet <dgoulet@efficios.com>