Fix: Use after free() of the rundir string

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Bad return error code handling

Two things here. First, if the tracer dies before we have time to create
the session on it, the returned value (-1) was not handled creating a
segfault on the following loop.

Second, we no longer assert on the application PID hash table delete
return value since we use add_replace on app. registration creating a
possible key reuse for a different node.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Add the ACCOUNTING flag to ht creation and set bucket size to 0

The resize feature does not work well without the accounting :)

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: consumer health state

Fixes #389

Signed-off-by: David Goulet <dgoulet@efficios.com>
Rename data_available to data_pending

This is just a rename and a change of semantic.

The lttng_data_pending returns 0 if _NO_ data is pending meaning that
the buffers are ready to be read safely. A value of 1 means that data is
still pending so the buffers are not ready for any read.

This is the same semantic as lttng_data_available but in reverse order.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Sync issue when deleting a data stream

A data stream was rescheduled for deletion after a flush on hang up.
Once in a normal read code path, on error, the stream is deleted and
then processed for ERR|HUP error which could also delete again the
stream causing an assert() and a failed trace.

We fix that by setting the local array to NULL for that stream once
deleted and ignoring the stream is subsequent loop if NULL.

Fixes #390

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Tests: Add filtering tests for uncovered cases

While investigating the code coverage of the filtering feature, a couple
of possible tests cases were uncovered:

Error tests:
* Strings can't be IR root node
* Unary ! not allowed on string type
* Comparison with string type not allowed
* Logical operator not allowed with string types
* Nesting of binary operator not allowed

Valid tests:
* Cover all left/right operands permutations with
  fields ref. and numeric values.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Update version to v2.1.0-rc6

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Add output option to enable-channel command

Allow to specify an output mode for the channel (MMAP or SPLICE).

A new error code is introduced to notify the user that the operation is
not supported. Useful for user space tracing which does NOT support
splice mode.

Fixes #335

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Add space for stream name CPU number

Fixes #358

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Deny session creation name 'auto'

This is a reserved keyword for default session(s). Note that this is
only for the lttng command line tool. Using 'auto' is possible with the
API but the current date and time is automatically appended to it for
now so be aware of that.

Fixes #359

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Don't append datetime to default session name

The liblttng-ctl was appending the date and time to the "auto" session
if detected. The 'auto' keyword is only used by lttng command line

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Missing librt dependency in configure check for lttng-ust-ctl

The lttng-ust-ctl library depends on librt. The AC_CHECK_LIBRARY macro
can't automatically resolve dependents libraries (ala libtool), so any
additionnals dependencies must be manually specified.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Remove dependency to urcu-cds in tools tests

The -lurcu-cds link flag is not mandatory to link any of the tests.
Also, adding this flag can cause multiple symbol definition errors when
linking statically because the libhashtable contains symbol names that
are also present in urcu-cds.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>