lttng-tools.git
7 years agoFix: initialize live_timer to 0 for snapshot session
Antoine Busque [Tue, 1 Sep 2015 23:12:28 +0000 (19:12 -0400)] 
Fix: initialize live_timer to 0 for snapshot session

The live timer was being initialized to -1 for snapshot sessions,
instead of the expected default value of 0 used elsewhere in the code.

Fixes #879

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: correct mismatched function signatures
Antoine Busque [Tue, 1 Sep 2015 22:53:57 +0000 (18:53 -0400)] 
Fix: correct mismatched function signatures

The extern declaration of `_lttng_create_session_ext` in `create.c`
had a superfluous `live_timer` parameter not present in the actual
function definition in `lttng_ctl.c`. The -1 value with which it was
called was therefore unused.

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoClearer error reporting when failing to launch session daemon
Jérémie Galarneau [Sun, 6 Sep 2015 03:03:51 +0000 (23:03 -0400)] 
Clearer error reporting when failing to launch session daemon

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDaemonize sessiond on `lttng create`
Philippe Proulx [Thu, 27 Aug 2015 15:52:33 +0000 (11:52 -0400)] 
Daemonize sessiond on `lttng create`

Since the session daemon forked by `lttng create` shares its
standard output/error FDs when not using `--daemonize`, redirecting
the standard output/error of this command to another program "hangs"
because the session daemon never terminates.

Example that's not working (when sessiond is not running):

    lttng create | wc

or:

    lttng 2>&1 | wc

Using sessiond's `--daemonize` option makes it close its FDs. This
option also ensures that when the sessiond process exits, it has forked
itself as a daemon and is ready to accept commands. Therefore we don't
need to catch SIGCHLD and SIGUSR1; just waitpid() on sessiond's PID and
make sure it exited normally and with an exit status of 0 to continue.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: consumer signal handling race
Mathieu Desnoyers [Sat, 5 Sep 2015 23:58:29 +0000 (19:58 -0400)] 
Fix: consumer signal handling race

If a signal comes in after ctx has been destroyed, it will try to use a
closed file descriptor.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: list_ust_events(): dangling pointer
Philippe Proulx [Wed, 26 Aug 2015 17:40:18 +0000 (13:40 -0400)] 
Fix: list_ust_events(): dangling pointer

Fixes #908

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: MI: close domain when listing multiple agent domains
Philippe Proulx [Sat, 22 Aug 2015 06:47:53 +0000 (02:47 -0400)] 
Fix: MI: close domain when listing multiple agent domains

Without this patch, each agent domain gets nested under
the previous one.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoTests: expand UST wildcard tests, move to regression/tools
Mathieu Desnoyers [Fri, 4 Sep 2015 23:53:18 +0000 (19:53 -0400)] 
Tests: expand UST wildcard tests, move to regression/tools

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoTests: kernel filtering
Mathieu Desnoyers [Fri, 4 Sep 2015 23:00:14 +0000 (19:00 -0400)] 
Tests: kernel filtering

Requires the new lttng-test.ko lttng-modules test module.

Fixes #921

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: use pid element instead of process element
Jonathan Rajotte [Fri, 4 Sep 2015 22:02:48 +0000 (18:02 -0400)] 
Fix: use pid element instead of process element

v2: Include change to xsd. Looks like I forgot to squash it. I'll have to make
an offering to the git reflog god on this one.

For stable 2.7

This revert part of changes introduced by [1] and [2].

The use of process element break the existing MI xml api.

[1] 46ef4d0715faeef52cd2242b5b895c74507e223a
[2] a585578f837d992f00eba4f090c8ba251d9de94e

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: race between kconsumerd and sessiond on tear down
Jonathan Rajotte [Thu, 3 Sep 2015 21:48:36 +0000 (17:48 -0400)] 
Fix: race between kconsumerd and sessiond on tear down

v2: minimize indentation by using return on condition.

Kconsumerd and sessiond both have reference on lttng-module. This can lead to a race
on modprobe_remove_lttng_all which might fail to unload modules due to
certain modules not having a ref count equal to zero at the time.

waitpid is used to force a synchronization on the child (kconsumer) termination.

This also have been applied to ust consumers for the sake of consistency.

Fixes: #878
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Buggy string comparison in ust registry ht_match_event
Jérémie Galarneau [Sat, 5 Sep 2015 19:35:42 +0000 (15:35 -0400)] 
Fix: Buggy string comparison in ust registry ht_match_event

The second strncmp compares the first "strlen(event->signature) != 0"
characters of the event signatures because of a missing parenthesis.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Bad cast of lttng_kernel_instrumentation to lttng_event_type
Jérémie Galarneau [Sat, 5 Sep 2015 19:33:54 +0000 (15:33 -0400)] 
Fix: Bad cast of lttng_kernel_instrumentation to lttng_event_type

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Implicit cast from lttng_loglevel_type to lttng_ust_loglevel_type
Jérémie Galarneau [Sat, 5 Sep 2015 19:23:32 +0000 (15:23 -0400)] 
Fix: Implicit cast from lttng_loglevel_type to lttng_ust_loglevel_type

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: lttng-crash: remove tmp working directory
Jonathan Rajotte [Thu, 3 Sep 2015 21:52:07 +0000 (17:52 -0400)] 
Fix: lttng-crash: remove tmp working directory

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoClean up: Coding style conformance adjustments in lttng-crash.c
Jérémie Galarneau [Sat, 5 Sep 2015 17:55:51 +0000 (13:55 -0400)] 
Clean up: Coding style conformance adjustments in lttng-crash.c

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: lttng-crash: DIR leak in delete_trace() on error
Jérémie Galarneau [Sat, 5 Sep 2015 17:53:31 +0000 (13:53 -0400)] 
Fix: lttng-crash: DIR leak in delete_trace() on error

Implement a single return point in delete_trace() which ensures
that trace_dir is not leaked on error.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Possible passing of NULL pointer to memcpy()
Jérémie Galarneau [Sat, 5 Sep 2015 16:02:10 +0000 (12:02 -0400)] 
Fix: Possible passing of NULL pointer to memcpy()

_cmd_enable_event() will not jump to the error label in case of
memory allocation of the filter bytecode copy. This causes the NULL
return of zmalloc to be used by memcpy() directly.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Overwrite of ret in relay_recv_metadata
Jérémie Galarneau [Sat, 5 Sep 2015 15:57:52 +0000 (11:57 -0400)] 
Fix: Overwrite of ret in relay_recv_metadata

relay_recv_metadata() interchangeably uses ret and size_ret.
This causes ret to take various (positive) values in case
of success, most often corresponding to the size of the metadata
padding which was written during the call.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSilence undefined return value warning
Jérémie Galarneau [Sat, 5 Sep 2015 15:44:01 +0000 (11:44 -0400)] 
Silence undefined return value warning

clang-analyzer complains that "ret" may be returned uninitialized
which can't happen with a valid session configuration. For this to
occur, either libxml2 would have to return a bogus ChildElementCount
(return non-zero when there a actually no child nodes) _or_ the node
would have children of an unexpected type, which would be catched by
the validation performed against the XSD.

Nonetheless, the value is initialized here to silence this warning.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSilence use-after-free static analysis warning
Jérémie Galarneau [Sat, 5 Sep 2015 15:35:43 +0000 (11:35 -0400)] 
Silence use-after-free static analysis warning

clang-analyzer complains that cds_list_for_each_entry_safe()
makes use of "wait_node" after free. However, wait_node is only
used in __typeof__().

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Wait for in-flight data before closing a stream
Jérémie Galarneau [Sat, 5 Sep 2015 02:04:12 +0000 (22:04 -0400)] 
Fix: Wait for in-flight data before closing a stream

A stream's closing conditions are evaluated in three places:
    1) When a close command is received
    2) When the control connection owning it is closed
    3) The stream has received all of its data following
       a close request.

These checks are performed in try_stream_close().

A known downside of this approach is that a stream will never
be closed if it has not received all of its data.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: unpublish stream on close
Mathieu Desnoyers [Fri, 4 Sep 2015 19:44:23 +0000 (15:44 -0400)] 
Fix: unpublish stream on close

Fixes a race where data connection can still add indexes after close,
preventing graceful teardown of the stream.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: lttng-crash: fd leak
Jonathan Rajotte [Thu, 3 Sep 2015 21:52:06 +0000 (17:52 -0400)] 
Fix: lttng-crash: fd leak

At the same time, make sure to have a single exit-point in copy_file().

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Invalid parameter error reported when untracking PID
Jérémie Galarneau [Fri, 4 Sep 2015 21:34:44 +0000 (17:34 -0400)] 
Fix: Invalid parameter error reported when untracking PID

The LTTng client reports an "Invalid parameter" error if a PID is
untracked from the userspace domain before any PID is tracked in that
domain.

Fixes #931

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: kernel track/untrack error handling
Mathieu Desnoyers [Wed, 2 Sep 2015 14:45:07 +0000 (10:45 -0400)] 
Fix: kernel track/untrack error handling

Fixes #918

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Python agent tests are always skipped
Jonathan Rajotte [Mon, 24 Aug 2015 15:08:29 +0000 (08:08 -0700)] 
Fix: Python agent tests are always skipped

v2: Change the configure report section to emulate the java ust agent test
reporting.

Introduce --enable-test-python{2,3}-agent and --enable-test-python-agent-all
flag on configure.

Configure searches for the python agent for both Python 2 and 3 and
enables or skips their associated tests based on the result.

When using the --enable-test-python{2,3}-agent & --enable-test-python-agent-all
flags, a strict checks on tests dependancies is performed and fails the
configure instead of simply disabling the tests.

--disable* flags can be used to force tests skipping.

Also fixes a minor bug in agent test on enabling event with filtering.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoTests: Fix flaky live test client
Jérémie Galarneau [Fri, 4 Sep 2015 01:45:10 +0000 (21:45 -0400)] 
Tests: Fix flaky live test client

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Announce empty streams on live attach
Jérémie Galarneau [Fri, 4 Sep 2015 01:43:26 +0000 (21:43 -0400)] 
Fix: Announce empty streams on live attach

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd: file rotation and live read
Mathieu Desnoyers [Thu, 3 Sep 2015 21:17:30 +0000 (17:17 -0400)] 
Fix: relayd: file rotation and live read

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relay: viewer_get_next_index handle null vstream
Mathieu Desnoyers [Thu, 3 Sep 2015 21:17:29 +0000 (17:17 -0400)] 
Fix: relay: viewer_get_next_index handle null vstream

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd: make viewer streams consider metadata sent
Mathieu Desnoyers [Thu, 3 Sep 2015 21:17:28 +0000 (17:17 -0400)] 
Fix: relayd: make viewer streams consider metadata sent

The metadata stream does not use prev seq, and is therefore not sent to
viewers if we depend on prev seq. Use the metadata_received field
instead to achieve the same purpose: if a viewer try to attach to a
session that has not received metadata yet, it will get and error
(metadata stream cannot be found when attaching).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: don't expose empty streams
Mathieu Desnoyers [Tue, 25 Aug 2015 18:49:34 +0000 (14:49 -0400)] 
Fix: don't expose empty streams

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd: don't check new metadata on get packet
Mathieu Desnoyers [Thu, 3 Sep 2015 04:38:26 +0000 (00:38 -0400)] 
Fix: relayd: don't check new metadata on get packet

We only care about this when we get the next index. There may be new
metadata that appears between get next index and get packet, but it
should not matter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd: don't check for new streams in get packet
Mathieu Desnoyers [Tue, 25 Aug 2015 13:26:30 +0000 (09:26 -0400)] 
Fix: relayd: don't check for new streams in get packet

Only needed in get next index.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: ask new streams HUP
Mathieu Desnoyers [Tue, 25 Aug 2015 13:00:50 +0000 (09:00 -0400)] 
Fix: ask new streams HUP

Test closed streams for content to check for HUP.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: reply error if get packet vstream fails
Mathieu Desnoyers [Tue, 25 Aug 2015 11:53:07 +0000 (07:53 -0400)] 
Fix: reply error if get packet vstream fails

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd reply error to client if cannot find viewer stream
Mathieu Desnoyers [Tue, 25 Aug 2015 11:47:08 +0000 (07:47 -0400)] 
Fix: relayd reply error to client if cannot find viewer stream

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd reply with error if cannot find metadata
Mathieu Desnoyers [Tue, 25 Aug 2015 11:43:16 +0000 (07:43 -0400)] 
Fix: relayd reply with error if cannot find metadata

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: ust-app: protect app socket protocol with lock
Mathieu Desnoyers [Tue, 25 Aug 2015 02:50:09 +0000 (22:50 -0400)] 
Fix: ust-app: protect app socket protocol with lock

Many threads can access the application socket (cmd handling thread and
application handling thread) concurrently. Therefore, we need to protect
it with a mutex.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoCleanup: privatize consumer_allocate_relayd_sock_pair
Mathieu Desnoyers [Mon, 24 Aug 2015 19:04:03 +0000 (15:04 -0400)] 
Cleanup: privatize consumer_allocate_relayd_sock_pair

Only used in a single compilation unit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: add missing rcu_barrier at end of sessiond main
Mathieu Desnoyers [Mon, 24 Aug 2015 19:03:35 +0000 (15:03 -0400)] 
Fix: add missing rcu_barrier at end of sessiond main

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: add missing rcu_barrier at end of consumer main
Mathieu Desnoyers [Mon, 24 Aug 2015 19:03:20 +0000 (15:03 -0400)] 
Fix: add missing rcu_barrier at end of consumer main

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: app cmd leak on sessiond exit
Mathieu Desnoyers [Mon, 24 Aug 2015 18:41:42 +0000 (14:41 -0400)] 
Fix: app cmd leak on sessiond exit

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd live don't send incomplete stream list
Mathieu Desnoyers [Sun, 23 Aug 2015 19:52:26 +0000 (12:52 -0700)] 
Fix: relayd live don't send incomplete stream list

Sample the "closed" flag with session lock held.
Also, if the session connection is closed while we attach to it, reply
with HUP, because there are risks of attaching to an incomplete session
(e.g. the metadata stream could be already closed).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: consumer timer misses RCU thread registration
Mathieu Desnoyers [Sun, 23 Aug 2015 15:58:50 +0000 (08:58 -0700)] 
Fix: consumer timer misses RCU thread registration

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: sessiond consumer thread should register as RCU thread
Mathieu Desnoyers [Sun, 23 Aug 2015 05:01:36 +0000 (22:01 -0700)] 
Fix: sessiond consumer thread should register as RCU thread

Fixes RCU race where objects are accessed by this thread under RCU
read-side lock after free. Since this thread is not a registered RCU
reader, the read-side lock has no effect.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: don't chain RCU free
Mathieu Desnoyers [Sun, 23 Aug 2015 03:14:44 +0000 (20:14 -0700)] 
Fix: don't chain RCU free

We only do a single rcu_barrier() on teardown of sessiond. Therefore, if
we chain call_rcu, they may not all be executed before exit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: free metadata cache after grace period in consumer
Mathieu Desnoyers [Sun, 23 Aug 2015 02:58:09 +0000 (19:58 -0700)] 
Fix: free metadata cache after grace period in consumer

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: sessiond vs consumerd push/get metadata deadlock
Mathieu Desnoyers [Wed, 19 Aug 2015 21:44:59 +0000 (14:44 -0700)] 
Fix: sessiond vs consumerd push/get metadata deadlock

We need to unlock the registry while we push metadata to break a
circular dependency between the consumerd metadata lock and the sessiond
registry lock. Indeed, pushing metadata to the consumerd awaits that it
gets pushed all the way to relayd, but doing so requires grabbing the
metadata lock. If a concurrent metadata request is being performed by
consumerd, this can try to grab the registry lock on the sessiond while
holding the metadata lock on the consumer daemon. Those push and pull
schemes are performed on two different bidirectionnal communication
sockets.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: streamline ret/errno of run_as()
Mathieu Desnoyers [Wed, 19 Aug 2015 21:13:48 +0000 (14:13 -0700)] 
Fix: streamline ret/errno of run_as()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Double unlock on error path
Mathieu Desnoyers [Thu, 3 Sep 2015 03:01:21 +0000 (23:01 -0400)] 
Fix: Double unlock on error path

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoData pending comment clarification in session daemon
Mathieu Desnoyers [Thu, 3 Sep 2015 02:59:20 +0000 (22:59 -0400)] 
Data pending comment clarification in session daemon

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Relay daemon ownership and reference counting
Mathieu Desnoyers [Thu, 3 Sep 2015 02:57:40 +0000 (22:57 -0400)] 
Fix: Relay daemon ownership and reference counting

The ownership and reference counting of the relay daemon is unclear and
buggy in many ways. It is the cause of memory corruptions, double-free,
leaks, segmentation faults, observed in various conditions.

Fix this situation by introducing a clear ownership and reference
counting scheme for this daemon.

See doc/relayd-architecture.txt for details.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAccept uid and gid parameters in utils_mkdir()/utils_mkdir_recursive()
Jérémie Galarneau [Thu, 3 Sep 2015 19:09:00 +0000 (15:09 -0400)] 
Accept uid and gid parameters in utils_mkdir()/utils_mkdir_recursive()

utils_mkdir* utils may now be use in immediate or "run_as" mode.

This is done since some of the code shared between daemons calls
run_as directly, which doesn't support negative uid/gid (which we use
to mean "run as current user").

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: reference counting of consumer output
Mathieu Desnoyers [Wed, 19 Aug 2015 07:29:52 +0000 (00:29 -0700)] 
Fix: reference counting of consumer output

The UST app session has a reference on the consumer output object, but
it belongs to the UST session. Implement a refcounting scheme to ensure
it is not freed before all users are done using it.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: sessiond add missing socket close
Mathieu Desnoyers [Tue, 18 Aug 2015 01:47:53 +0000 (18:47 -0700)] 
Fix: sessiond add missing socket close

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: sessiond should not error on channel creation vs app exit
Mathieu Desnoyers [Sun, 16 Aug 2015 21:56:57 +0000 (17:56 -0400)] 
Fix: sessiond should not error on channel creation vs app exit

We should not report an error when creating a channel if the application
is exiting concurrently.

Also, remove an inappropriate assert() in ust_app_create_event_glb: it
is possible to have a channel lookup fail if channel/event creation
occurs concurrently with an application exit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: sessiond ust-app session teardown race
Mathieu Desnoyers [Sun, 16 Aug 2015 21:10:22 +0000 (17:10 -0400)] 
Fix: sessiond ust-app session teardown race

Add a deleted flag within the ust app session which is raised (with ust
app session lock held) at delete, and checked within each RCU traversal,
again with ust app session lock held.

This takes care of races between teardown of an application (unregister)
and execution of commands which are accessing the app session
concurrently.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoOnly display agent loglevel if the loglevel type is not ALL
Jérémie Galarneau [Tue, 1 Sep 2015 15:58:38 +0000 (11:58 -0400)] 
Only display agent loglevel if the loglevel type is not ALL

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoInitialize default log level of events on load
Jérémie Galarneau [Mon, 31 Aug 2015 22:53:51 +0000 (18:53 -0400)] 
Initialize default log level of events on load

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDon't assume that Log4j and JUL share the same log level mappings
Jérémie Galarneau [Mon, 31 Aug 2015 22:32:16 +0000 (18:32 -0400)] 
Don't assume that Log4j and JUL share the same log level mappings

We explicitly set the log level of Log4j events to
LTTNG_LOGLEVEL_LOG4J_ALL instead of relying on the fact that
LTTNG_LOGLEVEL_LOG4J_ALL and LTTNG_LOGLEVEL_JUL_ALL are mapped to the
same value.

The resulting additional branch does not seem to incur a significant
performance penalty and, as such, is deemed acceptable.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAllow the creation of JUL, Log4j and Python channels
Jérémie Galarneau [Mon, 31 Aug 2015 20:00:22 +0000 (16:00 -0400)] 
Allow the creation of JUL, Log4j and Python channels

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Save tracker as part of UST and Kernel domains only
Jérémie Galarneau [Sun, 30 Aug 2015 22:55:52 +0000 (18:55 -0400)] 
Fix: Save tracker as part of UST and Kernel domains only

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Memory leak of agent
Jérémie Galarneau [Sun, 30 Aug 2015 22:50:39 +0000 (18:50 -0400)] 
Fix: Memory leak of agent

agent_destroy() has a comment which indicates that it does _not_
destroy the pointer passed to it and it seems that agents are
never realeased under any code path whatsoever.

There does not seem to be an instance where an agent is allocated on
the stack.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Memory leak of agent event internals
Jérémie Galarneau [Sun, 30 Aug 2015 22:32:47 +0000 (18:32 -0400)] 
Fix: Memory leak of agent event internals

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSave filter expression as part of agent events and save them
Jérémie Galarneau [Sun, 30 Aug 2015 21:44:41 +0000 (17:44 -0400)] 
Save filter expression as part of agent events and save them

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: UTF-8 characters may be stored on up to 4 bytes
Jérémie Galarneau [Sun, 30 Aug 2015 21:43:45 +0000 (17:43 -0400)] 
Fix: UTF-8 characters may be stored on up to 4 bytes

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove unneeded hash table existence check in agent_destroy
Jérémie Galarneau [Sun, 30 Aug 2015 21:39:58 +0000 (17:39 -0400)] 
Remove unneeded hash table existence check in agent_destroy

This function can never be called if the agent failed to initialize
its hash table. If such a failure occurs, the agent constructor will
return NULL and its caller should handle the error.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove unnecessary RCU read lock
Jérémie Galarneau [Sun, 30 Aug 2015 21:39:23 +0000 (17:39 -0400)] 
Remove unnecessary RCU read lock

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUse type directly in sizeof instead of a dereferenced pointer
Jérémie Galarneau [Sun, 30 Aug 2015 21:38:25 +0000 (17:38 -0400)] 
Use type directly in sizeof instead of a dereferenced pointer

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoPrevent the addition of UST events to agent channels
Jérémie Galarneau [Sun, 30 Aug 2015 21:37:41 +0000 (17:37 -0400)] 
Prevent the addition of UST events to agent channels

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDon't save log level in session configuration when unneeded
Jérémie Galarneau [Fri, 28 Aug 2015 18:53:26 +0000 (14:53 -0400)] 
Don't save log level in session configuration when unneeded

Saving the log level of events in session configurations when "ALL" log
levels are enabled may confuse both users and programs working with
session configurations.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove unneeded RCU lock
Jérémie Galarneau [Thu, 27 Aug 2015 21:30:37 +0000 (17:30 -0400)] 
Remove unneeded RCU lock

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove unneeded RCU lock
Jérémie Galarneau [Thu, 27 Aug 2015 21:30:21 +0000 (17:30 -0400)] 
Remove unneeded RCU lock

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Propagate filter status of kernel events to client
Jérémie Galarneau [Thu, 27 Aug 2015 21:26:58 +0000 (17:26 -0400)] 
Fix: Propagate filter status of kernel events to client

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Save kernel event filter when saving session configuration
Jérémie Galarneau [Thu, 27 Aug 2015 20:53:24 +0000 (16:53 -0400)] 
Fix: Save kernel event filter when saving session configuration

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDocs: there is no need to SHOUT in comments
Jérémie Galarneau [Thu, 27 Aug 2015 16:55:04 +0000 (12:55 -0400)] 
Docs: there is no need to SHOUT in comments

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: Mention Python as part of enable-event's usage()
Jérémie Galarneau [Thu, 27 Aug 2015 15:52:34 +0000 (11:52 -0400)] 
Fix: Mention Python as part of enable-event's usage()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoGrammar fix in comment
Jérémie Galarneau [Wed, 26 Aug 2015 16:05:03 +0000 (12:05 -0400)] 
Grammar fix in comment

give -> given

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: typo in error message
Jérémie Galarneau [Wed, 26 Aug 2015 16:04:12 +0000 (12:04 -0400)] 
Fix: typo in error message

writting -> writing

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd agent domains to lttng enable-event usage()
Jérémie Galarneau [Wed, 26 Aug 2015 16:03:38 +0000 (12:03 -0400)] 
Add agent domains to lttng enable-event usage()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDocs: Add documentation explaining the meaning of "internal" events
Jérémie Galarneau [Wed, 26 Aug 2015 16:02:50 +0000 (12:02 -0400)] 
Docs: Add documentation explaining the meaning of "internal" events

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoReport memory allocation failure when copying filter bytecode
Jérémie Galarneau [Wed, 26 Aug 2015 16:00:30 +0000 (12:00 -0400)] 
Report memory allocation failure when copying filter bytecode

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: cmd_enable_event must return positive error codes
Jérémie Galarneau [Wed, 26 Aug 2015 16:00:05 +0000 (12:00 -0400)] 
Fix: cmd_enable_event must return positive error codes

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoEnsure that a filter is always passed with its filter expression
Jérémie Galarneau [Wed, 26 Aug 2015 15:58:56 +0000 (11:58 -0400)] 
Ensure that a filter is always passed with its filter expression

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSave filter expressions as part of agent events
Jérémie Galarneau [Wed, 26 Aug 2015 15:37:48 +0000 (11:37 -0400)] 
Save filter expressions as part of agent events

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoAdd agent domains to the enable-event section of LTTNG(1)
Jérémie Galarneau [Wed, 26 Aug 2015 15:31:45 +0000 (11:31 -0400)] 
Add agent domains to the enable-event section of LTTNG(1)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUse lttng_domain_type enumeration instead of bare integers
Jérémie Galarneau [Mon, 24 Aug 2015 23:24:37 +0000 (19:24 -0400)] 
Use lttng_domain_type enumeration instead of bare integers

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoPrevent disable event on internal UST events
Jérémie Galarneau [Mon, 24 Aug 2015 16:24:18 +0000 (12:24 -0400)] 
Prevent disable event on internal UST events

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove unneeded RCU read lock
Jérémie Galarneau [Mon, 24 Aug 2015 16:17:46 +0000 (12:17 -0400)] 
Remove unneeded RCU read lock

lttng_ht_get_count() now takes the RCU read lock automatically.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoSkip internal events when saving a session configuration
Jérémie Galarneau [Mon, 24 Aug 2015 16:17:01 +0000 (12:17 -0400)] 
Skip internal events when saving a session configuration

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoClean-up: Coding-style conformance adjustments
Jérémie Galarneau [Sun, 23 Aug 2015 04:28:57 +0000 (00:28 -0400)] 
Clean-up: Coding-style conformance adjustments

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoDocs: Clarify ominous comment wording
Jérémie Galarneau [Sun, 23 Aug 2015 04:28:24 +0000 (00:28 -0400)] 
Docs: Clarify ominous comment wording

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoHide internal events from session daemon clients
Jérémie Galarneau [Sun, 23 Aug 2015 03:43:21 +0000 (23:43 -0400)] 
Hide internal events from session daemon clients

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoPrevent the use of reserved UST event names
Jérémie Galarneau [Sun, 23 Aug 2015 04:27:34 +0000 (00:27 -0400)] 
Prevent the use of reserved UST event names

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoTag events created as side-effect of agent events as internal
Jérémie Galarneau [Sun, 23 Aug 2015 04:26:28 +0000 (00:26 -0400)] 
Tag events created as side-effect of agent events as internal

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove unneeded RCU lock
Jérémie Galarneau [Sun, 23 Aug 2015 03:35:22 +0000 (23:35 -0400)] 
Remove unneeded RCU lock

lttng_ht_get_count() already holds the RCU read lock.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoRemove dead code in lttng-sessiond
Jérémie Galarneau [Sun, 23 Aug 2015 03:24:17 +0000 (23:24 -0400)] 
Remove dead code in lttng-sessiond

event_ust_enable_all_tracepoints and event_ust_disable_all_tracepoints
are both never used by the session daemon.

7 years agoEnsure event names are NULL terminated during validation
Jérémie Galarneau [Sun, 23 Aug 2015 04:22:45 +0000 (00:22 -0400)] 
Ensure event names are NULL terminated during validation

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.067926 seconds and 4 git commands to generate.