Attach session + list streams

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

Create a shadow copy of the stream because they have their own lifetime
separated from the relay_streams.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
multiple attach to same session, better handling of not yet created indexes

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

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

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
HT add_str (not unique)

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
fix index_received++ only after write

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

Introduce a new per-connection HT indexed by path_name and accepting
duplicate keys.
When a new metadata stream arrives, we create a new ctf_trace struct,
assign it a unique ID and match all streams with the same path to this
ctf_trace.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Handle the synchronisation on metadata

If new metadata is available when the viewer requests an index, we set
the new_metadata flag in the index packet. If it requests a data packet
and new metadata is available we inform it to update its metadata first.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
send ctf_trace_id to the viewer

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

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Ioctl to get the currrent timestamp

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

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
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>
relicense lttng-index and lttng-viewer to BSD

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