Fix: consumer data pending for empty streams

We should at least output one packet before a stream can be considered
as readable. So far, for PID buffers, if an application exits at the
wrong timing before a stop waiting for data pending, empty streams could
be visible by a babeltrace executed after data pending incorrectly
returned false.

Fix it by considering a stream for which the consumerd has written 0
bytes to the output as having data pending.

This applies to 2.3-rc and stable-2.2.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: missing data pending signess conversion

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: remove bad check after epoll wait in consumer

The returned nb_fd value is the number of FD ready for the requested I/O
so having and revents set to 0 is possible since not all fd are ready
thus making this check irrelevant and actually ressource consuming.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: delete the trace directory used for the test

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: correctly close metadata on sessiond thread shutdown

Introduce a _close_metadata() function that does not take any locks so
it can be used by multiple call sites with different locking scheme.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: fix periodical flush tests to stop app

The test now SIGSTOP the application before validating the trace and
once done, SIGKILL them. This way we make sure we test the periodical
flush feature by letting the application live, stopping it from creating
more events and validating the flush.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: remove wrong doing asserts in sessiond

Asserting on the fd and socket was wrong since the two fds can be set to
-1 concurrently when calling this function.

Fixes #624

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: hashtable: take split_count_order into account

This makes check_resize() handle split-counters more precisely.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Update version to v2.3.0-rc3

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: remove periodical flush test from make check

This test is racy for the following reasons. It expects that the
subbuffer flush timer always produce a coherent trace after a period of
time but this cannot be guaranteed without the upcoming live feature.

A test based on time expectation is a bit flacky so disable it for now
until we have live tracing.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Update version to v2.3.0

Signed-off-by: David Goulet <dgoulet@efficios.com>
Add original snapshot proposal to documentation

Signed-off-by: David Goulet <dgoulet@efficios.com>
Enable support for installcheck.

Enable execution of tests via `make installcheck`, i.e. against a fully
installed
LTTng.

The patch simply adds the same rule to the installcheck target that is
used for check.  Testing with an OpenEmbedded build shows the unit_tests
suite to work fine, while the fast_regression suite contains many
failures not present when run as `make check`.

Stefan Seefeld (1):
  Enable support for installcheck.

Signed-off-by: Stefan Seefeld <stefan_seefeld@mentor.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add UST snapshots list output and max-size tests

Add two new tests to the UST snapshots tests:

test_ust_list_output:
Add/remove named outputs and validate with the list output command.

test_ust_local_snapshot_max_size:
Take a UST snapshot with max-size limits and validate that they are respected.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add UST snapshots streaming test with custom URI

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix typo in lttng snapshot add-output example of lttng(1)

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Add support for non unique add string in hashtable

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Generate local kernel and UST indexes

When the consumer creates a new trace file, it now creates as well an
index file that the viewers can use to navigate in the trace.  For now
these indexes are only local and not sent to the relayd.

This patch requires additionnal ioctl and ustctl calls implemented in
lttng-modules and lttng-ust in 2.4.

For now, no indexes are sent over the network and no indexes are
generated on snaphots.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Bump version to 2.4.0-pre1

We need to bump the version early in the development cycle since we
extend the relayd protocol.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Live timer set up

Add a new option to create to enable the live_timer being --live at
session creation. A new API call is added also to create as session in
live mode like the snapshot feature.

This timer is responsible to check all streams of a live session and
make sure the viewer receives periodic updates even for low-throughput
channels.

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