lttng-tools.git
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 agoUpdate version to v2.7.4 v2.7.4
Jérémie Galarneau [Tue, 5 Jul 2016 19:53:36 +0000 (15:53 -0400)] 
Update version to v2.7.4

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: 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: set the logger level to prevent unexpected level inheritance
Jonathan Rajotte [Sat, 28 May 2016 06:34:23 +0000 (02:34 -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 agoPort: Don't use SIGUNUSED which is not defined on Solaris
Jérémie Galarneau [Sat, 17 Oct 2015 23:41:47 +0000 (19:41 -0400)] 
Port: Don't use SIGUNUSED which is not defined on Solaris

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

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: use start and stop sessiond from utils.sh
Jonathan Rajotte [Thu, 17 Sep 2015 20:42:35 +0000 (16:42 -0400)] 
Fix: use start and stop sessiond from utils.sh

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClarify kernel version check error messages
Jérémie Galarneau [Mon, 16 May 2016 04:21:20 +0000 (00:21 -0400)] 
Clarify kernel version check error messages

Refs #949

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Error reported if no domain is provided for start/stop
Jérémie Galarneau [Mon, 16 May 2016 02:06:01 +0000 (22:06 -0400)] 
Fix: Error reported if no domain is provided for start/stop

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoHandle unknown domain in MI
Jérémie Galarneau [Sun, 15 May 2016 21:38:55 +0000 (17:38 -0400)] 
Handle unknown domain in MI

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoHandle unknown domain on session start
Jérémie Galarneau [Sun, 15 May 2016 21:38:41 +0000 (17:38 -0400)] 
Handle unknown domain on session start

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: loading of live session within userspace domains
Jérémie Galarneau [Thu, 5 Nov 2015 21:19:38 +0000 (16:19 -0500)] 
Fix: loading of live session within userspace domains

The output of a session is session-specific and not bound to
a domain. The "lttng_set_consumer_url" already acts on a
session-wide basis.

Fixes #973

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoDocs: fix "daemon" typo in README.md
Jérémie Galarneau [Wed, 13 Apr 2016 22:06:13 +0000 (18:06 -0400)] 
Docs: fix "daemon" typo in README.md

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: do not return error on LTTNG_ERR_SNAPSHOT_NODATA
Jonathan Rajotte [Tue, 22 Mar 2016 18:12:04 +0000 (14:12 -0400)] 
Fix: do not return error on LTTNG_ERR_SNAPSHOT_NODATA

A warning is fine since the user has no control on
whether or not applications (or the kernel) have
produced any event between the start of the tracing
session and the recording of the snapshot.

MI wise the command is not a success since nothing was
recorded. The command line return code is CMD_SUCCESS.

refs #1002

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Set loopback adress in set_ip_addr if gethostbyname2 fails
Jérémie Galarneau [Fri, 19 Feb 2016 19:32:21 +0000 (14:32 -0500)] 
Fix: Set loopback adress in set_ip_addr if gethostbyname2 fails

Some systems may not have "localhost" defined in accordance with IETF
RFC 6761. According to this RFC, applications may recognize
"localhost" names as special and resolve to the appropriate loopback
address.

We choose to use the system name resolution API first to honor its
network configuration. If this fails, we resolve to the appropriate
loopback address. This is done to accomodate systems which may want to
start tracing before their network configured.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: d_type validity is not guaranteed on all nfs versions
Jonathan Rajotte [Thu, 17 Mar 2016 18:56:02 +0000 (14:56 -0400)] 
Fix: d_type validity is not guaranteed on all nfs versions

When using lttng-crash on files mounted on a nfs mount the d_type from
the dirent struct is not necessarily set and results in a DT_UNKNOWN
d_type.

stat() provides the valid information on an nfs mount.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: same event name with different descriptor on load
Jonathan Rajotte [Mon, 26 Oct 2015 14:21:05 +0000 (10:21 -0400)] 
Tests: same event name with different descriptor on load

Refs #959

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: load event state (enabled/disabled) correctly
Jonathan Rajotte [Fri, 23 Oct 2015 15:32:44 +0000 (11:32 -0400)] 
Fix: load event state (enabled/disabled) correctly

This bug fix is a workaround due to limitations of lttng_disable_event_ext
regarding the disabling of events with similar name but different
characteristics. Although lttng_disable_event_ext provides support for
disabling by name and filter string it does not support exclusion.

The loading of events is cut in 3 phases.

1 - Create all events regardless of their state.
2 - Disable all events.
3 - Enable only the events with the 'enabled' state.

Fixes #959

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
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 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 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 agoFix: Use get_domain_str on add context
Jonathan Rajotte [Fri, 18 Mar 2016 22:25:23 +0000 (18:25 -0400)] 
Fix: Use get_domain_str on add context

Fixes #1006

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@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 agoFix: ust-consumer: flush empty packets on snapshot channel
Mathieu Desnoyers [Wed, 18 May 2016 18:04:13 +0000 (14:04 -0400)] 
Fix: ust-consumer: flush empty packets on snapshot channel

Snapshot operation on a non-stopped stream should use a "final" flush to
ensure empty packets are flushed, so we gather timestamps at the moment
where the snapshot is taken. This is important for streams that have a
low amount of activity, which might be on an empty packet when the
snapshot is triggered.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: WARN() should print as WARN level, not ERR
Mathieu Desnoyers [Wed, 18 May 2016 18:04:16 +0000 (14:04 -0400)] 
Fix: WARN() should print as WARN level, not ERR

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: error.h: add missing parenthesis around macro parameter
Mathieu Desnoyers [Wed, 18 May 2016 18:04:15 +0000 (14:04 -0400)] 
Fix: error.h: add missing parenthesis around macro parameter

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: bogus mask on error.h PRINT types
Mathieu Desnoyers [Wed, 18 May 2016 18:04:14 +0000 (14:04 -0400)] 
Fix: bogus mask on error.h PRINT types

PRINT_ERR maps to 0x1, PRINT_WARN maps to 0x2, which is fine so far to
use as masks, but PRINT_BUG maps to 0x3, which is the same as both
PRINT_ERR and PRINT_WARN, and does not make sense to use in masks with
__lttng_print:

  (type & (PRINT_WARN | PRINT_ERR | PRINT_BUG))

Fix this by ensuring PRINT_BUG has its own mask, and express all
constants as shifts to eliminate the risk of re-introducing a similar
bug in the future.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: kernel tracing: flush after stop
Mathieu Desnoyers [Wed, 18 May 2016 18:04:12 +0000 (14:04 -0400)] 
Fix: kernel tracing: flush after stop

We should flush the last packet after stop, not before. Otherwise, we
may end up with events written immediately after the flush, which
defeats the purpose of flushing.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: UST should not generate packet at destroy after stop
Mathieu Desnoyers [Wed, 18 May 2016 18:04:11 +0000 (14:04 -0400)] 
Fix: UST should not generate packet at destroy after stop

In the following scenario:
- create, enable events (ust),
- start
- ...
- stop (await for data_pending to complete)
- destroy
- rm the trace directory

We would expect that the "rm" operation would not conflict with the
consumer daemon trying to output data into the trace files, since the
"stop" operation ensured that there was no data_pending.

However, the "destroy" operation currently generates an extra packet
after the data_pending check (the "on_stream_hangup"). This causes the
consumer daemon to try to perform trace file rotation concurrently with
the trace directory removal in the scenario above, which triggers
errors. The main reason why this empty packet is generated by "destroy"
is to deal with trace start/stop scenario which would otherwise generate
a completely empty stream.

Therefore, introduce the concept of a "quiescent stream". It is
initialized at false on stream creation (first packet is empty). When
tracing is started, it is set to false (for cases of start/stop/start).
When tracing is stopped, if the stream is not quiescent, perform a
"final" flush (which will generate an empty packet if the current packet
was empty), and set quiescent to true.  On "destroy" stream and on
application hangup: if the stream is not quiescent, perform a "final"
flush, and set the quiescent state to true.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: remove flaky '*' kernel wildcard test
Jérémie Galarneau [Wed, 18 May 2016 22:35:45 +0000 (18:35 -0400)] 
Tests: remove flaky '*' kernel wildcard test

The test case for '*', which enables all events, is flaky by its
nature since buffers may be filled by other kernel events preventing
the test script from finding the test event (it is often discarded).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: bad file descriptors on close after rotation error
Mathieu Desnoyers [Wed, 18 May 2016 18:04:10 +0000 (14:04 -0400)] 
Fix: bad file descriptors on close after rotation error

Ensure we don't try to close output stream file descriptors twice when a
trace file rotation error occurs (once at tracefile rotation, once when
closing the stream). Set the fd value to -1 after the first close to
ensure we don't try to close it again.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: posix_fadvise wrapper returns -ENOSYS on FreeBSD
Jérémie Galarneau [Wed, 18 May 2016 20:05:19 +0000 (16:05 -0400)] 
Fix: posix_fadvise wrapper returns -ENOSYS on FreeBSD

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Double free in utils_partial_realpath error path
Michael Jeanson [Wed, 18 May 2016 16:17:27 +0000 (12:17 -0400)] 
Fix: Double free in utils_partial_realpath error path

Fixes coverity #1355521

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: remove logically dead code in send_channel_uid_to_ust
Mathieu Desnoyers [Tue, 17 May 2016 16:31:23 +0000 (12:31 -0400)] 
Fix: remove logically dead code in send_channel_uid_to_ust

Found by Coverity:

at_most: At condition ret < 0, the value of ret must be at most -1.
    cannot_set: At condition ret < 0, the value of ret cannot be equal
to any of {-1030, -32}.
    dead_error_condition: The condition ret < 0 must be true.
2825                        } else if (ret < 0) {
2826                                goto error_stream_unlock;
2827                        }
    CID 1323135 (#1 of 1): Logically dead code
(DEADCODE)dead_error_line: Execution cannot reach this statement: goto
error_stream_unlock;.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: unchecked return value in low throughput test
Mathieu Desnoyers [Tue, 17 May 2016 16:22:44 +0000 (12:22 -0400)] 
Fix: unchecked return value in low throughput test

Found by Coverity:

CID 1019967 (#1 of 1): Unchecked return value from library
(CHECKED_RETURN)2. check_return: Calling poll(NULL, 0UL, 60000) without
checking return value. This library function may fail and return an
error code.

We really don't care whether this poll succeeds or not.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: unchecked posix_fadvise() return value
Jérémie Galarneau [Tue, 17 May 2016 16:17:05 +0000 (12:17 -0400)] 
Fix: unchecked posix_fadvise() return value

Found by Coverity:

CID 1019971 (#1 of 1): Unchecked return value from library
(CHECKED_RETURN)2. check_return: Calling posix_fadvise(outfd,
orig_offset - stream->max_sb_size, stream->max_sb_size, 4) without
checking return value. This library function may fail and return an
error code.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: unchecked return value in relayd live.c
Mathieu Desnoyers [Tue, 17 May 2016 16:13:13 +0000 (12:13 -0400)] 
Fix: unchecked return value in relayd live.c

CID 1323137 (#1 of 1): Unchecked return value (CHECKED_RETURN)30.
check_return: Calling viewer_stream_get without checking return value
(as is done elsewhere 5 out of 6 times).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: unchecked return value in trace_clock_read64_monotonic
Mathieu Desnoyers [Tue, 17 May 2016 16:06:45 +0000 (12:06 -0400)] 
Fix: unchecked return value in trace_clock_read64_monotonic

Found by Coverity:

CID 1311498 (#1 of 1): Unchecked return value (CHECKED_RETURN)1.
check_return: Calling clock_gettime without checking return value (as is
done elsewhere 8 out of 9 times).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: initialize the cur_event variable before using it
Jonathan Rajotte [Tue, 17 May 2016 15:52:47 +0000 (11:52 -0400)] 
Fix: initialize the cur_event variable before using it

CID 1243041 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized element of array *cur_event.name when
calling strcmp.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: NULL pointer dereference in relay_index_get_by_id_or_create
Mathieu Desnoyers [Tue, 17 May 2016 14:44:25 +0000 (10:44 -0400)] 
Fix: NULL pointer dereference in relay_index_get_by_id_or_create

Found by Coverity:

CID 1323134 (#1 of 1): Dereference after null check (FORWARD_NULL)34.
var_deref_op: Dereferencing null pointer index.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Deference after null check in sessiond set_option
Jérémie Galarneau [Wed, 18 May 2016 17:20:08 +0000 (13:20 -0400)] 
Fix: Deference after null check in sessiond set_option

Found by Coverity:

2. var_compare_op: Comparing arg to null implies that arg might be null.

CID 1256137 (#1 of 9): Dereference after null check (FORWARD_NULL)14.
var_deref_model: Passing null pointer arg to strdup, which dereferences
it.

[... same for #2 through #9 ]

This should not really be an issue since
1) options that use the "arg" parameter will not be set by popt if one
   is not provided,
2) the configuration file parser will never invoke set_option with
   a NULL argument; if no "value" is provided in the file, an empty
   string is passed.

The second point is the reason for the "arg && arg[0] == '\0'" check;
we already know that the argument is invalid since an empty string
is never a valid argument for the supported options.

Nonetheless, it makes sense for Coverity to flag this and moving
the check to individual cases, although very verbose, is clear.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Wrong sizeof argument in pid tracker
Mathieu Desnoyers [Tue, 17 May 2016 13:23:50 +0000 (09:23 -0400)] 
Fix: Wrong sizeof argument in pid tracker

Found by Coverity:

CID 1292557 (#1 of 1): Wrong sizeof argument
(SIZEOF_MISMATCH)suspicious_sizeof: Passing argument 8UL /* sizeof
(*_pid_list) */ to function zmalloc and then casting the return value to
int * is suspicious.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: tests: incorrect uri index
Mathieu Desnoyers [Tue, 17 May 2016 13:20:17 +0000 (09:20 -0400)] 
Fix: tests: incorrect uri index

Initial issue found by Coverity:

CID 1322864 (#1 of 1): Constant expression result
(CONSTANT_EXPRESSION_RESULT)impossible_and: The "and" condition size ==
2L && (uri + 0).dtype == LTTNG_DST_IPV4 && (uri + 0).utype ==
LTTNG_URI_DST && (uri + 0).stype == 0U && (uri + 0).port == 8989 &&
strcmp((uri + 0).subdir, "my/test/path") == 0 && strcmp((uri +
0).dst.ipv4, "127.0.0.1") == 0 && (uri + 1).dtype == LTTNG_DST_IPV4 &&
(uri + 1).utype == LTTNG_URI_DST && (uri + 1).stype == 0U && (uri +
1).port == 4242 && strcmp((uri + 0).subdir, "my/test/path") == 0 &&
strcmp((uri + 1).dst.ipv4, "127.0.0.1") == 0 can never be true because
(uri + 0).subdir cannot be equal to two different values at the same
time.

Review of the test source file led to further fixes.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Integer overflowed argument
Mathieu Desnoyers [Tue, 17 May 2016 13:11:39 +0000 (09:11 -0400)] 
Fix: Integer overflowed argument

Found by Coverity:

CID 1242317 (#1 of 2): Integer overflowed argument (INTEGER_OVERFLOW)25.
overflow_sink: Overflowed or truncated value (or a value computed from
an overflowed or truncated value) new_nbmem * 304UL used as critical
argument to function.

CID 1242317 (#2 of 2): Integer overflowed argument (INTEGER_OVERFLOW)27.
overflow_sink: Overflowed or truncated value (or a value computed from
an overflowed or truncated value) (new_nbmem - nbmem) * 304UL used as
critical argument to function.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: macro compares unsigned to 0 (no effect)
Mathieu Desnoyers [Tue, 17 May 2016 13:01:51 +0000 (09:01 -0400)] 
Fix: macro compares unsigned to 0 (no effect)

Found by Coverity:

CID 1262117 (#1 of 1): Macro compares unsigned to 0
(NO_EFFECT)unsigned_compare: This greater-than-or-equal-to-zero
comparison of an unsigned value is always true. events->nb_fd >= 0U.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Free variable before strdup() in process_event_node
Michael Jeanson [Tue, 17 May 2016 18:12:09 +0000 (14:12 -0400)] 
Fix: Free variable before strdup() in process_event_node

Fixes coverity #1243040

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Free variables before strdup()
Michael Jeanson [Tue, 17 May 2016 18:08:00 +0000 (14:08 -0400)] 
Fix: Free variables before strdup()

Fixes coverity #1243047 and #1243050

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Add missing free() in spawn_viewer
Michael Jeanson [Mon, 16 May 2016 23:33:08 +0000 (19:33 -0400)] 
Fix: Add missing free() in spawn_viewer

Fixes coverity #1291948

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Add missing free() in utils_partial_realpath
Michael Jeanson [Mon, 16 May 2016 23:27:30 +0000 (19:27 -0400)] 
Fix: Add missing free() in utils_partial_realpath

Fixes coverity #1328401

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in test_create_kernel_event
Mathieu Desnoyers [Tue, 17 May 2016 01:43:01 +0000 (21:43 -0400)] 
Fix: illegal memory access in test_create_kernel_event

Found by Coverity:
CID 1243030 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)1.
buffer_size_warning: Calling strncpy with a maximum size argument of 256
bytes on destination array ev.name of size 256 bytes might leave the
destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in send_viewer_streams
Mathieu Desnoyers [Tue, 17 May 2016 01:42:59 +0000 (21:42 -0400)] 
Fix: illegal memory access in send_viewer_streams

Found by Coverity:

CID 1243037 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)18. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array
send_stream.path_name of size 4096 bytes might leave the destination
string unterminated.

CID 1243037 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)18. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array
send_stream.channel_name of size 255 bytes might leave the destination
string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in viewer_list_sessions
Mathieu Desnoyers [Tue, 17 May 2016 01:42:58 +0000 (21:42 -0400)] 
Fix: illegal memory access in viewer_list_sessions

Found by Coverity:

CID 1243025 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)17. buffer_size_warning: Calling strncpy with a
maximum size argument of 64 bytes on destination array
send_session->hostname of size 64 bytes might leave the destination
string unterminated.

CID 1243025 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)17. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array
send_session->session_name of size 255 bytes might leave the destination
string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in relayd_add_stream
Mathieu Desnoyers [Tue, 17 May 2016 01:42:57 +0000 (21:42 -0400)] 
Fix: illegal memory access in relayd_add_stream

Found by Coverity:

CID 1243017 (#1 of 4): Buffer not null terminated
(BUFFER_SIZE_WARNING)14. buffer_size_warning: Calling strncpy with a
maximum size argument of 264 bytes on destination array msg.channel_name
of size 264 bytes might leave the destination string unterminated.

ID 1243017 (#2 of 4): Buffer not null terminated
(BUFFER_SIZE_WARNING)14. buffer_size_warning: Calling strncpy with a
maximum size argument of 264 bytes on destination array
msg_2_2.channel_name of size 264 bytes might leave the destination
string unterminated.

CID 1243017 (#3 of 4): Buffer not null terminated
(BUFFER_SIZE_WARNING)15. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array msg.pathname of
size 4096 bytes might leave the destination string unterminated.

CID 1243017 (#4 of 4): Buffer not null terminated
(BUFFER_SIZE_WARNING)15. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array
msg_2_2.pathname of size 4096 bytes might leave the destination string
unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in relayd_create_session_2_4
Mathieu Desnoyers [Tue, 17 May 2016 01:42:56 +0000 (21:42 -0400)] 
Fix: illegal memory access in relayd_create_session_2_4

Found by Coverity:
CID 1243024 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)2. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array msg.session_name
of size 255 bytes might leave the destination string unterminated.

CID 1243024 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)3. buffer_size_warning: Calling strncpy with a
maximum size argument of 64 bytes on destination array msg.hostname of
size 64 bytes might leave the destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in session_create
Mathieu Desnoyers [Tue, 17 May 2016 01:42:55 +0000 (21:42 -0400)] 
Fix: illegal memory access in session_create

Found by Coverity:

CID 1323138 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)3. buffer_size_warning: Calling strncpy with a
maximum size argument of 64 bytes on destination array session->hostname
of size 64 bytes might leave the destination string unterminated.

CID 1323138 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)3. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array
session->session_name of size 255 bytes might leave the destination
string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in consumer_set_subdir
Mathieu Desnoyers [Tue, 17 May 2016 01:42:54 +0000 (21:42 -0400)] 
Fix: illegal memory access in consumer_set_subdir

Found by Coverity:
CID 1243015 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)8. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array
consumer->subdir of size 4096 bytes might leave the destination string
unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in syscall_init_table
Mathieu Desnoyers [Tue, 17 May 2016 01:42:53 +0000 (21:42 -0400)] 
Fix: illegal memory access in syscall_init_table

Found by Coverity:
CID 1243021 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)25. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array (syscall_table +
index).name of size 255 bytes might leave the destination string
unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in write_pidfile
Mathieu Desnoyers [Tue, 17 May 2016 01:42:52 +0000 (21:42 -0400)] 
Fix: illegal memory access in write_pidfile

Found by Coverity:
CID 1243023 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)3. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array pidfile_path of
size 4096 bytes might leave the destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in list_lttng_channels
Mathieu Desnoyers [Tue, 17 May 2016 01:42:51 +0000 (21:42 -0400)] 
Fix: illegal memory access in list_lttng_channels

Found by Coverity:
CID 1243018 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)11. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array (channels +
i).name of size 256 bytes might leave the destination string
unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in cmd_snapshot_record
Mathieu Desnoyers [Tue, 17 May 2016 01:42:50 +0000 (21:42 -0400)] 
Fix: illegal memory access in cmd_snapshot_record

Found by Coverity:
CID 1243027 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)20. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array tmp_output.name
of size 255 bytes might leave the destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in output_init
Mathieu Desnoyers [Tue, 17 May 2016 01:42:49 +0000 (21:42 -0400)] 
Fix: illegal memory access in output_init

Found by Coverity:

CID 1243028 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)5. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array output->name of
size 255 bytes might leave the destination string unterminated.

CID 1243028 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)10. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array
output->consumer->dst.trace_path of size 4096 bytes might leave the
destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in consumer_set_network_uri
Mathieu Desnoyers [Tue, 17 May 2016 01:42:48 +0000 (21:42 -0400)] 
Fix: illegal memory access in consumer_set_network_uri

Found by Coverity:
CID 1243029 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)31. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array obj->subdir of
size 4096 bytes might leave the destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in cmd_snapshot_list_outputs
Mathieu Desnoyers [Tue, 17 May 2016 01:42:47 +0000 (21:42 -0400)] 
Fix: illegal memory access in cmd_snapshot_list_outputs

Found by Coverity:

CID 1243031 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)22. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array (list +
idx).ctrl_url of size 4096 bytes might leave the destination string
unterminated.

CID 1243031 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)26. buffer_size_warning: Calling strncpy with a
maximum size argument of 255 bytes on destination array (list +
idx).name of size 255 bytes might leave the destination string
unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in list_events
Mathieu Desnoyers [Tue, 17 May 2016 01:42:46 +0000 (21:42 -0400)] 
Fix: illegal memory access in list_events

Found by Coverity:
CID 1243022 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)23. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array (tmp_events +
i).name of size 256 bytes might leave the destination string
unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in disable_event
Mathieu Desnoyers [Tue, 17 May 2016 01:42:45 +0000 (21:42 -0400)] 
Fix: illegal memory access in disable_event

Found by Coverity:
CID 1243016 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)14. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array msg.name of size
256 bytes might leave the destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in add_uri_to_consumer
Mathieu Desnoyers [Tue, 17 May 2016 01:42:43 +0000 (21:42 -0400)] 
Fix: illegal memory access in add_uri_to_consumer

Found by Coverity:

CID 1243038 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)15. buffer_size_warning: Calling strncpy with a
maximum size argument of 4096 bytes on destination array
consumer->dst.trace_path of size 4096 bytes might leave the destination
string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in init_ust_event_from_agent_event
Mathieu Desnoyers [Tue, 17 May 2016 01:42:42 +0000 (21:42 -0400)] 
Fix: illegal memory access in init_ust_event_from_agent_event

Found by Coverity:
CID 1321741 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)1. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array
ust_event->attr.name of size 256 bytes might leave the destination
string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: illegal memory access in _cmd_enable_event
Mathieu Desnoyers [Tue, 17 May 2016 01:42:41 +0000 (21:42 -0400)] 
Fix: illegal memory access in _cmd_enable_event

Found by Coverity:

CID 1321742 (#1 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)21. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array attr->name of
size 256 bytes might leave the destination string unterminated.

CID 1321742 (#2 of 2): Buffer not null terminated
(BUFFER_SIZE_WARNING)22. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array attr->name of
size 256 bytes might leave the destination string unterminated.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoImplement lttng_strncpy safe string copy
Mathieu Desnoyers [Tue, 17 May 2016 01:42:40 +0000 (21:42 -0400)] 
Implement lttng_strncpy safe string copy

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: loading a session prints an error message but the load is successful
Jérémie Galarneau [Mon, 16 May 2016 16:10:19 +0000 (12:10 -0400)] 
Fix: loading a session prints an error message but the load is successful

Fixes #1013

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoSnapshot warning if there are no events in one of the domains
Jérémie Galarneau [Mon, 16 May 2016 05:20:47 +0000 (01:20 -0400)] 
Snapshot warning if there are no events in one of the domains

Remove the "no data" check from the UST snapshot code since

1) It would report that no data was recorded in the snapshot even
   if the kernel tracer had recorded events,
2) The kernel consumer does not seem to report such a condition,
   making it hard to perform the check without modifying the
   consumer.

The consumer interfaces could be modified to reliably provide
this information in the future.

However, this warning is not provided in the other tracing
modes, making its usefulness questionable. An empty snapshot is
still a valid trace and users should not always expect a trace
to contain events. Moreover, "warning" that no data was produced
implies an error may have occured and is probably as confusing
as opening an empty trace to the average user.

Fixes #1012

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoSnapshot: record: use same datetime for snapshot folder output
Jonathan Rajotte [Fri, 13 Nov 2015 15:36:47 +0000 (10:36 -0500)] 
Snapshot: record: use same datetime for snapshot folder output

Make sure that the ust snapshot is put under the same folder as the
kernel snapshot.

Fixes #970

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoRefactor: move the snapshot type check into output type check
Jonathan Rajotte [Fri, 13 Nov 2015 15:30:01 +0000 (10:30 -0500)] 
Refactor: move the snapshot type check into output type check

Since for both sub-session type the boilerplate is the same
simply move the check for sub-session type presence to the inner
check of type output.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoconfigure.ac: check for an existing liburcu-cds symbol
Philippe Proulx [Tue, 10 May 2016 20:00:28 +0000 (16:00 -0400)] 
configure.ac: check for an existing liburcu-cds symbol

Fixes #1001

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoconfigure.ac: use macro for wrong liburcu error message
Philippe Proulx [Tue, 10 May 2016 19:51:17 +0000 (15:51 -0400)] 
configure.ac: use macro for wrong liburcu error message

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: wording of trace_matches is misleading
Jérémie Galarneau [Sat, 14 May 2016 20:27:20 +0000 (16:27 -0400)] 
Tests: wording of trace_matches is misleading

trace_matches reports a number of "events found" in a trace while it
actually counts the number of event_name matches.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTypo: catched -> caught
Michael Jeanson [Tue, 19 Apr 2016 20:34:55 +0000 (16:34 -0400)] 
Typo: catched -> caught

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.7.2 v2.7.2
Jérémie Galarneau [Tue, 19 Apr 2016 18:21:37 +0000 (14:21 -0400)] 
Update version to v2.7.2

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoClean-up shm directory tree after freeing the channel
Jonathan Rajotte [Thu, 17 Mar 2016 20:18:14 +0000 (16:18 -0400)] 
Clean-up shm directory tree after freeing the channel

On NFS, an unlinked file that is still mmaped or unclosed is kept
around by creating a .nfsXXXX file since it may still be in use. [1]

This prevents the effective cleanup of the shm tree directory because
it happens before the userspace consumer shm handles table
cleanup. [2]

Moving the tree removal to lttng_ustconsumer_free_channel ensures that
the cleanup is done when the files are completely closed/unmapped.

[1] http://nfs.sourceforge.net/ Look for "silly rename"
[2] See channel_free subcall to shm_object_table_destroy

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest: Add the lttng-runas worker process to the sessiond pids
Jérémie Galarneau [Thu, 10 Mar 2016 19:23:28 +0000 (14:23 -0500)] 
Test: Add the lttng-runas worker process to the sessiond pids

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoLimit the scope of IFS overwriting
Jonathan Rajotte [Thu, 8 Oct 2015 18:01:40 +0000 (14:01 -0400)] 
Limit the scope of IFS overwriting

The overwrite caused a folder ' ' to be created locally when running root tests.
Use while loop to preserve space in invalid filter string.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoDo not overwrite IFS globally but only locally
Jonathan Rajotte [Tue, 6 Oct 2015 19:41:41 +0000 (15:41 -0400)] 
Do not overwrite IFS globally but only locally

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: tests: use SIGSTOP for crash extraction test
Mathieu Desnoyers [Thu, 10 Mar 2016 16:13:37 +0000 (11:13 -0500)] 
Fix: tests: use SIGSTOP for crash extraction test

Ensure that SIGKILL being received only by some consumer processes don't
trigger clean shutdown of other consumer processes (due to hang up of
communication FD by the session daemon).

Fix this by invoking a SIGSTOP on both sessiond and consumerd, and wait
until we see those process state change to "stopped" before proceeding
to send the SIGKILL.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
CC: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Only save kernel enablers in session configuration
Jérémie Galarneau [Tue, 8 Mar 2016 17:08:12 +0000 (12:08 -0500)] 
Fix: Only save kernel enablers in session configuration

The session configuration serialization currently saves the
kernel enablers along with all enabled syscalls. In the case
where a syscall would be enabled with a given filter, this would
result in two events being enabled:

1) the syscall with its filter expression (the enabler)
2) the syscall on its own (an enabled syscall)

The observable effect of this is that the syscall ends up being
traced regardless of the filter's evaluation.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Only list kernel enablers when listing events
Jérémie Galarneau [Tue, 8 Mar 2016 17:06:14 +0000 (12:06 -0500)] 
Fix: Only list kernel enablers when listing events

lttng list would list kernel enablers and individual enabled
syscalls which would result in a confusing output.

For instance, enabling the "open" syscall with a filter would
result in a list output displaying both the enabler,
the syscall's name + its filter, and the syscall on its own,
without any mention of an enabled filter.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: syscalls hash table leaks when listing kernel events
Jérémie Galarneau [Tue, 8 Mar 2016 16:11:33 +0000 (11:11 -0500)] 
Fix: syscalls hash table leaks when listing kernel events

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