lttng-tools.git
7 years agoFix: test_ust_data dereference of null pointer
Jonathan Rajotte [Tue, 17 Jan 2017 15:08:22 +0000 (10:08 -0500)] 
Fix: test_ust_data dereference of null pointer

Skip test on NULL value to prevent null dereference.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: test_kernel_data dereference of null pointer
Jonathan Rajotte [Tue, 17 Jan 2017 15:02:08 +0000 (10:02 -0500)] 
Fix: test_kernel_data dereference of null pointer

Skip tests when tested struct is null.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoMan: move [SESSION] before options
Jonathan Rajotte [Fri, 13 Jan 2017 22:04:42 +0000 (17:04 -0500)] 
Man: move [SESSION] before options

The previous synopses for the live mode can cause confusion to users
since it can lead to an error while trying one of the simplest create
command for live session that the synopsis is proposing:

lttng create --live test.

Other synopsis are modified for symmetry.

Fixes #1081

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: consumerd: add missing put_subbuf for ust and kernel errors
Mathieu Desnoyers [Wed, 11 Jan 2017 20:49:49 +0000 (15:49 -0500)] 
Fix: consumerd: add missing put_subbuf for ust and kernel errors

While reading a sub-buffer, error handling need to put the sub-buffer,
else all future attempts to use the stream will trigger warnings.

The affects recent features added to UST and kernel tracing.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: sessiond: only send streams to consumer once
Mathieu Desnoyers [Wed, 11 Jan 2017 20:49:48 +0000 (15:49 -0500)] 
Fix: sessiond: only send streams to consumer once

Session daemon should not send streams to consumer daemon
repeatedly when CPU hotplug is performed while doing kernel
tracing.

This causes the consumer daemon to have multiple file descriptors
on the same stream, and thus try to perform operations like reading
a sub-buffer and checking for data pending concurrently. This triggers
safety-net warnings in the kernel tracer.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: consumerd main: needs to be a registered RCU thread
Mathieu Desnoyers [Thu, 19 Jan 2017 00:23:27 +0000 (19:23 -0500)] 
Fix: consumerd main: needs to be a registered RCU thread

main->lttng_consumer_destroy->destroy_data_stream_ht requires a RCU
read-side lock.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: thread_dispatch_ust_registration needs to be a RCU thread
Mathieu Desnoyers [Thu, 19 Jan 2017 00:23:26 +0000 (19:23 -0500)] 
Fix: thread_dispatch_ust_registration needs to be a RCU thread

It uses a read-side lock.

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 abort metadata push on closed metadata
Jérémie Galarneau [Thu, 19 Jan 2017 00:23:09 +0000 (19:23 -0500)] 
Fix: don't abort metadata push on closed metadata

The failure/exit of any of the consumerd, relayd or applications
(in per-PID buffer mode) will cause the metadata closed flag to
be set.

While pushing new metadata updates to the consumerd (and relayd
in streaming/live scenarios) will fail, those conditions should
be handled in-place.

Applications are _expected_ to exit during the course of a per-PID
session. However, they will typically have pushed their metadata
to the metadata cache before doing so. The session daemon must
flush the unconsumed metadata to the consumerd in this case.

Failure to answer to the metadata request originating from the
consumerd can cause it to keep the stream lock held and, thus,
prevent the channel poll thread from cleaning up on channel
close.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agolttng-tools: remove bogus interpreter line from utils shell library
Nathan Lynch [Mon, 9 Jan 2017 22:14:28 +0000 (16:14 -0600)] 
lttng-tools: remove bogus interpreter line from utils shell library

tests/utils/utils.sh is always sourced, never executed, and
/src/bin/bash is not a typical path for a shell interpreter.  Just
delete it.

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate version to v2.8.6 v2.8.6
Jérémie Galarneau [Mon, 9 Jan 2017 19:15:20 +0000 (14:15 -0500)] 
Update version to v2.8.6

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: consumerd: order of metadata cache vs stream lock
Mathieu Desnoyers [Mon, 9 Jan 2017 16:23:16 +0000 (11:23 -0500)] 
Fix: consumerd: order of metadata cache vs stream lock

The locking order comment in consumer.h is incorrect. First, its
description of locking order is not in sync with the comment found in
consumer-metadata-cache.h. The comment in struct consumer_metadata_cache
only states that the metadata cache lock nests inside the consumer_data
lock, and does not mention the stream lock, which implies that the
metadata cache lock does NOT nest inside the stream lock. But let's
investigate further to confirm:

* lttng_consumer_read_subbuffer() acquires the stream lock, and then
  calls lttng_ustconsumer_read_subbuffer() with stream lock held,
  and then invokes commin_one_metadata_packet(), which acquires the
  metadata cache lock.

* lttng_ustconsumer_sync_metadata() acquires the metadata stream lock,
  and calls commit_one_metadata_packet(), which takes the metadata cache
  lock.

Therefore, update the comment in consumer.h to state that the metadata
cache lock nests INSIDE the stream lock, and update
consumer_del_metadata_stream() accordingly.

This should take care of fixing the locking order reversal found by
Coverity.

CID 1368314 (#1 of 1): Thread deadlock (ORDER_REVERSAL)
CID 1368319:  Program hangs  (ORDER_REVERSAL)

Fixes: 5feafd4130 "Fix: protect the channel's metadata stream using the metadata cache lock"
Fixes: 1ea6cc572b "Fix: lock nesting order reversed"
Fixes: fb549e7ac2 "Fix: reverse channel and metadata cache lock nesting order"
Reported-by: Coverity Scan
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 before daemon teardown
Mathieu Desnoyers [Wed, 21 Dec 2016 22:59:38 +0000 (17:59 -0500)] 
Fix: add missing rcu_barrier before daemon teardown

When performing the "cleanup" of sessiond, consumerd, and relayd, we
destroy data structures that may still be concurrently accessed by
call_rcu worker thread.

Ensure no more work is present in the call_rcu worker thread by issuing
a rcu_barrier barrier. Note that this expects call_rcu handlers don't
chain work to other call_rcu handlers.

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 pthread.h include
Michael Jeanson [Mon, 5 Dec 2016 20:39:26 +0000 (15:39 -0500)] 
Fix: Add missing pthread.h include

Some libc like musl and uClibc requires explicit includes of pthread.h

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: support for older versions of Babeltrace in test script
Francis Deslauriers [Tue, 20 Dec 2016 21:31:26 +0000 (16:31 -0500)] 
Fix: support for older versions of Babeltrace in test script

A new context field was introduced in version LTTng 2.8 that is printed
by Babeltrace prior to v1.2.5. This regex thus fails to match the
output. Since the context fields are not used by the script, we create a
non-capturing group for these fields that matches on both old and new
Babeltrace.
This is causing problems on Ubuntu 14.04 Trusty when building
lttng-tools from source and using the Babeltrace package from the
official repository (v1.2.1) to run the test suite.

Also, this patch removes commented and used code in the function but
keeps the names of non-capturing groups for readability.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
CC: Philippe Proulx <pproulx@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: reverse channel and metadata cache lock nesting order
Jérémie Galarneau [Sun, 8 Jan 2017 19:29:09 +0000 (14:29 -0500)] 
Fix: reverse channel and metadata cache lock nesting order

CID 1368319:  Program hangs  (ORDER_REVERSAL)

The lttng_consumer_channel lock must be nested outside of the
metadata cache lock, as indicated in the structure's comments.

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate version to v2.8.5 v2.8.5
Jérémie Galarneau [Sat, 7 Jan 2017 21:24:32 +0000 (16:24 -0500)] 
Update version to v2.8.5

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: only lock the metadata_cache in userspace consumers
Jérémie Galarneau [Sat, 7 Jan 2017 18:42:12 +0000 (13:42 -0500)] 
Fix: only lock the metadata_cache in userspace consumers

The kernel consumer, which re-uses the consumer_del_metadata_stream
function, has no metadata cache. Therefore, it can't be used to
protect the metadata stream (see 5feafd41).

However, only the userspace consumers invoke
consumer_metadata_cache_write() which the previous fix seeked to
protect against. It is therefore safe to omit this lock in the
kernel consumer case.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: lock nesting order reversed
Jérémie Galarneau [Sat, 7 Jan 2017 17:32:13 +0000 (12:32 -0500)] 
Fix: lock nesting order reversed

The lttng_consumer_stream lock must nest INSIDE the metadata
cache lock, as indicated in the structure's comments
(see consumer.h:340).

CID 1368314 (#1 of 1): Thread deadlock (ORDER_REVERSAL)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate version to v2.8.4 v2.8.4
Jérémie Galarneau [Fri, 6 Jan 2017 19:59:46 +0000 (14:59 -0500)] 
Update version to v2.8.4

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: lttng-relayd: forcefully close stream on relayd shutdown
Jonathan Rajotte [Tue, 20 Dec 2016 23:25:17 +0000 (18:25 -0500)] 
Fix: lttng-relayd: forcefully close stream on relayd shutdown

Add an "aborted" field to relay_session struct to indicate that on
shutdown pending data for a stream is no relevant and should not be
waited for.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: protect the channel's metadata stream using the metadata cache lock
Jérémie Galarneau [Wed, 21 Dec 2016 22:56:24 +0000 (17:56 -0500)] 
Fix: protect the channel's metadata stream using the metadata cache lock

The consumer_thread_data_poll and consumer_thread_metadata_poll
both access the channel's metadata stream.

During a session destruction, consumer_thread_metadata_poll will
destroy all metadata streams. However, the consumer_thread_data_poll
may still invoke a consumer_metadata_cache_write() triggered
by a "ready" subbuffer. Hence, the metadata stream must be protected
from this action by the metadata cache lock.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: double unlock of metadata mutex on error
Jérémie Galarneau [Tue, 20 Dec 2016 20:00:04 +0000 (15:00 -0500)] 
Fix: double unlock of metadata mutex on error

lttng_ustconsumer_sync_metadata must leave the metadata lock
in its initial state. Otherwise an error may result in a
double unlock in the caller.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: add element length check in lttng_index_file_open
Mathieu Desnoyers [Thu, 15 Dec 2016 11:13:19 +0000 (12:13 +0100)] 
Fix: add element length check in lttng_index_file_open

Handle cases where the index file header would contain a corrupted
value.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: free previous instance of url (alloc_url) on default live url assignation
Jonathan Rajotte [Mon, 12 Dec 2016 21:39:17 +0000 (16:39 -0500)] 
Fix: free previous instance of url (alloc_url) on default live url assignation

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: relayd vs consumerd compatibility
Mathieu Desnoyers [Thu, 15 Dec 2016 10:04:57 +0000 (11:04 +0100)] 
Fix: relayd vs consumerd compatibility

relay and consumerd 2.7 and 2.8 are expected to negociate compatibility
with the lowest common minor version.

If a consumer daemon 2.8 interacts with a relayd 2.7, it needs to send
the index fields for ctf index 1.0. Same if a relayd 2.8 interacts with
a consumer daemon 2.7: relayd should expect ctf index 1.0 fields, and
generate a ctf index 1.0 index file layout.

If both relayd and consumerd versions are 2.8+, then we can send the ctf
index 1.1 fields over the protocol, and store them in the index files.

Whenever the relayd live viewer server opens and reads an index file,
it needs to use the file's header to figure out the index "element"
size.

[ Should be applied to master, stable-2.9, stable-2.8. ]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoUpdate version to v2.8.3 v2.8.3
Jérémie Galarneau [Thu, 1 Dec 2016 23:06:40 +0000 (18:06 -0500)] 
Update version to v2.8.3

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 years agoFix: truncate the metadata file in shm-path
Liguang Li [Mon, 28 Nov 2016 08:37:47 +0000 (16:37 +0800)] 
Fix: truncate the metadata file in shm-path

In the shm-path mode, the metadata will be backuped to a metadata
file, when run the lttng command "lttng metadata regenerate" to
resample the wall time following a major NTP correction, the metadata
file will not be truncated and regenerated.

Add the function clear_metadata_file() to truncate and regenerate the
metadata file.

Signed-off-by: Liguang Li <liguang.li@windriver.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: add missing refcount of loaded modules
Francis Deslauriers [Mon, 21 Nov 2016 17:36:00 +0000 (12:36 -0500)] 
Fix: add missing refcount of loaded modules

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: only unload successfully loaded kernel modules
Jérémie Galarneau [Fri, 18 Nov 2016 21:35:34 +0000 (16:35 -0500)] 
Fix: only unload successfully loaded kernel modules

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: test cases now rely on explicit workloads
Francis Deslauriers [Thu, 10 Nov 2016 20:26:35 +0000 (15:26 -0500)] 
Fix: test cases now rely on explicit workloads

Run a process explicitly in the tracing session to generate the enabled events
rather than relying on the events generated by the lttng CLI.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agom4/pprint.m4: update with correct quoting
Philippe Proulx [Wed, 2 Nov 2016 07:25:25 +0000 (03:25 -0400)] 
m4/pprint.m4: update with correct quoting

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoconfigure.ac: move warning to end of output for the end user
Philippe Proulx [Fri, 28 Oct 2016 23:01:19 +0000 (19:01 -0400)] 
configure.ac: move warning to end of output for the end user

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agodoc/man: only require asciidoc-attrs.conf when building the man pages
Philippe Proulx [Fri, 28 Oct 2016 22:33:19 +0000 (18:33 -0400)] 
doc/man: only require asciidoc-attrs.conf when building the man pages

Situations:

* If you want to and can build the man pages:
  * If it's a tarball tree:
    * Make the man page destinations depend on asciidoc-attrs.conf.
      Since it's a generated file, its date is greater than the
      date of the prebuilt man pages, therefore the man pages are
      built again, which is a good thing because they include the
      default values of this build.
  * If it's a Git tree:
    * Always build the man pages anyway (no prebuilt man pages here).
* If you want to, but cannot build the man pages:
  * If it's a tarball tree:
    * Make the man page destinations NOT depend on asciidoc-attrs.conf,
      because its recent date would ask said destinations to be rebuilt
      and this is not possible because we don't have the tools.

      However, warn the user at configure time that the prebuilt man
      pages will be installed, which means that they will contain the
      project's default values, not this build's default values.
  * If it's a Git tree:
    * Not valid: error at configure time as usual.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAdd version info to lttng-relayd help
Anders Wallin [Thu, 20 Oct 2016 05:58:55 +0000 (07:58 +0200)] 
Add version info to lttng-relayd help

lttng-relayd man pages states that the option
-V --version is available, but it it's missing in the code

Signed-off-by: Anders Wallin <wallinux@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: stop sessiond threads on health thread error
Jérémie Galarneau [Thu, 20 Oct 2016 21:05:14 +0000 (17:05 -0400)] 
Fix: stop sessiond threads on health thread error

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: stop lttng-relayd threads on health thread error
Jérémie Galarneau [Thu, 20 Oct 2016 19:45:42 +0000 (15:45 -0400)] 
Fix: stop lttng-relayd threads on health thread error

The lttng-relayd health thread may fail to initialize for
a variety of reason (notably, a too long unix domain socket
address), which will cause it to never notify that it is
ready.

In such circumstances, the lttng-relayd command, in background or
daemonize mode, will never return as the daemon's "readyness"
will never be signaled.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: report an error if unix socket address is too long
Jérémie Galarneau [Thu, 20 Oct 2016 19:45:13 +0000 (15:45 -0400)] 
Fix: report an error if unix socket address is too long

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: save: leak of configuration file fd
Jonathan Rajotte [Tue, 18 Oct 2016 22:09:53 +0000 (18:09 -0400)] 
Fix: save: leak of configuration file fd

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUpdate version to v2.8.2 v2.8.2
Jérémie Galarneau [Fri, 7 Oct 2016 22:47:41 +0000 (18:47 -0400)] 
Update version to v2.8.2

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: report truncation on snprintf
Jonathan Rajotte [Wed, 7 Sep 2016 15:54:40 +0000 (11:54 -0400)] 
Fix: report truncation on snprintf

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: check for a session daemon before running load command
Jérémie Galarneau [Thu, 6 Oct 2016 18:52:19 +0000 (14:52 -0400)] 
Fix: check for a session daemon before running load command

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: ignore SIGPIPE
Mathieu Desnoyers [Thu, 6 Oct 2016 16:57:45 +0000 (12:57 -0400)] 
Fix: ignore SIGPIPE

Issuing fprintf() to stderr (thus write() to the standard error file
descriptor) within the SIGPIPE signal handler is bad: it can trigger
SIGPIPE repeatedly if the listening end has closed its end of the pipe.

Set the SIGPIPE action to SIG_IGN in relayd, sessiond, and consumerd.

This was affecting sessiond and relayd. The consumerd did not print
anything to stderr.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: use ssize_type for the return value of uri_parse_str_urls
Jonathan Rajotte [Wed, 7 Sep 2016 15:07:52 +0000 (11:07 -0400)] 
Fix: use ssize_type for the return value of uri_parse_str_urls

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoDocs: grammar fixes in load.h
Jérémie Galarneau [Thu, 6 Oct 2016 15:24:23 +0000 (11:24 -0400)] 
Docs: grammar fixes in load.h

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: wrong api comments for load.h
Jonathan Rajotte [Tue, 6 Sep 2016 18:21:11 +0000 (14:21 -0400)] 
Fix: wrong api comments for load.h

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: do not overwrite ret if already set and session found
Jonathan Rajotte [Tue, 13 Sep 2016 21:17:50 +0000 (17:17 -0400)] 
Fix: do not overwrite ret if already set and session found

Errors were not propagated correctly otherwise.

e.g:
(No sessiond running)
lttng load --all
-> All sessions have been loaded successfully
lttng list show no sessions

With fix the same command output:
Error: No session daemon is available

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: handle backward compatibility with lttng-modules 2.7
Mathieu Desnoyers [Wed, 5 Oct 2016 16:54:19 +0000 (12:54 -0400)] 
Fix: handle backward compatibility with lttng-modules 2.7

There is no major version bump between lttng-module 2.7 and 2.8 ABI.
Even though we do not guarantee compatibility, do a best effort to
maintain it when possible.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: remove unnecessary autoconf variable substitution
Jérémie Galarneau [Tue, 4 Oct 2016 21:16:01 +0000 (17:16 -0400)] 
Clean-up: remove unnecessary autoconf variable substitution

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: honor negative (unlimited) app socket timeout
Jérémie Galarneau [Tue, 4 Oct 2016 21:00:17 +0000 (17:00 -0400)] 
Fix: honor negative (unlimited) app socket timeout

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoBuild: Replace use of deprecated AM_PATH_XML2
Jérémie Galarneau [Tue, 4 Oct 2016 18:37:57 +0000 (14:37 -0400)] 
Build: Replace use of deprecated AM_PATH_XML2

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: tap.sh spams tests' output when no plan is set
Jérémie Galarneau [Thu, 30 Jun 2016 20:37:57 +0000 (16:37 -0400)] 
Tests: tap.sh spams tests' output when no plan is set

Some tests are implemented in C (using tap.h) or in Python
and don't use tap.sh's facilities. However, it is sourced
by utils.sh and prints an error message during its clean-up
because a plan was never set.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: location of various standard headers
Michael Jeanson [Wed, 15 Jun 2016 21:18:06 +0000 (17:18 -0400)] 
Fix: location of various standard headers

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: missing include ctype.h for isdigit()
Michael Jeanson [Wed, 15 Jun 2016 21:18:05 +0000 (17:18 -0400)] 
Fix: missing include ctype.h for isdigit()

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: error.h -> common/error.h
Michael Jeanson [Wed, 15 Jun 2016 21:18:03 +0000 (17:18 -0400)] 
Fix: error.h -> common/error.h

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest fix: set app and network socket timeouts to unlimited
Jérémie Galarneau [Thu, 29 Sep 2016 23:35:01 +0000 (19:35 -0400)] 
Test fix: set app and network socket timeouts to unlimited

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest fix: test_fork can hang while waiting for child pids
Jérémie Galarneau [Thu, 29 Sep 2016 04:03:42 +0000 (00:03 -0400)] 
Test fix: test_fork can hang while waiting for child pids

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest fix: test_daemon can hang while waiting for child pids
Jérémie Galarneau [Thu, 29 Sep 2016 04:01:06 +0000 (00:01 -0400)] 
Test fix: test_daemon can hang while waiting for child pids

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest fix: redirect python test subprocess output to /dev/null
Jérémie Galarneau [Thu, 29 Sep 2016 03:13:19 +0000 (23:13 -0400)] 
Test fix: redirect python test subprocess output to /dev/null

Redirecting to subprocess.PIPE can deadlock when subprocess.wait()
is invoked.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: pass a valid length to accept() on unix domain sockets
Jérémie Galarneau [Wed, 31 Aug 2016 03:00:57 +0000 (23:00 -0400)] 
Fix: pass a valid length to accept() on unix domain sockets

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: RCU lock imbalance on error in cmd_snapshot_list_outputs()
Jérémie Galarneau [Thu, 25 Aug 2016 20:20:47 +0000 (16:20 -0400)] 
Fix: RCU lock imbalance on error in cmd_snapshot_list_outputs()

The error path of cmd_snapshot_list_outputs() unlocks the
rcu_read_lock. However, this path can be taken without having
ever locked before.

Fixes #1044

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUse -M parameter instead of --manpath when invoking man(1)
Ricardo Nabinger Sanchez [Thu, 25 Aug 2016 19:57:46 +0000 (15:57 -0400)] 
Use -M parameter instead of --manpath when invoking man(1)

Older versions of man (and the implementation used in FreeBSD) do
not support the long version of the --manpath/-M option. Use
'-M' in the interest of portability.

Fixes #1043

Signed-off-by: Ricardo Nabinger Sanchez <rnsanchez@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoOOT Build fix: reference the source directory's Python test app
Jérémie Galarneau [Wed, 10 Aug 2016 18:40:24 +0000 (14:40 -0400)] 
OOT Build fix: reference the source directory's Python test app

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: pass NULL to config_load_session instead of an empty string
Jérémie Galarneau [Tue, 9 Aug 2016 17:03:00 +0000 (13:03 -0400)] 
Fix: pass NULL to config_load_session instead of an empty string

The public lttng_load_session wrapper uses empty strings (strings
starting with \0) to express "any" session_name and the default
session load paths.

However, this is not expected by config_load_session which uses
NULLs to express these values.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Mark ASCIIDOC_ATTRS_CONF as a dependency of man page targets
Jérémie Galarneau [Wed, 20 Jul 2016 17:56:38 +0000 (13:56 -0400)] 
Fix: Mark ASCIIDOC_ATTRS_CONF as a dependency of man page targets

ASCIIDOC_ATTRS_CONF contains the various paths set by autoconf,
such as datadir, syscondif and prefix, and it may be changed
by the user by invoking ./configure with different options. In
such a case, the man pages should be regenerated to take the new
paths into account.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUpdate version to v2.8.1 v2.8.1
Jérémie Galarneau [Tue, 5 Jul 2016 19:47:12 +0000 (15:47 -0400)] 
Update version to v2.8.1

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: eliminate process timeouts from Python tests
Jérémie Galarneau [Tue, 5 Jul 2016 19:13:15 +0000 (15:13 -0400)] 
Tests: eliminate process timeouts from Python tests

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: English syntax errors in 'lttng status'
Sebastien Boisvert [Tue, 28 Jun 2016 12:12:59 +0000 (08:12 -0400)] 
Fix: English syntax errors in 'lttng status'

Signed-off-by: Sebastien Boisvert <sboisvert@gydle.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: sessiond ht_match_event() check if filter is NULL
Philippe Proulx [Wed, 15 Jun 2016 21:18:03 +0000 (17:18 -0400)] 
Fix: sessiond ht_match_event() check if filter is NULL

It looks like an agent event's filter expression is NULL when
it's created with -a, for example:

    lttng enable-event -j -a

Since there's no check for this in ht_match_event(), strlen()
makes the session daemon segfault with this scenario:

    lttng create
    lttng enable-event -j -a
    lttng disable-event -j -a

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoconfigure.ac: fix --enable/disable-kmod option
Philippe Proulx [Tue, 21 Jun 2016 20:29:38 +0000 (16:29 -0400)] 
configure.ac: fix --enable/disable-kmod option

Now all the following work as expected:

  * No option (defaults to --enable-kmod)
  * --disable-kmod
  * --enable-kmod
  * --enable-kmod=no
  * --enable-kmod=yes

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: validate number of subbuffers after tweaking properties
Mathieu Desnoyers [Wed, 20 Apr 2016 15:19:57 +0000 (11:19 -0400)] 
Fix: validate number of subbuffers after tweaking properties

There are properties that are tweaked by each of ust and kernel channel
create functions after a validation on the number of subbuffers for
overwrite channels. Move validation after those properties
modifications.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: do not refer to objects as .o
Michael Jeanson [Thu, 9 Jun 2016 19:11:33 +0000 (15:11 -0400)] 
Fix: do not refer to objects as .o

The extension of object files is platform dependant,
use $(OBJEXT) instead of .o when referring to objects.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: do not link against libtool .o objects
Michael Jeanson [Thu, 9 Jun 2016 19:11:32 +0000 (15:11 -0400)] 
Fix: do not link against libtool .o objects

We should not link against libtool objects directly
since they have different names in static or shared
only build. Instead link on the full .la

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Define MANPATH in config.h
Michael Jeanson [Thu, 9 Jun 2016 19:11:31 +0000 (15:11 -0400)] 
Fix: Define MANPATH in config.h

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: Make warn_processes.sh more portable
Michael Jeanson [Thu, 9 Jun 2016 16:21:31 +0000 (12:21 -0400)] 
Tests: Make warn_processes.sh more portable

Options to pgrep aren't standardised across coreutils
implementations, use a more common option.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: add missing script to dist
Michael Jeanson [Thu, 9 Jun 2016 16:21:30 +0000 (12:21 -0400)] 
Fix: add missing script to dist

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: leak of UST app hash tables
Jérémie Galarneau [Thu, 9 Jun 2016 20:14:28 +0000 (16:14 -0400)] 
Fix: leak of UST app hash tables

The ht_cleanup thread is shut down before the queue of rcu
callbacks is emptied by the rcu_barrier(). Since callbacks added
by call_rcu can push hash tables through the ht_cleanup pipe, we run
into cases where the clean-up thread has been shutdown and
hash tables pushed through the clean-up pipe are leaked.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: leak of reply buffer on data pending check
Jérémie Galarneau [Wed, 8 Jun 2016 20:42:27 +0000 (16:42 -0400)] 
Fix: leak of reply buffer on data pending check

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: call xmlCleanupParser to free global libxml2 allocations
Jérémie Galarneau [Wed, 8 Jun 2016 17:31:13 +0000 (13:31 -0400)] 
Fix: call xmlCleanupParser to free global libxml2 allocations

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: missing "void" parameter of lib constructor and destructor
Jérémie Galarneau [Wed, 8 Jun 2016 17:28:38 +0000 (13:28 -0400)] 
Fix: missing "void" parameter of lib constructor and destructor

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: lttng-relayd allow binding of privileged ports for non-root users
Jérémie Galarneau [Fri, 3 Jun 2016 18:05:21 +0000 (14:05 -0400)] 
Fix: lttng-relayd allow binding of privileged ports for non-root users

Non-root users could use authbind to bind to low-numbered ports.
Moreover, the check was inverted; !getuid() will only be true
for the root user.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agorelayd: optimize receive throughput
Mathieu Desnoyers [Thu, 2 Jun 2016 20:27:36 +0000 (22:27 +0200)] 
relayd: optimize receive throughput

For channels configured with large sub-buffer size, the relayd copies
the entire trace sub-buffer (trace packet) into a large buffer, and then
copies the large buffer to disk. It is inefficient from a point of view
of cache locality.

Use a 64k buffer on the stack instead, and move the data piece-wise.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: enforce assumption that lttng-modules ioctl() return <= 0
Jérémie Galarneau [Thu, 2 Jun 2016 09:56:28 +0000 (05:56 -0400)] 
Fix: enforce assumption that lttng-modules ioctl() return <= 0

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: reduce scope of kconsumer consumed_pos and produced_pos
Jérémie Galarneau [Thu, 2 Jun 2016 09:19:50 +0000 (05:19 -0400)] 
Fix: reduce scope of kconsumer consumed_pos and produced_pos

The consumed_pos and produced_pos accesses are protected by the
stream mutex, which is fine as-is. However, consumed_pos is
passed to consumer_get_consume_start_pos() and is flagged by
Coverity as a possible use of a "stale" consumed_pos.

From an analyzer's standpoint, this makes sense since
both lttng_kconsumer_get_produced_snapshot() and
lttng_kconsumer_get_consumed_snapshot() could leave their output
parameter uninitialized and return 0 since they both  assume that
ioctl() will set errno if ret != 0.

IOCTL(3P) specifies that errno is only set if ret < 0.

A bug in lttng-modules could cause ioctl() to return a positive
value, leaving the errno variable unset. In such a case,
both functions would return 0, leaving the positions uninitialized.

A follow-up fix enforces this assumption (ret never > 0) as part
of the kernctl API.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: set the logger level to prevent unexpected level inheritance
Jonathan Rajotte [Thu, 26 May 2016 22:14:37 +0000 (18:14 -0400)] 
Fix: set the logger level to prevent unexpected level inheritance

BSF and other jars can ship with an embedded log4j.properties
file. This causes problem when launching an application with a general
class path (e.g /usr/share/java/*) since log4j will look for a
configuration file in all loaded jars. If any contains a directive for
the root logger, it will affect any logger with no level that are
directly under the root logger. This can result in an unexpected
behaviour (e.g no events triggered etc.).

Link: https://issues.apache.org/jira/browse/BSF-24
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTypo: Stoping -> Stopping
Michael Jeanson [Tue, 24 May 2016 18:28:46 +0000 (14:28 -0400)] 
Typo: Stoping -> Stopping

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTypo: occured -> occurred
Michael Jeanson [Tue, 24 May 2016 18:28:45 +0000 (14:28 -0400)] 
Typo: occured -> occurred

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUpdate version to v2.8.0 v2.8.0
Jérémie Galarneau [Fri, 20 May 2016 21:39:23 +0000 (17:39 -0400)] 
Update version to v2.8.0

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: only perform lttng_consumer_sync_trace_file() in local mode
Jérémie Galarneau [Thu, 19 May 2016 22:48:16 +0000 (18:48 -0400)] 
Fix: only perform lttng_consumer_sync_trace_file() in local mode

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoMake lttng_consumer_sync_trace_file static
Jérémie Galarneau [Thu, 19 May 2016 22:47:54 +0000 (18:47 -0400)] 
Make lttng_consumer_sync_trace_file static

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: don't negate posix_fadvise return value to check error
Jérémie Galarneau [Thu, 19 May 2016 22:24:20 +0000 (18:24 -0400)] 
Fix: don't negate posix_fadvise return value to check error

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix Solaris 10 build: use lttng_strnlen() wrapper
Jérémie Galarneau [Thu, 19 May 2016 22:16:48 +0000 (18:16 -0400)] 
Fix Solaris 10 build: use lttng_strnlen() wrapper

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoRename lttng_error_type to lttng_error_level
Jérémie Galarneau [Thu, 19 May 2016 18:20:08 +0000 (14:20 -0400)] 
Rename lttng_error_type to lttng_error_level

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoCleanup error.h __lttng_print() used for message printing
Mathieu Desnoyers [Thu, 19 May 2016 15:57:45 +0000 (11:57 -0400)] 
Cleanup error.h __lttng_print() used for message printing

The loglevels have never really been a mask, and it is useless to try to
use them as masks, because the compiler statically knows the value of
the loglevel requested, and can therefore optimise away all the logic.

This takes care of Coverity warning about mixed bitwise and boolean
logic, which was technically correct, but more complex than needed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUpdate coding style document for macro style
Mathieu Desnoyers [Thu, 19 May 2016 15:57:44 +0000 (11:57 -0400)] 
Update coding style document for macro style

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: coding style document has erroneous semicolon at end of macro
Mathieu Desnoyers [Thu, 19 May 2016 15:57:43 +0000 (11:57 -0400)] 
Fix: coding style document has erroneous semicolon at end of macro

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: add missing semicolons after MSG, DBG, ERR print macros
Mathieu Desnoyers [Thu, 19 May 2016 15:57:42 +0000 (11:57 -0400)] 
Fix: add missing semicolons after MSG, DBG, ERR print macros

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: inverted condition in test_kernel_data
Jérémie Galarneau [Thu, 19 May 2016 05:35:44 +0000 (01:35 -0400)] 
Tests: inverted condition in test_kernel_data

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoOOT build fix: asciidoc.conf is now a source file
Jérémie Galarneau [Thu, 19 May 2016 05:26:11 +0000 (01:26 -0400)] 
OOT build fix: asciidoc.conf is now a source file

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agolttng-create(1): use attributes for default ports
Philippe Proulx [Thu, 19 May 2016 02:59:12 +0000 (22:59 -0400)] 
lttng-create(1): use attributes for default ports

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agolttng-create(1): add xrefs to creation mode definitions
Philippe Proulx [Thu, 19 May 2016 02:16:50 +0000 (22:16 -0400)] 
lttng-create(1): add xrefs to creation mode definitions

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