lttng-tools.git
11 years agoFix: typo when closing the consumer client socket
David Goulet [Tue, 28 May 2013 18:50:21 +0000 (14:50 -0400)] 
Fix: typo when closing the consumer client socket

Issue 1019917 of covertiry scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Add multi session per UID with 5 app in streaming mode
David Goulet [Thu, 23 May 2013 15:03:42 +0000 (11:03 -0400)] 
Tests: Add multi session per UID with 5 app in streaming mode

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Add stress test for multi session per UID
David Goulet [Wed, 22 May 2013 19:17:17 +0000 (15:17 -0400)] 
Tests: Add stress test for multi session per UID

For this test, 10 applications are used with 5 sessions set with per UID
buffers.

A helper script is also added which launch applications with given
parameters. A README file is also present to help developers/users use
the stress tests correctly.

Stress tests save the stderr/stdout of the session daemon in a log file
and core dump created using the name found in core_pattern (in /proc).

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: get consumer lock before closing/pushing metadata
David Goulet [Tue, 28 May 2013 18:25:27 +0000 (14:25 -0400)] 
Fix: get consumer lock before closing/pushing metadata

This is to ensure the validity of the metadata stream in the channel
before closing or pushing the metadata on it.

Fixes #536

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: set channel key to message on notify channel
David Goulet [Tue, 28 May 2013 17:06:38 +0000 (13:06 -0400)] 
Fix: set channel key to message on notify channel

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: increment channel refcount on add_stream
Julien Desfossez [Thu, 23 May 2013 23:07:20 +0000 (19:07 -0400)] 
Fix: increment channel refcount on add_stream

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: error handling in kernel add_channel
Julien Desfossez [Thu, 23 May 2013 21:07:08 +0000 (17:07 -0400)] 
Fix: error handling in kernel add_channel

consumer_add_channel can return an error, it needs to be handled. Also,
init_kernel_tracing returns a positive lttng_error_code on error, so the
check in start_kernel_session needs to be for ret != 0.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: close wait_fd on kernel tracing
Julien Desfossez [Thu, 23 May 2013 20:13:35 +0000 (16:13 -0400)] 
Fix: close wait_fd on kernel tracing

The wait_fd in the kernel consumer streams was not closed causing a leak
of FDs in the consumer and never triggering the teardown mechanism in
the kernel tracer. This applies for metadata and data stream.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Fix possible segfault in health check thread exit test
Christian Babeux [Wed, 22 May 2013 20:29:33 +0000 (16:29 -0400)] 
Tests: Fix possible segfault in health check thread exit test

The testpoints in the thread_manage_clients and thread_manage_apps are
called after a rcu_register_thread() call. The testpoints were not
unregistering their respective thread which could later on cause a
segfault when shutting down the session daemon.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: use lttng pipe to send new stream to thread
David Goulet [Tue, 14 May 2013 17:51:07 +0000 (13:51 -0400)] 
Fix: use lttng pipe to send new stream to thread

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoChange consumer_metadata_pipe to be a lttng_pipe
David Goulet [Tue, 14 May 2013 15:27:26 +0000 (11:27 -0400)] 
Change consumer_metadata_pipe to be a lttng_pipe

The read() call in the metadata thread is also changed to use the lttng
pipe read wrapper.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoChange consumer_data_pipe to be a lttng_pipe
David Goulet [Tue, 14 May 2013 15:00:22 +0000 (11:00 -0400)] 
Change consumer_data_pipe to be a lttng_pipe

Also, an important change here is that this pipe is no longer in non
block mode. Before sending stream's pointer over this pipe, only one
byte was written thus making it unlikely to fail in a read/write race
condition between threads. Now, 4 bytes are written so keeping this pipe
non block with threads is a bit of a "looking for trouble situation".

The lttng pipe wrappers make sure that the read and write side are
synchronized between threads using a mutex for each side. Furthermore,
the read and write handle partial I/O and EINTR meaning that once the
call returns we are sure that either everything was read/written or an
error occured thus making it not possible for the read side to block
indefinitely after a poll event.

Fixes #475

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd wrappers for pipe
David Goulet [Fri, 10 May 2013 16:02:37 +0000 (12:02 -0400)] 
Add wrappers for pipe

This is to help use pipes in a way where partial read/write and EINTR
are handled in one single call site.

Two new files are created, pipe.c/.h which are part of libcommon. The
open, close, read_close, write_close, read and write calls are
implemented using a custom lttng_pipe data structure and protected by
operation's mutex. A destroy function is also available to cleanup
memory once done with a pipe.

The motivation behind this patch is for some upcoming fixes that deals
with a race condition between read and write on a pipe in the consumer.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: increment UST channel refcount at stream creation
David Goulet [Fri, 17 May 2013 18:08:14 +0000 (14:08 -0400)] 
Fix: increment UST channel refcount at stream creation

Having the channel refcount incremented only when the stream is sent to a
thread could triggered a segfault with a race between a channel destroyed by
the channel thread and the stream pointers being inflight in the thread pipe.

Once read from the pipe, the streams are added to the data thread poll set and
immediately destroyed since the channel has hung up previously but the flush
buffer segfaulted on the channel that was already deleted by the channel thread
with a refcount set to 0.

This is fixed by incrementing the channel refcount once the stream is created
and the channel reference is set to it. This is done *before* the channel
object is visible in the channel thread. Now the channel thread detects the
hang up but will not destroy the channel because of the refcount > 0. The
channel cleanup will be done by the last stream hanging up.

Fixes #530

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: update tracer version in lttng-sessiond.8 and lttng.1
David Goulet [Fri, 17 May 2013 15:29:34 +0000 (11:29 -0400)] 
Fix: update tracer version in lttng-sessiond.8 and lttng.1

Fixes #535

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: use memset instead of poll reset for poll init
David Goulet [Thu, 16 May 2013 19:02:15 +0000 (15:02 -0400)] 
Fix: use memset instead of poll reset for poll init

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoUpdate README
David Goulet [Thu, 16 May 2013 15:44:24 +0000 (11:44 -0400)] 
Update README

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: epoll attributes used outside of compat layer
David Goulet [Thu, 16 May 2013 15:30:15 +0000 (11:30 -0400)] 
Fix: epoll attributes used outside of compat layer

This was breaking the poll() support. A lttng_poll_init is added which
basically resets the lttng poll event data structure and in the case of
epoll sets the epfd to -1.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Remove temporary trace directory on bail-out
Jérémie Galarneau [Wed, 15 May 2013 19:21:13 +0000 (15:21 -0400)] 
Tests: Remove temporary trace directory on bail-out

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Fix the number of tests in test_tracefile_count
Christian Babeux [Wed, 15 May 2013 18:04:10 +0000 (14:04 -0400)] 
Tests: Fix the number of tests in test_tracefile_count

The number of planned tests is dependent on the number of streams (1 per
cpu).

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Add the tracefile size test
Christian Babeux [Tue, 14 May 2013 21:53:47 +0000 (17:53 -0400)] 
Tests: Add the tracefile size test

This test validate the newly introduced tracefile count feature.  In
order to so, we enable a channel with the appropriate file size limits.

After running an instrumented application, we validate that each file in
the trace folder is no larger than the limit set on the command line and
also that some events are present (it's possible that the tracer discard
events, so we can't validate on a fixed number of events in the
resulting trace).

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Add the tracefile count test
Christian Babeux [Tue, 14 May 2013 21:53:46 +0000 (17:53 -0400)] 
Tests: Add the tracefile count test

This test validate the newly introduced tracefile count feature.  In
order to so, we enable a channel with the appropriate limits in
overwrite mode. The later constraint is to ensure that at least the last
few events are properly recorded and that we can validate that they are
present in the resulting trace (with the help of babeltrace and
babelstats).

We also validate that the tracefile count (per stream) in the trace
folder is conform to the one passed on the command line.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Move the babelstats utility to tests/utils
Christian Babeux [Tue, 14 May 2013 21:53:45 +0000 (17:53 -0400)] 
Tests: Move the babelstats utility to tests/utils

This utility will prove useful in trace validation for other tests, so
put it in a common location accessible by the tests.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Read from pointer after free in unit tests
David Goulet [Tue, 14 May 2013 17:22:27 +0000 (13:22 -0400)] 
Fix: Read from pointer after free in unit tests

Issue 1019886 and 1019887 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Read from pointer after free
David Goulet [Tue, 14 May 2013 17:13:53 +0000 (13:13 -0400)] 
Fix: Read from pointer after free

Also, a fd leak is fixed in an error path in the same thread.

Issue 1019889 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Uninitialized scalar variable in consumer
David Goulet [Tue, 14 May 2013 16:54:46 +0000 (12:54 -0400)] 
Fix: Uninitialized scalar variable in consumer

In notify_channel_pipe: Use of an uninitialized variable (CWE-457).

Issue 1019894 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Uninitialized pointer read
David Goulet [Tue, 14 May 2013 16:52:32 +0000 (12:52 -0400)] 
Fix: Uninitialized pointer read

The lttng poll clean call is slightly changed to handle negative epoll
fd so we don't close anything blindly creating perror() outputs for
nothing.

Issue 1019895 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: fd leak in process client msg error path
David Goulet [Tue, 14 May 2013 16:41:49 +0000 (12:41 -0400)] 
Fix: fd leak in process client msg error path

The process_client_msg() function could return an error but no
sock_error. In any case, we have to close the socket since a TODO is
still there indicating that we need to reply to the client to inform of
the error.

Issue 1019920 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: memory leak in UST unit test
David Goulet [Tue, 14 May 2013 16:38:10 +0000 (12:38 -0400)] 
Fix: memory leak in UST unit test

Issue 1019913 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: memory leak in URI unit test
David Goulet [Tue, 14 May 2013 16:35:25 +0000 (12:35 -0400)] 
Fix: memory leak in URI unit test

Issue 1019914 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: close fd on create unix sock error path
David Goulet [Tue, 14 May 2013 16:33:15 +0000 (12:33 -0400)] 
Fix: close fd on create unix sock error path

Issue 1019915 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: memory leak in error path in UST registry
David Goulet [Tue, 14 May 2013 16:25:26 +0000 (12:25 -0400)] 
Fix: memory leak in error path in UST registry

Issue 1019919 and 1019918 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: memory leak in sessiond command in error path
David Goulet [Tue, 14 May 2013 16:14:35 +0000 (12:14 -0400)] 
Fix: memory leak in sessiond command in error path

Issue 1019921 of coverity scan.

More leaks were found of the same type also.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: kernel metadata data leak in error path
David Goulet [Tue, 14 May 2013 16:11:03 +0000 (12:11 -0400)] 
Fix: kernel metadata data leak in error path

Issue 1019922 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: data leak in error path of cmd_register_consumer()
David Goulet [Tue, 14 May 2013 16:07:00 +0000 (12:07 -0400)] 
Fix: data leak in error path of cmd_register_consumer()

Issue 1019923 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: out of bounds access of kernel channel padding
David Goulet [Tue, 14 May 2013 15:59:23 +0000 (11:59 -0400)] 
Fix: out of bounds access of kernel channel padding

The padding of the old ABI is bigger than the new one so we use the size
of the new padding size for the memcpy since it will always be smaller.

In kernctl_create_channel: Out-of-bounds access to a buffer (CWE-119).
In kernctl_open_metadata: Out-of-bounds access to a buffer (CWE-119).

Issue 1019925 and 1019924 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: out of bounds access to buffer uuid
David Goulet [Tue, 14 May 2013 15:42:06 +0000 (11:42 -0400)] 
Fix: out of bounds access to buffer uuid

In ask_channel_creation: Out-of-bounds access to a buffer (CWE-119)

Issue 1019926 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: possible out of bounds write in enable-event
David Goulet [Tue, 14 May 2013 15:34:51 +0000 (11:34 -0400)] 
Fix: possible out of bounds write in enable-event

In loglevel_str_to_value: Out-of-bounds write to a buffer (CWE-119).

Issue 1019927 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Replace usage of gen-ust-events testapp in ust metadata-flush test
Christian Babeux [Mon, 13 May 2013 22:30:56 +0000 (18:30 -0400)] 
Tests: Replace usage of gen-ust-events testapp in ust metadata-flush test

Use the gen-ust-events binary found under
tests/utils/testapp/gen-ust-events/.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Replace usage of gen-ust-events testapp in ust nprocesses test
Christian Babeux [Mon, 13 May 2013 22:30:55 +0000 (18:30 -0400)] 
Tests: Replace usage of gen-ust-events testapp in ust nprocesses test

Use the gen-ust-events binary found under
tests/utils/testapp/gen-ust-events/.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Replace usage of gen-ust-events testapp in ust buffers-uid test
Christian Babeux [Mon, 13 May 2013 22:30:54 +0000 (18:30 -0400)] 
Tests: Replace usage of gen-ust-events testapp in ust buffers-uid test

Use the gen-ust-events binary found under
tests/utils/testapp/gen-ust-events/.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Replace usage of gen-ust-events testapp in ust before-after test
Christian Babeux [Mon, 13 May 2013 22:30:53 +0000 (18:30 -0400)] 
Tests: Replace usage of gen-ust-events testapp in ust before-after test

Use the gen-ust-events binary found under
tests/utils/testapp/gen-ust-events/.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Replace usage of gen-ust-events testapp in streaming tests
Christian Babeux [Mon, 13 May 2013 22:30:52 +0000 (18:30 -0400)] 
Tests: Replace usage of gen-ust-events testapp in streaming tests

Use the gen-ust-events binary found under
tests/utils/testapp/gen-ust-events/.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Cleanup and move gen-ust-events testapp under utils
Christian Babeux [Mon, 13 May 2013 22:30:51 +0000 (18:30 -0400)] 
Tests: Cleanup and move gen-ust-events testapp under utils

This will improve the maintainability and stop the copying madness going
on in each test needing a UST sample application.

Application under test should go in tests/utils/testapp/<testapp_name>/.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Remove unused utils.h header
Christian Babeux [Mon, 13 May 2013 21:51:03 +0000 (17:51 -0400)] 
Tests: Remove unused utils.h header

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd --version command-line option to lttng.
Stefan Seefeld [Sat, 11 May 2013 12:50:37 +0000 (08:50 -0400)] 
Add --version command-line option to lttng.

Signed-off-by: Stefan Seefeld <stefan@codesourcery.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd --with-lttng-ust-prefix config option.
Stefan Seefeld [Sat, 11 May 2013 12:50:36 +0000 (08:50 -0400)] 
Add --with-lttng-ust-prefix config option.

Signed-off-by: Stefan Seefeld <stefan@codesourcery.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: check channel subbuf size against page size
David Goulet [Fri, 10 May 2013 17:27:30 +0000 (13:27 -0400)] 
Fix: check channel subbuf size against page size

Don't validate channel subbuffer size against the default values but
rather against the lower bound being the page size taken at runtime.

Reported-by: Tan Dung Le Tran <tan.dung.le.tran@ericsson.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: print an error if tracefile-size is missing with count
David Goulet [Thu, 9 May 2013 15:54:20 +0000 (11:54 -0400)] 
Fix: print an error if tracefile-size is missing with count

The command will also stop and inform the user that an option is
missing.

Reported-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoUpdate version to v2.2.0-rc2 v2.2.0-rc2
David Goulet [Thu, 9 May 2013 14:05:44 +0000 (10:05 -0400)] 
Update version to v2.2.0-rc2

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: split UST per UID/PID default values
David Goulet [Tue, 7 May 2013 15:54:41 +0000 (11:54 -0400)] 
Fix: split UST per UID/PID default values

The default per UID subbuffer size are changed from 4096 bytes to 131072
bytes (128k). The rest have the same values as before.

Some DEFAULT_CHANNEL_* macros are prefixed with an underscore making
sure they are not used elsewhere in the code base and only domain
specific values are used.

Fixes #524

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: don't start the relayd with a wrong --output dir
David Goulet [Mon, 6 May 2013 18:41:17 +0000 (14:41 -0400)] 
Fix: don't start the relayd with a wrong --output dir

The -o, --output option never supported a relative path but still the
relayd was able to start.

This makes sure the relayd does not start without an absolute pathname.
The help and man are also updated to document this behavior.

Ticket #523 has been opened as a feature request to support relative
path.

Fixes #481

Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Erroneous automatic session name when streaming
David Goulet [Mon, 6 May 2013 16:34:57 +0000 (12:34 -0400)] 
Fix: Erroneous automatic session name when streaming

Fixes #460

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: wrong data port when listing session's URI
David Goulet [Mon, 6 May 2013 16:06:52 +0000 (12:06 -0400)] 
Fix: wrong data port when listing session's URI

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: don't create a channel on an enable channel
David Goulet [Mon, 6 May 2013 15:53:02 +0000 (11:53 -0400)] 
Fix: don't create a channel on an enable channel

Fixes #465

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoTests: Add missing test_utils_parse_size_suffix to unit tests
Christian Babeux [Mon, 6 May 2013 15:32:07 +0000 (11:32 -0400)] 
Tests: Add missing test_utils_parse_size_suffix to unit tests

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: print lttng strerror on enable event with filter
David Goulet [Mon, 6 May 2013 15:31:49 +0000 (11:31 -0400)] 
Fix: print lttng strerror on enable event with filter

Fixes #516

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: change relayd protocol version to 2.2
David Goulet [Mon, 6 May 2013 15:21:27 +0000 (11:21 -0400)] 
Fix: change relayd protocol version to 2.2

Without the 2.2 protocol, the tracefile size/count can't be used for
network streaming. This should have been done at the rc1 release.

Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: reset current size for tracefile rotation
David Goulet [Mon, 6 May 2013 15:04:21 +0000 (11:04 -0400)] 
Fix: reset current size for tracefile rotation

Fixes #514

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: remove extra -I for python bindings
David Goulet [Fri, 3 May 2013 15:16:32 +0000 (11:16 -0400)] 
Fix: remove extra -I for python bindings

Fixes #517

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agolttng UI: round up trace file size to subbuf size if needed
Mathieu Desnoyers [Thu, 2 May 2013 17:48:48 +0000 (13:48 -0400)] 
lttng UI: round up trace file size to subbuf size if needed

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix lttng UI: fix arg parsing, round size to next power of two
Mathieu Desnoyers [Thu, 2 May 2013 15:58:37 +0000 (11:58 -0400)] 
Fix lttng UI: fix arg parsing, round size to next power of two

Also:
- don't accept negative values,
- don't accept 0 values where it's not allowed,
- fix tracefile size option: it was parsing the previous argument.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: check errors in lttng command argument values
Mathieu Desnoyers [Thu, 2 May 2013 15:53:08 +0000 (11:53 -0400)] 
Fix: check errors in lttng command argument values

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement get_count_order in lttng utils
Mathieu Desnoyers [Thu, 2 May 2013 15:33:46 +0000 (11:33 -0400)] 
Implement get_count_order in lttng utils

Imported from Userspace RCU rculfhash.c.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agolttng cli: Accept human readable sizes for --subbuf-size
Simon Marchi [Fri, 12 Apr 2013 21:15:12 +0000 (17:15 -0400)] 
lttng cli: Accept human readable sizes for --subbuf-size

--subbuf-size accepts sizes such as:

- 123 -> 123
- 123k -> 123 * 1024
- 123M -> 123 * 1024^2
- 123G -> 123 * 1024^3

It uses the new parse_size_suffix function, which could probably be used
at other places, such as tracefile size.

Unit tests are included.

Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoUnit tests: don't rebuild units under test
Simon Marchi [Mon, 8 Apr 2013 15:20:04 +0000 (11:20 -0400)] 
Unit tests: don't rebuild units under test

Only the tests themselves are built in the unit test folder. They reuse
the object files that are already built during the main compilation
pass. This would fix the conflicts between object names.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: consumerd metadata channel/cache/timer races
Mathieu Desnoyers [Wed, 1 May 2013 20:52:59 +0000 (16:52 -0400)] 
Fix: consumerd metadata channel/cache/timer races

There were various races with the way metadata was handled for UST. Fix
this by:

- Ensuring that metadata cache is destroyed only when the metadata
  channel is destroyed (it is already protected by refcounting).
- Ensuring that close_metadata() command (issued by sessiond) just
  closes the stream wakeup_fd, and let the metadata management thread
  (which has ownership of the metadata stream) perform the teardown.
- Ensure that switch timer, for metadata, is always stopped before any
  of the metadata stream or channel teardown is done.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: consumerd channel destroy race
Mathieu Desnoyers [Wed, 1 May 2013 20:50:55 +0000 (16:50 -0400)] 
Fix: consumerd channel destroy race

The LTTNG_CONSUMER_DESTROY_CHANNEL command is used to handle errors. It
should not call destroy_channel(), because at that point the channel
management thread has ownership of the channel. Send a notification to
the channel management thread asking it to destroy the channel instead.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup: document RCU read-side lock better
Mathieu Desnoyers [Wed, 1 May 2013 20:46:41 +0000 (16:46 -0400)] 
Cleanup: document RCU read-side lock better

Eventually we will have to move rcu read-side lock within the callees,
but let's at least make the current code consistent.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoconsumer relayd interaction: fix segfaults
Mathieu Desnoyers [Wed, 1 May 2013 20:43:37 +0000 (16:43 -0400)] 
consumer relayd interaction: fix segfaults

State where control socket is unset but data socket is set for a relayd
socket pair can be reached if relayd suddently disconnects at the wrong
time. Ensure we always verify that the file descriptors and operations
are initialized before using them.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: change order of fd get to fix error path
David Goulet [Tue, 30 Apr 2013 19:32:31 +0000 (15:32 -0400)] 
Fix: change order of fd get to fix error path

Last commit had a wrong error path that could lead to an unbalanced fd
put/get.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: fd leak when creating UST metadata channel
David Goulet [Tue, 30 Apr 2013 19:23:56 +0000 (15:23 -0400)] 
Fix: fd leak when creating UST metadata channel

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: fd leak on error
Mathieu Desnoyers [Tue, 30 Apr 2013 14:26:11 +0000 (10:26 -0400)] 
Fix: fd leak on error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix consumerd fd leak
Mathieu Desnoyers [Tue, 30 Apr 2013 14:25:21 +0000 (10:25 -0400)] 
Fix consumerd fd leak

Refcount is only incremented and owned by thread management for streams,
not metadata.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix RCU-related hangs: incorrect lttng_ht_destroy use
Mathieu Desnoyers [Tue, 30 Apr 2013 03:03:44 +0000 (23:03 -0400)] 
Fix RCU-related hangs: incorrect lttng_ht_destroy use

lttng_ht_destroy() should *NOT* be called with rcu_read_lock() held. It
can cause hangs.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agorculfhash: check for callers from RCU read-side C.S.
Mathieu Desnoyers [Tue, 30 Apr 2013 01:38:32 +0000 (21:38 -0400)] 
rculfhash: check for callers from RCU read-side C.S.

This is an error.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't call hash table destroy under rcu read-side c.s.
Mathieu Desnoyers [Tue, 30 Apr 2013 01:25:39 +0000 (21:25 -0400)] 
Fix: don't call hash table destroy under rcu read-side c.s.

Fix
src/bin/lttng-sessiond/ust-registry.c:ust_registry_channel_del_free().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoDocumentation: import updated comments from urcu
Mathieu Desnoyers [Tue, 30 Apr 2013 00:58:49 +0000 (20:58 -0400)] 
Documentation: import updated comments from urcu

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: segfault in buffer_reg_channel_destroy()
Mathieu Desnoyers [Mon, 29 Apr 2013 21:13:56 +0000 (17:13 -0400)] 
Fix: segfault in buffer_reg_channel_destroy()

Can be called with NULL pointer, which trigger segfault on ERR() which
try to dereference it.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: add missing goto error in UST consumer
David Goulet [Mon, 29 Apr 2013 21:58:51 +0000 (17:58 -0400)] 
Fix: add missing goto error in UST consumer

On error, a channel set to NULL can be used causing a segfault when
receiving the metadata.

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: no need to use run_as_open in the relayd
David Goulet [Mon, 29 Apr 2013 17:08:36 +0000 (13:08 -0400)] 
Fix: no need to use run_as_open in the relayd

The utils create stream file function is changed to handle uid and gid
set to -1 meaning that it now does not use the run_as_open() call which
is costly in performance and will instead use open().

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: typo in enable-channel man and help
David Goulet [Mon, 29 Apr 2013 16:58:19 +0000 (12:58 -0400)] 
Fix: typo in enable-channel man and help

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: add some missing hidden attribute
David Goulet [Mon, 29 Apr 2013 16:54:48 +0000 (12:54 -0400)] 
Fix: add some missing hidden attribute

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: per-uid buffers should only be flushed once on stop
Mathieu Desnoyers [Mon, 29 Apr 2013 16:50:06 +0000 (12:50 -0400)] 
Fix: per-uid buffers should only be flushed once on stop

They were flushed once per application previously, causing workload with many
applications to trigger too many flush on stop, which in turn caused buffer
padding bloat.

* The pseudo-code for stop behavior on per-uid buffers was:

flush session's buffers
for each application:
  - stop tracing
  - wait quiescent
  - flush buffers
  - push metadata

Now doing, for per-uid buffers:

for each application:
  - stop tracing
  - wait quiescent
  - push metadata
flush session's buffers

* And for per-pid buffers:

Previously:

for each application:
  - stop tracing
  - wait quiescent
  - flush buffers
  - push metadata

Now:

for each application:
  - stop tracing
  - wait quiescent
  - push metadata
for each application:
  - flush buffers

Fixes #497

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoCleanup: Use own mutex within timer setup/teardown
Mathieu Desnoyers [Fri, 26 Apr 2013 15:02:54 +0000 (11:02 -0400)] 
Cleanup: Use own mutex within timer setup/teardown

More robust than relying on single-caller-thread assumptions.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: channel management thread should hold a refcount
Mathieu Desnoyers [Fri, 26 Apr 2013 14:27:51 +0000 (10:27 -0400)] 
Fix: channel management thread should hold a refcount

In order to handle teardown caused by relayd being unresponsive, we need
to ensure that we correctly handle that the streams can be cleaned up
before the channel wakeup pipe gets closed. We achieve this by making
the channel management thread hold a refcount on the channel object, so
it only gets destroyed when all streams, _and_ the channel management
thread, have released their reference.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: move metadata cache setup before ownership passing
Mathieu Desnoyers [Fri, 26 Apr 2013 14:24:14 +0000 (10:24 -0400)] 
Fix: move metadata cache setup before ownership passing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: consumer metadata switch timer error handling
Mathieu Desnoyers [Thu, 25 Apr 2013 18:45:17 +0000 (14:45 -0400)] 
Fix: consumer metadata switch timer error handling

The thread handling the metadata switch cannot call
consumer_timer_switch_stop(), because it would become stucked waiting
for itself to execute the teardown signal handler.

Moreover, only one thread is allowed to call start/stop timer (by
design). Therefore, it's a race to have the thread handling the timer
handler calling "stop".

Fix this by adding a "switch_timer_error" flag, which just inhibits the
timer if an error is encountered, but does not modify its state
otherwise.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: set ptr to NULL to suppress old gcc warnings
David Goulet [Mon, 22 Apr 2013 19:04:37 +0000 (15:04 -0400)] 
Fix: set ptr to NULL to suppress old gcc warnings

This has been seen with gcc 4.4.5 on a 32 bit machine.

consumer.c: In function ‘consumer_add_relayd_socket’:
consumer.c:3002: warning: ‘relayd’ may be used uninitialized in this
function

However, the relayd pointer can not be used uninitialized so this patch
suppresses the warning.

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: linking order of libraries
David Goulet [Mon, 22 Apr 2013 18:54:25 +0000 (14:54 -0400)] 
Fix: linking order of libraries

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: multiple type mismatch in debug statement
David Goulet [Mon, 22 Apr 2013 17:32:47 +0000 (13:32 -0400)] 
Fix: multiple type mismatch in debug statement

This removes all the type mismatch warnings for x86 architecture.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: remove mention of trace directory layout in quickstart doc
David Goulet [Fri, 19 Apr 2013 16:15:51 +0000 (12:15 -0400)] 
Fix: remove mention of trace directory layout in quickstart doc

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: remove unused path variables from session obj
David Goulet [Fri, 12 Apr 2013 15:13:42 +0000 (11:13 -0400)] 
Fix: remove unused path variables from session obj

Furthermore, this patch also removes useless '/' in the stream path
which was creating duplicates in the trace file path.

Fixes #496

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: update lttng.1 man and enable-channel help with read timer size
David Goulet [Fri, 12 Apr 2013 14:27:59 +0000 (10:27 -0400)] 
Fix: update lttng.1 man and enable-channel help with read timer size

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: use channel per domain default values
David Goulet [Fri, 12 Apr 2013 14:21:51 +0000 (10:21 -0400)] 
Fix: use channel per domain default values

This is related to bug497 but does not fix it. Using the command line and the
lttng_channel_set_default_attr() API call, the default read and switch timer
were not correct for UST and Kernel domain since we now use specific default
values for each of them.

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: typos in the code base
David Goulet [Thu, 11 Apr 2013 20:40:46 +0000 (16:40 -0400)] 
Fix: typos in the code base

Fixes #488

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: deny multiple event types with enable-event
David Goulet [Thu, 11 Apr 2013 20:25:50 +0000 (16:25 -0400)] 
Fix: deny multiple event types with enable-event

Fixes #444

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: deny the same port for data and control URL
David Goulet [Thu, 11 Apr 2013 20:01:20 +0000 (16:01 -0400)] 
Fix: deny the same port for data and control URL

This also adds the LTTNG_ERR_NOMEM code and fix a double lttng strerror
print in the lttng create command code.

Fixes #451

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: reset consumer destination when changing URIs
David Goulet [Thu, 11 Apr 2013 19:24:01 +0000 (15:24 -0400)] 
Fix: reset consumer destination when changing URIs

Using -C and -D with lttng create, the session if first created with the
default file path and then changed to the relayd URIs.

The destination object was not reset which was causing a corruption to
the state of the consumer object.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: don't allow different control and data destination
David Goulet [Thu, 11 Apr 2013 19:00:45 +0000 (15:00 -0400)] 
Fix: don't allow different control and data destination

The lttng create command does not allow anymore different destination
when using -C and -D.

Fixes #455

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