Fix: remove break in epoll loop of apps. thread

In *heavy* stress test with a large number of applications (> 7000 a
second), the manage application thread could starve the delete process
by breaking just after adding an application to the poll set.

Also, we've observed that somehow the application unregister process is
not done on most of the application by breaking the loop at each delete
from the poll set. We are still uncertain why but one theory is that
epoll detects that an I/O operation is ready (here a shutdown) and an
other subsystem of the session daemon uses that socket for I/O which
flags the poll event as "has been taken care of" thus the loop never
sees it because of that break.

The notify socket thread does not use a break between poll operation
which leads us to that conclusion with the manage apps thread.

We don't use epoll with edge-trigger thus a POLLERR/POLLHUP should
always be return as long as it's not taken care of.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: relayd cmd line option for live port

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: filter: check binary op nesting

Should pass nesting + 1 as parameter rather than nesting++. Worked in
when nesting was in one direction (due to side-effect of the first ++),
but not the other.

Fixes #688

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: missing reset when listing UST fields for multiple PIDs

Fixes #627

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: race with the viewer and readiness of streams

Add a message to inform the relayd that all the streams of a certain
channels were sent so it can make them available to the viewer. This
fixes a race where the viewer could start reading some streams before
having received them all.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: wrong check before destroying the viewer metadata stream

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: metadata stream should be always flagged as ready

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: report to client when snapshot will be empty

This adds a new lttng error code being the "snapshot nodata".

Fixes #662

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: delete metadata stream before destroying it

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Fix: zero out data structure before using it

Fixes #716

Signed-off-by: David Goulet <dgoulet@efficios.com>
WIP Session save feature
Add session configuration XSD
lttng-ctl save implementation
Sessiond save command implementation
Add a session save support API to libconfig
Session XSD fixes
Add channel context support to the sessions XSD
Add XML support to libconfig
Change config_session_writer namespace since it is not session specific
Add basic infrastructure to propagate the save command between the lttng client and the session daemon