Fix: add README.md to documentation files

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Update maintainer section of README.md

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Update maintainer section of the man pages

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: check userspace perf counter name when looking up contexts

create_ust_app_channel_context() looks for a context's existance
in a channel before adding it. However, it only checks for
context types. This is valid for all context types except for
LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER since multiple perf
thread counters may be enabled at the same time.

This fix ensures that the perf counter name is taken into
consideration when checking for a context's presence in a
channel.

Reported-by: Alexander Grigoriev <alexgri@tbricks.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Add missing URCU_TLS access to error_log_time

Fixes #849

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Bypass 0 byte allocation when no domains are enabled

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Don't report an error when listing a session with no channels

The LTTng sessiond daemon reports an error when the list_channel
command is invoked on a session which only has a metadata channel.

The error lies in assuming that a session which has an enabled
domains also has (user-visible) channels.

The metadata channel should be listed in a future fix.

Fixes #855

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Warn the user when enabling an event in a new domain

This patch warn the user when trying to enable an event in a new domain
that was not configured prior to the tracing start.

Fixes #826

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Mark libxml2 as a mandatory dependency

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: filter attach vs event enable race

In order to correctly handle the use-case where events are enabled
_after_ trace is started, and _after_ applications are already being
traced, the event should be created in a "disabled" state, so that it
does not trace events until its filter is attached.

This fix needs to be done both in lttng-tools and lttng-ust. In order to
keep ABI compatibility between tools and ust within a stable release
cycle, we introduce a new "disabled" within struct lttng_ust_event
padding (previously zeroed). Newer LTTng-UST checks this flag, and
fallback on the old racy behavior (enabling the event on creation) if it
is unset.

Therefore, old session daemon works with newer lttng-ust of the same
stable release, and vice-versa. However, building lttng-tools requires
an upgraded lttng-ust, which contains the communication protocol with
the new "disabled" field.

This patch should be backported to stable-2.4, stable-2.5, stable-2.6
branches.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Cleanup: remove "disabled" flag for new release cycle

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: missing rcu_read_lock in cmd_start_trace()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: missing rcu_read_lock when calling trace_ust_find_agent()

Added a comment to note that this function is assumed to be
called with the rcu_read_lock held.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: missing rcu_read_lock in trace_ust_destroy_session()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: agent events HT should be destroyed from the cleanup thread

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: HT must not be destroyed with a rcu_read_lock held

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: define _LGPL_SOURCE in C files

Defining this in headers is a bad practice, since the header is not
necessarily the first in the include list.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: filter bytecode and string memory leak on error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Ambiguous agent event filter bytecode ownership

A shared ownership of the filter bytecode between UST events
and Agent event led to a leak in cmd_enable_event() which was
fixed previously. However, that fix introduced a bug which
passed NULL to the agent event creation function.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: removed useless key from relay_index

This field was never used except in debug messages (instead of using the
good value that is part of index_n).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>