Fix: static array larger than necessary

The longest string that can be returned should be 20 chars long, as per
the comment.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: check malloc return value

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: memory leak in lttng_enable_event_with_exclusions

lttng_enable_event_with_exclusions leaks a filter expression when
automatically generated filter statements are used. This happens when
loglevel and logger name filtering are used when enabling JUL events.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: refactor function that fixes memory leak also

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: logger name dropped from filter condition when loglevels are used

This fix ensures that the loglevel expression is appended to the filter
expression and does not overwrite the current one.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: don't print channel name on enable JUL event

Fixes #802

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: signedness of the session live timer

Fixes #806

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: add a get HOME dir fallback to getpwuid

If the $HOME or $LTTNG_HOME is not defined, fallback on getpwuid(3) of
the process uid.

Fixes #815

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Unchecked strdup return values in set_option

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Clamp verbosity value read from config file

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Possible memory leak when multiple config files are loaded

Some configuration options could leak when initialized multiple times
from different configuration files and from the command line arguments.
The previous options are now freed' before being set.

Fixes #796

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: use biggest subbuffer size for snapshot max-size

Instead of using the output max size divided by the total amount of
streams in the session, we find the largest subbuffer in the session's
channels. Using that value, we multiply it by the total amount of
streams which gives us the lower limit of the snapshot size. That is
enough to make sure that we can take the snapshot or not.

Once done, the max stream size possible used for the snapshot record is
the largest subbuffer size in the session. This is to make sure that
every channel can extract the same amount of data which ensure fairness
between each channel in the session.

Fixes #783

Acked-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: get the stream_id when generating live beacons

When we send an empty index (beacon), we need to extract the stream_id
to avoid stalling the client on inactive streams on startup.
Since the live clients need to know this feature is implemented, we had
to bump the lttng-live protocol version.

This fix should be backported to stable-2.4 as well.

Refs: #811

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Fix: avoid freeing invalid ptr in filter bytecode

Reported-by: Jonathan Rajotte <jonathan.r.julien@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: ustctl_get_stream_id without UST support

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: relayd stream set close_flag on stream close

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: Create a lock file to prevent multiple session daemons

A lock file is used to ensure that only one session daemon per UID is
running on the system. The lock file is created in the rundir.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: filter error path could free invalid ptr

Also add a check for a NULL pointer when freeing the filter bytecode so
we don't deref an invalid ptr.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: clarify session conf. directory in man

Fixes #817

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: on session load, add it to the .lttngrc

Fixes #818

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