lttng-tools.git
8 years agoFix: time redefinition warnings on macOS builds
Jérémie Galarneau [Wed, 28 Sep 2016 17:26:49 +0000 (13:26 -0400)] 
Fix: time redefinition warnings on macOS builds

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: remove unused variable user
Jérémie Galarneau [Wed, 28 Sep 2016 16:24:50 +0000 (12:24 -0400)] 
Clean-up: remove unused variable user

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoCleanup: Remove fun from code base
Mathieu Desnoyers [Sun, 25 Sep 2016 18:32:27 +0000 (14:32 -0400)] 
Cleanup: Remove fun from code base

It appears choosing the release names provides plenty of enjoyment to
LTTng developers, thus allowing us to remove those easter eggs.

Incidentally, it will allow me to demo the LTTng project without
carrying this <yellow>Welcome back Dr Tracing!</yellow> message each
time I issue a "lttng" command.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: remove in-place backup suffix argument provided to sed
Jérémie Galarneau [Wed, 7 Sep 2016 21:21:22 +0000 (17:21 -0400)] 
Fix: remove in-place backup suffix argument provided to sed

GNU sed complains when an empty suffix argument is provided
as the in-place suffix.

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 agoLog signals received by run_as worker
Jérémie Galarneau [Fri, 26 Aug 2016 19:47:07 +0000 (15:47 -0400)] 
Log signals received by run_as worker

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoMissing word in worker_sighandler() comment
Jérémie Galarneau [Fri, 26 Aug 2016 19:46:50 +0000 (15:46 -0400)] 
Missing word in worker_sighandler() comment

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up snapshot command error reporting
Jérémie Galarneau [Thu, 25 Aug 2016 20:43:13 +0000 (16:43 -0400)] 
Clean-up snapshot command error reporting

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 agoTests: don't copy test_python_logging explicitly
Jérémie Galarneau [Fri, 5 Aug 2016 21:55:38 +0000 (17:55 -0400)] 
Tests: don't copy test_python_logging explicitly

cp would fail silently in OOT builds when trying to copy
test_python_logging. This is no longer necessary as it is
generated on configure.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoOOT build fix: Missing include of src directory
Jérémie Galarneau [Fri, 5 Aug 2016 21:35:00 +0000 (17:35 -0400)] 
OOT build fix: Missing include of src directory

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAccomodate BSD sed in version.h generation
Jérémie Galarneau [Fri, 5 Aug 2016 19:45:19 +0000 (15:45 -0400)] 
Accomodate BSD sed in version.h generation

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Detect platforms where librt is required
Michael Jeanson [Wed, 3 Aug 2016 21:59:16 +0000 (17:59 -0400)] 
Port: Detect platforms where librt is required

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX clock_gettime compat
Michael Jeanson [Wed, 3 Aug 2016 20:54:16 +0000 (16:54 -0400)] 
Port: Add OSX clock_gettime compat

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX support to socket compat
Michael Jeanson [Wed, 3 Aug 2016 18:35:27 +0000 (14:35 -0400)] 
Port: Add OSX support to socket compat

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX support to poll compat
Michael Jeanson [Wed, 3 Aug 2016 18:33:42 +0000 (14:33 -0400)] 
Port: Add OSX support to poll compat

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX support to fcntl compat
Michael Jeanson [Wed, 3 Aug 2016 18:29:28 +0000 (14:29 -0400)] 
Port: Add OSX support to fcntl compat

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX compat to sessiond-comm/unix.c
Michael Jeanson [Wed, 3 Aug 2016 18:25:25 +0000 (14:25 -0400)] 
Port: Add OSX compat to sessiond-comm/unix.c

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX endian.h compat
Michael Jeanson [Wed, 3 Aug 2016 18:21:36 +0000 (14:21 -0400)] 
Port: Add OSX endian.h compat

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoPort: Add OSX libuuid compat
Michael Jeanson [Tue, 2 Aug 2016 20:27:59 +0000 (16:27 -0400)] 
Port: Add OSX libuuid compat

OSX has the libuuid symbols built in the system libraries.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: zero-initialize fd_set
Jérémie Galarneau [Wed, 3 Aug 2016 18:14:33 +0000 (14:14 -0400)] 
Fix: zero-initialize fd_set

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: missing cast to fd_set*
Jérémie Galarneau [Wed, 3 Aug 2016 16:42:43 +0000 (12:42 -0400)] 
Clean-up: missing cast to fd_set*

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: usage of FD_SET on fd_set > 1024 results in corruption
Jérémie Galarneau [Wed, 3 Aug 2016 16:36:34 +0000 (12:36 -0400)] 
Fix: usage of FD_SET on fd_set > 1024 results in corruption

fd_set is (typically) defined as an 1024 bit long array.
Therefore, using FD_SET with an fd > 1024 will result in a buffer
overrun.

Reported-by: Coverity Scan
CID 1360535 (#1 of 1): Out-of-bounds write (OVERRUN)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: erroneous usage of addr parameter in mmap()
Jérémie Galarneau [Wed, 3 Aug 2016 15:43:13 +0000 (11:43 -0400)] 
Fix: erroneous usage of addr parameter in mmap()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: remove useless assignment
Jérémie Galarneau [Wed, 3 Aug 2016 15:09:21 +0000 (11:09 -0400)] 
Clean-up: remove useless assignment

Reported-by Coverity Scan:
CID 1243014: Unused value (UNUSED_VALUE)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: missing unmap in test error handling
Jérémie Galarneau [Mon, 1 Aug 2016 19:34:31 +0000 (15:34 -0400)] 
Fix: missing unmap in test error handling

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: unchecked pthread_join return value
Jérémie Galarneau [Mon, 1 Aug 2016 19:32:39 +0000 (15:32 -0400)] 
Tests: unchecked pthread_join return value

Reported-by Coverity Scan:
CID 1360530 (#1 of 1): Unchecked return value (CHECKED_RETURN)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: remove negative check against unsigned value
Jérémie Galarneau [Mon, 1 Aug 2016 19:27:33 +0000 (15:27 -0400)] 
Clean-up: remove negative check against unsigned value

Reported-by Coverity Scan:
CID 1360536 (#1 of 1): Unsigned compared against 0 (NO_EFFECT)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: unchecked init_pipe return value
Jérémie Galarneau [Mon, 1 Aug 2016 19:16:38 +0000 (15:16 -0400)] 
Fix: unchecked init_pipe return value

Reported-by Coverity Scan:
CID 1360533 (#1 of 1): Logically dead code (DEADCODE)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: Unchecked pthread_create return value
Jérémie Galarneau [Mon, 1 Aug 2016 19:07:42 +0000 (15:07 -0400)] 
Tests: Unchecked pthread_create return value

Reported-by Coverity Scan:
CID 1360529 (#1 of 1): Unchecked return value (CHECKED_RETURN)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: remove useless assignment
Jérémie Galarneau [Mon, 1 Aug 2016 18:39:37 +0000 (14:39 -0400)] 
Clean-up: remove useless assignment

Reported-by Coverity Scan
CID 1243048 (#1 of 1): Unused value (UNUSED_VALUE)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: Add tracepoints to libbar, libfoo and libzzz
Jérémie Galarneau [Fri, 22 Jul 2016 19:10:57 +0000 (15:10 -0400)] 
Tests: Add tracepoints to libbar, libfoo and libzzz

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 agoTest the parsing of perf raw context
Julien Desfossez [Tue, 5 Jul 2016 15:50:47 +0000 (11:50 -0400)] 
Test the parsing of perf raw context

Only test the parsing of the new option in fast_regression since the
real integration test requires particular hardware and kernel
configuration which might not be available.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoEnable perf PMU counters by raw ID
Julien Desfossez [Tue, 5 Jul 2016 15:50:46 +0000 (11:50 -0400)] 
Enable perf PMU counters by raw ID

Allow enabling perf PMU counters by raw ID in addition to the generic
list already provided. The format for kernel tracing is
"perf:cpu:raw:rNNN:<name>" and "perf:thread:raw:rNNN:<name> for
user-space. The rNNN format is the same as perf-record(1) where NNN is a
hexadecimal event descriptor in the form of umask+eventsel. The <name>
field to associate a clearer name to the counter.

Example usage on Intel i7-3520M to get the unhalted reference cycles
(eventsel: 0x13c) count at privilege level 0 (umask: 0x00):
lttng add-context -k -t perf:cpu:raw:r0013c:x86unhalted

Result in the trace:
sched_switch: { cpu_id = 3 }, {
perf_cpu_raw_r0013c_x86unhalted = 27632578 }, [...]

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoRun userspace perf tests on non-x86 platforms
Jérémie Galarneau [Wed, 6 Jul 2016 19:47:18 +0000 (15:47 -0400)] 
Run userspace perf tests on non-x86 platforms

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: adjust ust-dl planned test count
Jérémie Galarneau [Wed, 6 Jul 2016 23:39:10 +0000 (19:39 -0400)] 
Tests: adjust ust-dl planned test count

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest library load/unload events
Mathieu Desnoyers [Mon, 4 Jul 2016 22:54:31 +0000 (18:54 -0400)] 
Test library load/unload events

Test the lttng_ust_lib:load, lttng_ust_lib:build_id,
lttng_ust_lib:debug_link, and lttng_ust_lib:unload events from
lttng-ust, which track the state of loaded libraries. This ensures we
correctly handle dlopen of libraries with direct dependencies.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAdd missing ust_app_regenerate_statedump_all stub
Jérémie Galarneau [Wed, 6 Jul 2016 19:30:45 +0000 (15:30 -0400)] 
Add missing ust_app_regenerate_statedump_all stub

This allows the build to succeed in --without-lttng-ust mode.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: remove unused ust_app_regenerate_metadata_all
Jérémie Galarneau [Wed, 6 Jul 2016 19:22:45 +0000 (15:22 -0400)] 
Clean-up: remove unused ust_app_regenerate_metadata_all

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAdd regenerate command to MI schema
Jérémie Galarneau [Wed, 6 Jul 2016 18:52:18 +0000 (14:52 -0400)] 
Add regenerate command to MI schema

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoManpage for the regenerate statedump command
Julien Desfossez [Tue, 5 Jul 2016 14:54:38 +0000 (10:54 -0400)] 
Manpage for the regenerate statedump command

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests for the regenerate statedump command
Julien Desfossez [Tue, 5 Jul 2016 14:54:37 +0000 (10:54 -0400)] 
Tests for the regenerate statedump command

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAllow regenerating the statedump of a running session
Julien Desfossez [Tue, 5 Jul 2016 14:54:36 +0000 (10:54 -0400)] 
Allow regenerating the statedump of a running session

The "lttng regenerate statedump" command can be used to regenerate the
statedump of a running session whenever needed. This is particularly
useful in snapshot and trace-file rotation modes where the original
statedump may be lost.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoKernel ioctl to regenerate the statedump
Mathieu Desnoyers [Tue, 5 Jul 2016 14:54:35 +0000 (10:54 -0400)] 
Kernel ioctl to regenerate the statedump

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUST command to regenerate the statedump
Mathieu Desnoyers [Tue, 5 Jul 2016 14:54:34 +0000 (10:54 -0400)] 
UST command to regenerate the statedump

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoRename the "metadata regenerate" command to "regenerate metadata"
Julien Desfossez [Tue, 5 Jul 2016 14:54:33 +0000 (10:54 -0400)] 
Rename the "metadata regenerate" command to "regenerate metadata"

Prepare the deprecation of the "metadata regenerate" command since we
need to regenerate the statedump as well, so it is more convenient to
have one command to regenerate various session's attributes.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTypo fix: uninitializez ->uninitialized
Jérémie Galarneau [Wed, 6 Jul 2016 14:09:40 +0000 (10:09 -0400)] 
Typo fix: uninitializez ->uninitialized

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: handle negative (unlimited) system stack size limits
Jérémie Galarneau [Wed, 6 Jul 2016 04:14:26 +0000 (00:14 -0400)] 
Fix: handle negative (unlimited) system stack size limits

This also changes the stack size selection policy to select
the largest of:

1) default pthread stack size (dictated by libc)
2) system soft limit
3) 2 MB

This is bounded by the system's hard limit on stack size.
If this limit is smaller than 2 MB, the default size mentionned
in pthread_create(3) for Linux, we warn the user that the daemons
may be unreliable and advise bumping this limit.

Note that is is most likely possible to operate the daemons with
way less than 2MB of stack space. However, this was not
extensively tested.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: adjust type declaration test count
Jérémie Galarneau [Tue, 5 Jul 2016 23:19:55 +0000 (19:19 -0400)] 
Tests: adjust type declaration test count

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: protocol mismatch between UST and tools
Philippe Proulx [Tue, 5 Jul 2016 21:05:21 +0000 (17:05 -0400)] 
Fix: protocol mismatch between UST and tools

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoust-ctl: use fixed-size integer rather than enum
Jérémie Galarneau [Tue, 5 Jul 2016 20:27:54 +0000 (16:27 -0400)] 
ust-ctl: use fixed-size integer rather than enum

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest UST's autoincrementing enumeration values
Philippe Proulx [Mon, 4 Jul 2016 22:24:19 +0000 (18:24 -0400)] 
Test UST's autoincrementing enumeration values

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAdd support for UST's autoincrementing enum entries
Philippe Proulx [Mon, 4 Jul 2016 21:48:42 +0000 (17:48 -0400)] 
Add support for UST's autoincrementing enum entries

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
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 agoTest for select, poll and epoll syscall overrides
Julien Desfossez [Tue, 28 Jun 2016 21:45:52 +0000 (17:45 -0400)] 
Test for select, poll and epoll syscall overrides

This test for root_regression checks if the syscall overrides for
select, pselect6, poll, ppoll, epoll_ctl, epoll_wait and epoll_pwait
work as expected on arm and x86 (32 and 64-bit).

There are 11 test cases that check for normal and abnormal behaviour. If
the test system has the Babeltrace python bindings, the test validates
the content of the events, otherwise only the presence of the generated
events is checked.

We also check if kernel OOPS, WARNING or BUG were generated during the
test.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
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: Set thread stack size to ulimit soft value
Michael Jeanson [Wed, 15 Jun 2016 21:18:07 +0000 (17:18 -0400)] 
Fix: Set thread stack size to ulimit soft value

Some libc don't honor the limit set for the stack size and use their own
empirically chosen static value. Detect this behavior by checking if the
current stack size is smally than the soft limit and in that case set
the pthread stack size to soft limit value.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
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: strerror_r behavior is glibc specific
Michael Jeanson [Wed, 15 Jun 2016 21:18:04 +0000 (17:18 -0400)] 
Fix: strerror_r behavior is glibc specific

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 agoFix: snapshot del-output with name on musl
Michael Jeanson [Wed, 15 Jun 2016 21:18:02 +0000 (17:18 -0400)] 
Fix: snapshot del-output with name on musl

Some implementations of strtol(), like the one in musl, will
return EINVAL in errno when no valid number was found in
the string.

Signed-off-by: Michael Jeanson <mjeanson@efficios.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 agoTests: spawn ht_cleanup thread in unit tests
Jérémie Galarneau [Fri, 17 Jun 2016 21:50:49 +0000 (17:50 -0400)] 
Tests: spawn ht_cleanup thread in unit tests

Run the cleanup thread in the unit tests to ensure that the hash
tables are properly cleaned-up even in the context of tests. This
allows us to reliably check for memory leaks in the unit tests.

8 years agoLazily initialize max poll set size
Jérémie Galarneau [Mon, 27 Jun 2016 19:18:38 +0000 (15:18 -0400)] 
Lazily initialize max poll set size

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoRevert "Assert that a valid clean-up pipe exists on ht_cleanup_push"
Jérémie Galarneau [Fri, 17 Jun 2016 22:09:12 +0000 (18:09 -0400)] 
Revert "Assert that a valid clean-up pipe exists on ht_cleanup_push"

This reverts commit fc41443f7ee5fa95a942d0aedd61c75d622697b5.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agotests: test ust snapshot with discard buffers
Mathieu Desnoyers [Wed, 20 Apr 2016 15:20:00 +0000 (11:20 -0400)] 
tests: test ust snapshot with discard buffers

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agotests: test kernel snapshot with discard buffers
Mathieu Desnoyers [Wed, 20 Apr 2016 15:19:59 +0000 (11:19 -0400)] 
tests: test kernel snapshot with discard buffers

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAllow channel mode override in snapshot sessions
Mathieu Desnoyers [Wed, 20 Apr 2016 15:19:58 +0000 (11:19 -0400)] 
Allow channel mode override in snapshot sessions

Allow the lttng cmd line and liblttng-ctl users to override the channel
mode in snapshot sessions.

Note that liblttng-ctl users expecting that an "overwrite" mode
explicitly set at the value "0" (discard) for a snapshot session will
now create a channel in discard mode.

The DEFAULT_CHANNEL_OVERWRITE used by liblttng-ctl
lttng_channel_set_default_attr() is changed to "-1".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.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 agoUse bool type for save command options
Jérémie Galarneau [Tue, 14 Jun 2016 16:46:02 +0000 (12:46 -0400)] 
Use bool type for save command options

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: harmonize popt option declarations in save.c
Jérémie Galarneau [Tue, 14 Jun 2016 16:41:39 +0000 (12:41 -0400)] 
Clean-up: harmonize popt option declarations in save.c

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: move mi_writer declaration with other declarations
Jérémie Galarneau [Tue, 14 Jun 2016 16:41:09 +0000 (12:41 -0400)] 
Clean-up: move mi_writer declaration with other declarations

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAdd name omission and output omission on save to lttng-ctl
Jérémie Galarneau [Tue, 14 Jun 2016 16:36:07 +0000 (12:36 -0400)] 
Add name omission and output omission on save to lttng-ctl

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoExpress overwrite attribute as a byte in communication protocol
Jérémie Galarneau [Tue, 14 Jun 2016 16:30:37 +0000 (12:30 -0400)] 
Express overwrite attribute as a byte in communication protocol

There is no need for 4 bytes to express a boolean state.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoAssert that a valid clean-up pipe exists on ht_cleanup_push
Jérémie Galarneau [Tue, 14 Jun 2016 16:29:24 +0000 (12:29 -0400)] 
Assert that a valid clean-up pipe exists on ht_cleanup_push

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 agoDocs: fix comment typos in lttng-sessiond's main.c
Jérémie Galarneau [Fri, 3 Jun 2016 18:11:44 +0000 (14:11 -0400)] 
Docs: fix comment typos in lttng-sessiond's main.c

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 agoClean-up: harmonize kernctl API error checking
Jérémie Galarneau [Thu, 2 Jun 2016 10:13:48 +0000 (06:13 -0400)] 
Clean-up: harmonize kernctl API error checking

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoIntroduce LTTNG_IOCTL_CHECK and LTTNG_IOCTL_NO_CHECK macros
Jérémie Galarneau [Thu, 2 Jun 2016 21:36:03 +0000 (17:36 -0400)] 
Introduce LTTNG_IOCTL_CHECK and LTTNG_IOCTL_NO_CHECK macros

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 agoDocs: document safety of consumer_thread_is_ready access
Jérémie Galarneau [Thu, 2 Jun 2016 09:03:26 +0000 (05:03 -0400)] 
Docs: document safety of consumer_thread_is_ready access

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up: unused ret values in thread_manage_health
Jérémie Galarneau [Thu, 2 Jun 2016 08:38:43 +0000 (04:38 -0400)] 
Clean-up: unused ret values in thread_manage_health

Reported by Coverity as:
CID 1243014 (#1 of 15): Unused value (UNUSED_VALUE)

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