lttng-tools.git
9 years agoUpdate version to v2.4.3 v2.4.3
Jérémie Galarneau [Fri, 12 Dec 2014 17:30:07 +0000 (12:30 -0500)] 
Update version to v2.4.3

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: don't destroy the sockets if the snapshot was successful
Julien Desfossez [Tue, 9 Dec 2014 21:38:05 +0000 (16:38 -0500)] 
Fix: don't destroy the sockets if the snapshot was successful

Missing a goto to skip the error condition that was destroying the
relayd sockets even if a snapshot was successful. We want to keep them
open to reuse them for the next snapshots.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Missing RCU read lock in kernel_destroy_session()
Jérémie Galarneau [Tue, 2 Dec 2014 03:06:23 +0000 (22:06 -0500)] 
Fix: Missing RCU read lock in kernel_destroy_session()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: channel names are not validated
Philippe Proulx [Thu, 27 Nov 2014 22:35:32 +0000 (17:35 -0500)] 
Fix: channel names are not validated

This patch ensures:

  1. A channel name does not contain any '/' character, since
     relative paths may be injected in the channel name
     otherwise (knowing that the channel name is eventually
     part of a file name)
  2. A channel name does not start with a '.' character, since
     trace readers (Babeltrace is one of them) could interpret
     files starting with a dot as hidden files and ignore
     them when opening the CTF trace

Fixes: #751
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
include/lttng/lttng-error.h
src/bin/lttng/commands/enable_channels.c
src/common/error.c

Conflicts:
src/common/error.c

9 years agoFix: Memory leak on error in alloc_argv_from_user_opts()
Jérémie Galarneau [Thu, 27 Nov 2014 22:23:48 +0000 (17:23 -0500)] 
Fix: Memory leak on error in alloc_argv_from_user_opts()

*** CID 1256181:  Resource leak  (RESOURCE_LEAK)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: test_utils_expand_path.c: out of memory error handling
Mathieu Desnoyers [Wed, 26 Nov 2014 17:43:32 +0000 (12:43 -0500)] 
Fix: test_utils_expand_path.c: out of memory error handling

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: test test_ust_data.c: check OOM
Mathieu Desnoyers [Wed, 26 Nov 2014 17:39:13 +0000 (12:39 -0500)] 
Fix: test test_ust_data.c: check OOM

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: test libc-wrapper: check malloc OOM
Mathieu Desnoyers [Wed, 26 Nov 2014 17:38:21 +0000 (12:38 -0500)] 
Fix: test libc-wrapper: check malloc OOM

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: lttng-ctl: use zmalloc(), missing OOM check
Mathieu Desnoyers [Wed, 26 Nov 2014 17:37:21 +0000 (12:37 -0500)] 
Fix: lttng-ctl: use zmalloc(), missing OOM check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: filter-parser.y: use zmalloc(), missing OOM check
Mathieu Desnoyers [Wed, 26 Nov 2014 17:36:37 +0000 (12:36 -0500)] 
Fix: filter-parser.y: use zmalloc(), missing OOM check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: utils.c: check str*dup OOM
Mathieu Desnoyers [Wed, 26 Nov 2014 17:36:03 +0000 (12:36 -0500)] 
Fix: utils.c: check str*dup OOM

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: rculfhash: use zmalloc()
Mathieu Desnoyers [Wed, 26 Nov 2014 17:34:26 +0000 (12:34 -0500)] 
Fix: rculfhash: use zmalloc()

Follow lttng-tools rules.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: lttng lttng.c: check strdup OOM
Mathieu Desnoyers [Wed, 26 Nov 2014 17:33:34 +0000 (12:33 -0500)] 
Fix: lttng lttng.c: check strdup OOM

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: lttng conf.c: use zmalloc()
Mathieu Desnoyers [Wed, 26 Nov 2014 17:33:09 +0000 (12:33 -0500)] 
Fix: lttng conf.c: use zmalloc()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: lttng view.c missing strdup OOM check
Mathieu Desnoyers [Wed, 26 Nov 2014 17:32:28 +0000 (12:32 -0500)] 
Fix: lttng view.c missing strdup OOM check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: use zmalloc() in lttng view.c
Mathieu Desnoyers [Wed, 26 Nov 2014 17:32:13 +0000 (12:32 -0500)] 
Fix: use zmalloc() in lttng view.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: use zmalloc() in lttng list.c
Mathieu Desnoyers [Wed, 26 Nov 2014 17:31:52 +0000 (12:31 -0500)] 
Fix: use zmalloc() in lttng list.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: use zmalloc in lttng enable_events.c
Mathieu Desnoyers [Wed, 26 Nov 2014 17:29:43 +0000 (12:29 -0500)] 
Fix: use zmalloc in lttng enable_events.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: missing strdup oom check in lttng create.c
Mathieu Desnoyers [Wed, 26 Nov 2014 17:27:29 +0000 (12:27 -0500)] 
Fix: missing strdup oom check in lttng create.c

Introduce tmp_path to ensure that no code path can possibly try to free
the return value of utils_get_home_dir(). Re-using alloc_path for both
static and dynamically allocated pointer is error-prone.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: lttng add_context.c: use zmalloc
Mathieu Desnoyers [Wed, 26 Nov 2014 17:25:55 +0000 (12:25 -0500)] 
Fix: lttng add_context.c: use zmalloc

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing str*dup oom check in sessiond main.c
Mathieu Desnoyers [Wed, 26 Nov 2014 17:18:07 +0000 (12:18 -0500)] 
Fix: add missing str*dup oom check in sessiond main.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing sessiond kernel-consumer missing str*dup oom checks
Mathieu Desnoyers [Wed, 26 Nov 2014 17:17:26 +0000 (12:17 -0500)] 
Fix: add missing sessiond kernel-consumer missing str*dup oom checks

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing strdup OOM check
Mathieu Desnoyers [Wed, 26 Nov 2014 17:16:19 +0000 (12:16 -0500)] 
Fix: add missing strdup OOM check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Live tracing does not honor live timer after first tracefile with tracefile...
Mathieu Desnoyers [Fri, 21 Nov 2014 17:31:39 +0000 (18:31 +0100)] 
Fix: Live tracing does not honor live timer after first tracefile with tracefile rotation

When we pass to the 2nd sub-file (or following sub-files) of a stream in
relayd, the live timer has no visible effect from a live reader
perspective, and then everything is flushed when we reach the following
sub-file.

This is caused by the reset of stream->total_index_received after each
tracefile rotation. It should keep on incrementing to match what is
expected by check in check_index_status():

  (rstream->total_index_received <= vstream->last_sent_index)

Fixes #863

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: relayd: unbalanced RCU read-side lock/unlock
Mathieu Desnoyers [Fri, 21 Nov 2014 17:38:37 +0000 (18:38 +0100)] 
Fix: relayd: unbalanced RCU read-side lock/unlock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: relayd: unbalanced RCU read lock/unlock
Mathieu Desnoyers [Fri, 21 Nov 2014 17:42:05 +0000 (18:42 +0100)] 
Fix: relayd: unbalanced RCU read lock/unlock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: relayd viewer stream: unhandled out of memory error
Mathieu Desnoyers [Fri, 21 Nov 2014 17:49:08 +0000 (18:49 +0100)] 
Fix: relayd viewer stream: unhandled out of memory error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: Missing rcu_read_lock in cmd_list_channels()
Jérémie Galarneau [Tue, 18 Nov 2014 19:19:43 +0000 (14:19 -0500)] 
Fix: Missing rcu_read_lock in cmd_list_channels()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: Missing rcu_read_lock in cmd_snapshot_list_outputs()
Jérémie Galarneau [Tue, 18 Nov 2014 19:10:14 +0000 (14:10 -0500)] 
Fix: Missing rcu_read_lock in cmd_snapshot_list_outputs()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: Missing rcu_read_lock in ust_app_get_nb_stream()
Jérémie Galarneau [Tue, 18 Nov 2014 18:37:29 +0000 (13:37 -0500)] 
Fix: Missing rcu_read_lock in ust_app_get_nb_stream()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: UST subbuffers silently dropped on moderate trace traffic
Mathieu Desnoyers [Tue, 18 Nov 2014 16:33:23 +0000 (17:33 +0100)] 
Fix: UST subbuffers silently dropped on moderate trace traffic

Well, it looks like we really screwed up on this one.

lttng-tools commit 02b3d1769d5f8a33e4109b1e681141c9295dfda6 introduced
an important regression for lttng-ust tracing in the consumer daemon:
after reading a sub-buffer, a check has been added to see whether there
are more sub-buffers available to read, and if it is the case, it
ensures the wakeup pipe will be awakened again.

The issue lies in the use of ustctl_put_next_subbuf() in this check.
This acts as if the sub-buffer has been read, when in reality it has not
been read. It therefore trashes the data contained by this sub-buffer.

This check should use ustctl_put_subbuf(), which does not move the
consumer position.

This is a severe bug, and the fix needs to be applied to stable-2.6,
stable-2.5, and stable-2.4.

Fixes #861

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: create/destroy a splice_pipe per stream
Julien Desfossez [Wed, 12 Nov 2014 23:36:17 +0000 (18:36 -0500)] 
Fix: create/destroy a splice_pipe per stream

We had a per-thread splice_pipe (one for data and one for metadata), but
in case of error, we would end up filling the write side of the pipe and
never emptying it. This could lead to leaking data from one session to
the other, but also to stall the consumer trying to splice into a full
pipe.

Now we create a splice_pipe per-stream, so it is destroyed when the
session is destroyed.

Fixes: #726
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: return EINVAL if agent registration fails
David Goulet [Tue, 7 Oct 2014 19:05:48 +0000 (15:05 -0400)] 
Fix: return EINVAL if agent registration fails

The errno value might be 0 thus not returning an error if so. It has
been seen with an unstable python agent code base which means it could
happen in the future if a third part decides to create an agent.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: empty indexes_ht before destroying it.
Julien Desfossez [Tue, 11 Nov 2014 20:57:48 +0000 (15:57 -0500)] 
Fix: empty indexes_ht before destroying it.

Fixes: #722
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: removed useless key from relay_index
Julien Desfossez [Tue, 11 Nov 2014 20:57:47 +0000 (15:57 -0500)] 
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>
10 years agoFix: HT must not be destroyed with a rcu_read_lock held
Jérémie Galarneau [Sat, 15 Nov 2014 04:38:36 +0000 (23:38 -0500)] 
Fix: HT must not be destroyed with a rcu_read_lock held

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: missing rcu_read_lock in cmd_start_trace()
Jérémie Galarneau [Thu, 13 Nov 2014 21:09:57 +0000 (16:09 -0500)] 
Fix: missing rcu_read_lock in cmd_start_trace()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: filter attach vs event enable race
Mathieu Desnoyers [Wed, 12 Nov 2014 23:18:32 +0000 (18:18 -0500)] 
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>
10 years agoBuild fix: use ret directly in error handling path
Jérémie Galarneau [Mon, 10 Nov 2014 22:35:26 +0000 (17:35 -0500)] 
Build fix: use ret directly in error handling path

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: Warn the user when enabling an event in a new domain
Christian Babeux [Fri, 7 Nov 2014 23:18:43 +0000 (18:18 -0500)] 
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>
10 years agoFix: Don't report an error when listing a session with no channels
Jérémie Galarneau [Fri, 7 Nov 2014 23:07:07 +0000 (18:07 -0500)] 
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>
Conflicts:
src/bin/lttng/commands/list.c

10 years agoUpdate maintainer section of the man pages
Jérémie Galarneau [Wed, 5 Nov 2014 22:34:14 +0000 (17:34 -0500)] 
Update maintainer section of the man pages

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoUpdate maintainer section of README
Jérémie Galarneau [Wed, 5 Nov 2014 20:53:22 +0000 (15:53 -0500)] 
Update maintainer section of README

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: add README to documentation files
Jérémie Galarneau [Tue, 4 Nov 2014 22:59:29 +0000 (17:59 -0500)] 
Fix: add README to documentation files

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoFix: UST consumer sync all available metadata
David Goulet [Fri, 31 Oct 2014 17:23:29 +0000 (13:23 -0400)] 
Fix: UST consumer sync all available metadata

In live mode, the sync metadata function was only working on one single
metadata stream of a given session ID. However, we can have multiple
metadata stream for the same session ID thus failing to send the data in
live mode correctly for the other streams.

This fixes it by simply iterating over all metadata stream for a session
ID and syncing them all.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: handle sysconf possible negative returned value
David Goulet [Wed, 1 Oct 2014 18:57:36 +0000 (14:57 -0400)] 
Fix: handle sysconf possible negative returned value

Fixes Coverity issue 1019947.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: channel deref. after NULL check in kernel consumer
David Goulet [Wed, 1 Oct 2014 18:52:33 +0000 (14:52 -0400)] 
Fix: channel deref. after NULL check in kernel consumer

Fixes Coverity issue 1040158.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: check for kernel session metadata during init
David Goulet [Wed, 1 Oct 2014 18:49:42 +0000 (14:49 -0400)] 
Fix: check for kernel session metadata during init

Fixes Coverity issue 1040159.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: incorrect cast in ust consumer assert
David Goulet [Wed, 1 Oct 2014 18:32:12 +0000 (14:32 -0400)] 
Fix: incorrect cast in ust consumer assert

Fixes Coverity issue 1068813.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: bad handling of incoming data in consumer thread
David Goulet [Wed, 1 Oct 2014 18:16:07 +0000 (14:16 -0400)] 
Fix: bad handling of incoming data in consumer thread

This will fix Coverity issue 1019892.

The issue uncovered a more serious problem. The loop on ready FDs of the
thread was exiting at each branch thus not going on all fd. This is
problematic when the thread quit pipe is triggered and when there is
also at the same time a request for metadata from the consumer since the
metadata request could have been ignored.

This patch makes sure we go through all FDs in the loop when the thread
quit pipe or the metadata fd is triggered.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: disable event for JUL domain
David Goulet [Fri, 5 Sep 2014 19:10:06 +0000 (15:10 -0400)] 
Fix: disable event for JUL domain

This fix could not be backported from master since it has changed too
much but the ref. is 0dcfcf94b356c12e3936fa27f350896d96724e4e on the
master branch.

This fixes the disable event command that was not working with the JUL
domain and adds a test for it.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: send disable ALL command code if event is *
David Goulet [Fri, 5 Sep 2014 16:12:38 +0000 (12:12 -0400)] 
Fix: send disable ALL command code if event is *

$ lttng disable-event -a
and
$ lttng disable-event '*'

Both commands should do the same meaning send the DISABLE_EVENT_ALL
command to the session daemon.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: make sure no index is in flight before using inactivity beacons
Julien Desfossez [Wed, 27 Aug 2014 17:59:21 +0000 (13:59 -0400)] 
Fix: make sure no index is in flight before using inactivity beacons

Since the index is sent in two parts on two separate connections from
the consumer, there can be cases where we receive an inactivity beacon
between the index creation and the data reception.

This fix prevents from using the inactivity beacon if we know a data
index is coming.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Parenthesize previous statement when adding conditions to a filter
Jérémie Galarneau [Thu, 28 Aug 2014 16:53:43 +0000 (12:53 -0400)] 
Fix: Parenthesize previous statement when adding conditions to a filter

Not parenthesizing the clauses in a filter string causes JUL events to be
traced even though they are not enabled when an enable-event command is
issued with a filter and the --loglevel-only option.

For instance,

lttng enable-event -j "my_event" --loglevel-only JUL_CONFIG -f "int_loglevel > 0 || int_loglevel < 0"

results in the following filter being applied:

int_loglevel > 0 || int_loglevel < 0 && logger_name == "my_event" && int_loglevel == 700

The resulting expression will always evaluate to true, regardless of the logger
name.

This fix parenthesizes each clause to ensure they are all independently
evaluated and not unintuitively affected by operator precedence.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: parse_prob_opts return the actual success of the function
Jonathan Rajotte Julien [Wed, 27 Aug 2014 19:46:57 +0000 (15:46 -0400)] 
Fix: parse_prob_opts return the actual success of the function

This bug have been triggered by the mi merging and the use of a
command_ret in enable_events functions. Previously, enable_events was
reusing the ret variable for another operation and always replacing ret.
Parse_probe_event returned the last output of sscanf which represent
the number of match and not the success of the operation.

Fixes #830

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: disable JUL event on destroy
David Goulet [Tue, 29 Jul 2014 18:11:48 +0000 (14:11 -0400)] 
Fix: disable JUL event on destroy

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: unbalanced ustconsumer32_data.pid_mutex lock
Mathieu Desnoyers [Mon, 28 Jul 2014 00:38:50 +0000 (20:38 -0400)] 
Fix: unbalanced ustconsumer32_data.pid_mutex lock

It is never locked in this function, but should be. This is triggering
spurious runtime failures on my system, where it seems that sessiond was
sometimes breaking the communication pipe with liblttng-ctl when the
unbalanced unlock is reached.

This should be backported to stable-2.4 and stable-2.5.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoUpdate version to v2.4.2 v2.4.2
David Goulet [Wed, 16 Jul 2014 15:08:17 +0000 (11:08 -0400)] 
Update version to v2.4.2

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Create a lock file to prevent multiple session daemons
Jérémie Galarneau [Mon, 14 Jul 2014 18:57:10 +0000 (14:57 -0400)] 
Fix: Create a lock file to prevent multiple session daemons

A lock file is used to ensure that only one session daemon per UID is
running on the system. The lock file is created in the rundir.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Conflicts:
src/bin/lttng-sessiond/main.c
src/common/utils.h

10 years agoFix: relayd stream set close_flag on stream close
David Goulet [Mon, 14 Jul 2014 20:37:05 +0000 (16:37 -0400)] 
Fix: relayd stream set close_flag on stream close

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: ustctl_get_stream_id without UST support
David Goulet [Mon, 14 Jul 2014 19:49:02 +0000 (15:49 -0400)] 
Fix: ustctl_get_stream_id without UST support

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: get the stream_id when generating live beacons
Julien Desfossez [Mon, 14 Jul 2014 18:05:48 +0000 (14:05 -0400)] 
Fix: get the stream_id when generating live beacons

When we send an empty index (beacon), we need to extract the stream_id
to avoid stalling the client on inactive streams on startup.
Since the live clients need to know this feature is implemented, we had
to bump the lttng-live protocol version.

This fix should be backported to stable-2.4 as well.

Refs: #811

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
10 years agoFix: missing include for getpwuid()
David Goulet [Thu, 10 Jul 2014 20:13:50 +0000 (16:13 -0400)] 
Fix: missing include for getpwuid()

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add a get HOME dir fallback to getpwuid
David Goulet [Thu, 10 Jul 2014 20:02:02 +0000 (16:02 -0400)] 
Fix: add a get HOME dir fallback to getpwuid

If the $HOME or $LTTNG_HOME is not defined, fallback on getpwuid(3) of
the process uid.

Fixes #815

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't set enabled flag is session start fails
David Goulet [Tue, 25 Mar 2014 16:14:01 +0000 (12:14 -0400)] 
Fix: don't set enabled flag is session start fails

The "started" var. is changed to the flag "has_been_started" indicating
if at least ONE start command has been seen.

The "enabled" var. is changed to the flag "active" and the semantic is
the same.

Backported from master.

Fixes #801

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: logger name dropped from filter condition when loglevels are used
Jérémie Galarneau [Thu, 10 Jul 2014 18:24:59 +0000 (14:24 -0400)] 
Fix: logger name dropped from filter condition when loglevels are used

This fix ensures that the loglevel expression is appended to the filter
expression and does not overwrite the current one.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: memory leak in lttng_enable_event_with_exclusions
Jérémie Galarneau [Wed, 9 Jul 2014 22:20:03 +0000 (18:20 -0400)] 
Fix: memory leak in lttng_enable_event_with_exclusions

lttng_enable_event_with_exclusions leaks a filter expression when
automatically generated filter statements are used. This happens when
loglevel and logger name filtering are used when enabling JUL events.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: check malloc return value
Jérémie Galarneau [Fri, 4 Jul 2014 19:33:49 +0000 (15:33 -0400)] 
Fix: check malloc return value

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: static array larger than necessary
Jérémie Galarneau [Fri, 4 Jul 2014 19:28:42 +0000 (15:28 -0400)] 
Fix: static array larger than necessary

The longest string that can be returned should be 20 chars long, as per
the comment.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: set session in output mode if URL are set afterwards
David Goulet [Wed, 25 Jun 2014 20:35:54 +0000 (16:35 -0400)] 
Fix: set session in output mode if URL are set afterwards

Fixes #809

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Add vpid, vppid and vtid info in add-context help
Francis Deslauriers [Thu, 19 Jun 2014 02:19:40 +0000 (22:19 -0400)] 
Fix: Add vpid, vppid and vtid info in add-context help

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: alignment problems on targets not supporting unaligned access.
Fredrik Markström [Fri, 16 May 2014 01:10:07 +0000 (09:10 +0800)] 
Fix: alignment problems on targets not supporting unaligned access.

Accessing floats, doubles and 64 bit int at unaligned addresses is not
supported on all configurations of arm processors and if it is it's
emulated and slow. This patch replaces direct assignments with memcpy.

Signed-off-by: Fredrik Markström <fredrik.markstrom@gmail.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: possible use after free in consumer
David Goulet [Mon, 26 May 2014 18:12:23 +0000 (14:12 -0400)] 
Fix: possible use after free in consumer

Fixes the coverity issue 1019959.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: improve and update lttng.h comments
David Goulet [Thu, 22 May 2014 17:25:24 +0000 (13:25 -0400)] 
Fix: improve and update lttng.h comments

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: JUL filtering for event *
David Goulet [Mon, 26 May 2014 18:01:14 +0000 (14:01 -0400)] 
Fix: JUL filtering for event *

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: deny overwrite mode and num subbuf less than 2
David Goulet [Fri, 23 May 2014 14:32:09 +0000 (10:32 -0400)] 
Fix: deny overwrite mode and num subbuf less than 2

Also fixed in UST and modules with commit:

(modules) 5140d2b3070f211e6d8a0ad7cb0a190e8b6f3e28
(ust) 3d8e9399b2fb9000b3b55e488a7d04184b5bb56e

Fixes #793

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: remove bad option in enable channel --help
David Goulet [Thu, 22 May 2014 14:56:30 +0000 (10:56 -0400)] 
Fix: remove bad option in enable channel --help

Fixes #776

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: implicit conversion from enumeration
David Goulet [Wed, 21 May 2014 17:52:52 +0000 (13:52 -0400)] 
Fix: implicit conversion from enumeration

Backported to stable-2.3 and 2.4.

Fixes #759

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: clarify man page lttng.1
David Goulet [Wed, 21 May 2014 15:41:46 +0000 (11:41 -0400)] 
Fix: clarify man page lttng.1

Backported to stable-2.3 and 2.4.

Fixes #689

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Copy-pasted PERROR messages may be misleading
Jérémie Galarneau [Wed, 14 May 2014 15:32:10 +0000 (11:32 -0400)] 
Fix: Copy-pasted PERROR messages may be misleading

Some PERRORs in lttng-sessiond's pthread_create's error handling
code indicate the wrong thread name which may be misleading
during debugging.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: incorrect printf format
David Goulet [Wed, 14 May 2014 15:30:16 +0000 (11:30 -0400)] 
Fix: incorrect printf format

Fixes #777

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: handle ENOENT when creating a kernel event
David Goulet [Wed, 14 May 2014 15:27:00 +0000 (11:27 -0400)] 
Fix: handle ENOENT when creating a kernel event

The kernel tracer returns ENOENT if an event is not found thus warn the
user of that.

Fixes #761

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: move JUL filter creation to a function
David Goulet [Wed, 7 May 2014 18:12:13 +0000 (14:12 -0400)] 
Fix: move JUL filter creation to a function

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: JUL filtering done on the UST level
David Goulet [Wed, 7 May 2014 17:53:36 +0000 (13:53 -0400)] 
Fix: JUL filtering done on the UST level

This is to support enabling all events with different loglevels in two
different sessions.

For this, if any loglevel have been defined, the 'int_loglevel' filter
is added to the UST event. The liblttng-ust-jul library has been
modified to stop filtering loglevel in the agent.

This commit adds two tests, one for a back to back session that are
destroyed and a second one for multi loglevel session.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Don't include the binary in the live test's EXTRA_DIST
David Goulet [Mon, 5 May 2014 19:36:16 +0000 (15:36 -0400)] 
Fix: Don't include the binary in the live test's EXTRA_DIST

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add JUL filter to UST event on logger_name
David Goulet [Tue, 15 Apr 2014 19:05:42 +0000 (15:05 -0400)] 
Fix: add JUL filter to UST event on logger_name

This is to avoid having the JUL event copied in each sessions. See
ticket description for more details.

To achieve this, JUL filtering has been added to fix that bug.

Fixes #773

Signed-off-by: David Goulet <dgoulet@efficios.com>
Conflicts:
src/bin/lttng-sessiond/cmd.c

10 years agoFix: Racy event validation in tests
Christian Babeux [Fri, 18 Apr 2014 17:10:09 +0000 (13:10 -0400)] 
Fix: Racy event validation in tests

This pattern is fundamentally racy:

$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &

[...]

while [ -n "$(pidof $TESTAPP_BIN)" ]; do
   sleep 1
done
pass "Wait for application end"

[...]

tracing_teardown

validate_trace $EXACT_EVENT_COUNT

It is possible that the check for "pidof $TESTAPP_BIN" occurs _before_
the execve() of the applications (starting the applications in background
with & is basically a clone() + execve()). The consequence is that the check
succeed, never waiting for any applications to finish and then the tracing
sessions are prematurely teared down. Thus the resulting trace contains only
some events. We then validate for a fixed number of events and thus the test
fails caused by this racy scheduling situation.

The fix is to start the applications in foreground instead of background.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: rework utils_parse_size_suffix
Simon Marchi [Thu, 10 Apr 2014 15:30:19 +0000 (11:30 -0400)] 
Fix: rework utils_parse_size_suffix

Ok, so there are a lot of problems with this function (sorry :|). Taking
the regex road is probably to complicated for nothing, so here is a
version without regexes.

I added many test cases as suggested by Sandeep Chaudhary and Daniel
Thibault. I tested on both Intel 32 and 64 bits.

Fixes #633

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoUpdate version to v2.4.1 v2.4.1
David Goulet [Tue, 8 Apr 2014 19:14:25 +0000 (15:14 -0400)] 
Update version to v2.4.1

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't delete stream from connection recv list
David Goulet [Thu, 3 Apr 2014 17:14:00 +0000 (13:14 -0400)] 
Fix: don't delete stream from connection recv list

We don't need to delete them from the list during a connection destroy
because it's only a reference to the stream that might be valid or not
during the connection destroy. There is no need at all to access the
stream's pointer at that point.

Commit cd2ef1ef1d54ced9e4d0d03b865bb7fc6a905f80 did not fixed the full
issue so this should fix the use after free race for good.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: use after free of a relayd stream
David Goulet [Wed, 2 Apr 2014 14:31:34 +0000 (10:31 -0400)] 
Fix: use after free of a relayd stream

A race could occur with a stream destruction and a control connection
being destroyed emptying its recv_list. A freed stream could still be in
the list thus having a use after free during the connection destroy.

That was triggering undefined behavior from infinite looping to
segmentation faults.

We've observed this issue on high load stress test. A relayd received
all the stream but NOT the streams sent command which empty the list.
This can happen if a start tracing never occured or failed on the
application side thus the close stream command is sent to the relayd
freeing the stream before it is removed from that list.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't print stream name in error message
David Goulet [Tue, 1 Apr 2014 15:36:13 +0000 (11:36 -0400)] 
Fix: don't print stream name in error message

The stream received, in per UID, is actually a temporary stream object
that only contains the UST object data which is the relevant part for
UST to use.

Thus on error the name was random data thus print the valid handle
descriptor instead of invalid data.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: take session list lock when listing tp
David Goulet [Fri, 28 Mar 2014 13:58:03 +0000 (09:58 -0400)] 
Fix: take session list lock when listing tp

This is important since the list tracepoints command access the
application socket to ask the application for its TPs. The session list
lock protects the ordering of message for those sockets.

This was triggering out of order message between the session daemon and
an application thus triggering undefined behavior.

Fixes #774

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add consumer wake up pipe to avoid race
David Goulet [Wed, 19 Mar 2014 18:34:27 +0000 (14:34 -0400)] 
Fix: add consumer wake up pipe to avoid race

UST application will notify the wait_fd pipe for every subbuffer that it
writes and ready to be consumed. However, on *high* load systems, this
1:1 property can fail if the pipe gets filled up. For performance
reason, UST will ignore this error and continue since it can't wait for
the pipe to clear up.

This triggers a race condition where we have *one* wake up on the UST
pipe for potentially multiple subbuffers. A data pending command will
wait forever on streams that still has data but the data thread could'nt
consumed them because of this 1:n possible race. Using the stop command
without waiting would mean a memory/fd leak of the stream.

Thus, we add a consumer wake up pipe here that notifies the data thread
if there is still data to be read after a successful read subbuffer
call. With this, we end up handling the residual buffers if any since
the data thread is always notified when there is still data to be read.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't spawn relayd if URL is provided
David Goulet [Fri, 28 Mar 2014 17:19:47 +0000 (13:19 -0400)] 
Fix: don't spawn relayd if URL is provided

In the lttng command line tool, relayd should only be spawned for the
default use case which is no URL provided.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't ask data pending if session was not started
David Goulet [Tue, 25 Mar 2014 15:34:47 +0000 (11:34 -0400)] 
Fix: don't ask data pending if session was not started

Fixes #770

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: missing test file in EXTRA dist
David Goulet [Mon, 24 Mar 2014 20:07:51 +0000 (16:07 -0400)] 
Fix: missing test file in EXTRA dist

Fixes #753

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: allow empty URL for live session creation
David Goulet [Mon, 24 Mar 2014 18:23:00 +0000 (14:23 -0400)] 
Fix: allow empty URL for live session creation

This is actually very important so -C/-D can be used with lttng create
--live command and also the load command can set the control and data
URL independently.

This also adds a small test to make sure -C/-D works in live mode.

Fixes #769

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: missing valid return code when adding an URI to consumer
David Goulet [Mon, 24 Mar 2014 18:22:34 +0000 (14:22 -0400)] 
Fix: missing valid return code when adding an URI to consumer

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: syntax error in lttng.1
Michael Jeanson [Sat, 15 Mar 2014 17:55:11 +0000 (13:55 -0400)] 
Fix: syntax error in lttng.1

Signed-off-by: Michael Jeanson <mjeanson@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
This page took 0.043757 seconds and 4 git commands to generate.