Fix: snapshot with multiple UIDs

This commit refs #615. Waiting on the confirmation of the author to
close it.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Add .dirstamp to gitignore file

Signed-off-by: David Goulet <dgoulet@efficios.com>
Introduce configure --with-lttng-system-rundir

Allow overriding the path where the system-wide sessiond keeps its
runtime files.

It does _not_ allow multiple instances of system-wide sessiond to run in
parallel though, because the wait shm files still requires having only
one single system-wide sessiond at any given time.

Fixes #521

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add UST context in the same order the user enabled them

This is to avoid having different field order in different traces for
the same contexts enabled in the same order by the user.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Generate local kernel and UST indexes

When the consumer creates a new trace file, it now creates as well an
index file that the viewers can use to navigate in the trace.  For now
these indexes are only local and not sent to the relayd.

This patch requires additionnal ioctl and ustctl calls implemented in
lttng-modules and lttng-ust in 2.4.

For now, no indexes are sent over the network and no indexes are
generated on snaphots.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Bump version to 2.4.0-pre1

We need to bump the version early in the development cycle since we
extend the relayd protocol.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Live timer set up

Add a new option to create to enable the live_timer being --live at
session creation. A new API call is added also to create as session in
live mode like the snapshot feature.

This timer is responsible to check all streams of a live session and
make sure the viewer receives periodic updates even for low-throughput
channels.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
HT support for keys with two uint64_t

Add the support in the hashtable abstraction layer to handle a key
composed of a two uint64_t.

The hash function is a simple XOR between the two hashes and the compare
function resolves the eventual collisions by comparing the two values.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Send indexes in streaming mode

To write an index on disk, we need to know all the fields sent by the
RELAY_SEND_INDEX command as well as the offset of the data in the
tracefile.

Since the control and data connection are not synchronized, this process
happens in two separate steps synchronized by an HT indexed by the
index_handle and the net_seq_num.

When we receive data and when we receive an index, we lookup in the HT
if an entry already exists. If it does, it means that we only need to
fill the fields we just received and write the index on disk, otherwise,
we allocate a new index, set the fields we know and store it in the HT.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
basic handling of live_timer, for now just a printf

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
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>
Create relayd session with live parameters

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Relay listen on 2 additionnal ports

Copy the structure of the threads management of the main relayd for the
live viewer.
So we have 3 new threads live_listener, live_dispatcher, live_worker. It
maybe is a lot of duplicated code, but it is too early in the dev to
identify precisely the code that could be merged.
For now we don't do anything useful on these ports, but that's the next
step.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Cleanup line-wrap, add lttng-viewer.h

Viewer command VIEWER_VERSION working (tested with separate test program
using only lttng-viewer.h as "internal" header).

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

Add a session_list HT in the relayd and allow the viewer to list the
sessions.
Introduce a relay_local_data struct to have a simple way to share data
between threads.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Attach session + list streams

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

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

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