[HEAD MERGE] Basic handling of the live timer

Make the metadata timer thread more generic, we now handle the live
timer in here as well.
Introduce the new LTTNG_CONSUMER_SIG_LIVE, for now handled as a simple
printf.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
[HEAD MERGE] Create relayd session from the sessiond

Move the relayd session creation from the consumer to the relayd. No
change in behaviour expected here, just prepare for the next patch to
allow the sessiond to pass additionnal parameters in the relayd session
creation required for live tracing (hostname, session name, flags, etc).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
[HEAD MERGE] Create relayd session with live parameters

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
[HEAD MERGE] Implement the relayd live features

Relayd listen on 2 additionnal ports
Version exchange with the viewer
List the sessions
Attach to a session
List the streams of a session
Get the indexes per stream
Get data packets
Flag metadata streams
Match ctf_traces based on the trace path
Handle the synchronisation of the metadata (prevent the viewer from
reading a packet if it does not have the complete metadata)
Send the metadata
Ioctl to get the current timestamp
Inactive stream beacon

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
[HEAD MERGE] REVIEW CAREFULLY : test for new metadata at each packet

After sending each data packet in live, we need to check if new metadata
is available before sending the index informing the viewer it can read
the trace.
Since the data and the metadata are handled by two different threads,
this patch introduces a rendez-vous point : if new metadata is
available, the data thread flushes the metadata stream and waits on a
conditionnal variable. When the metadata thread finishes to send its
data, it wakes up the data thread which can send its index.

That way, the viewer is informed new metadata is available before
attempting to read a packet that might require an update of the
metadata.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
[HEAD MERGE] relicense lttng-index and lttng-viewer to BSD

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