lttng-tools.git
9 years agoFix: possible use after free in consumer
David Goulet [Mon, 26 May 2014 18:12:23 +0000 (14:12 -0400)] 
Fix: possible use after free in consumer

Fixes the coverity issue 1019959.

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: improve and update lttng.h comments
David Goulet [Thu, 22 May 2014 17:25:24 +0000 (13:25 -0400)] 
Fix: improve and update lttng.h comments

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: JUL filtering for event *
David Goulet [Mon, 26 May 2014 18:01:14 +0000 (14:01 -0400)] 
Fix: JUL filtering for event *

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: deny overwrite mode and num subbuf less than 2
David Goulet [Fri, 23 May 2014 14:32:09 +0000 (10:32 -0400)] 
Fix: deny overwrite mode and num subbuf less than 2

Also fixed in UST and modules with commit:

(modules) 5140d2b3070f211e6d8a0ad7cb0a190e8b6f3e28
(ust) 3d8e9399b2fb9000b3b55e488a7d04184b5bb56e

Fixes #793

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: remove bad option in enable channel --help
David Goulet [Thu, 22 May 2014 14:56:30 +0000 (10:56 -0400)] 
Fix: remove bad option in enable channel --help

Fixes #776

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: implicit conversion from enumeration
David Goulet [Wed, 21 May 2014 17:52:52 +0000 (13:52 -0400)] 
Fix: implicit conversion from enumeration

Backported to stable-2.3 and 2.4.

Fixes #759

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: clarify man page lttng.1
David Goulet [Wed, 21 May 2014 15:41:46 +0000 (11:41 -0400)] 
Fix: clarify man page lttng.1

Backported to stable-2.3 and 2.4.

Fixes #689

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: Copy-pasted PERROR messages may be misleading
Jérémie Galarneau [Wed, 14 May 2014 15:32:10 +0000 (11:32 -0400)] 
Fix: Copy-pasted PERROR messages may be misleading

Some PERRORs in lttng-sessiond's pthread_create's error handling
code indicate the wrong thread name which may be misleading
during debugging.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: incorrect printf format
David Goulet [Wed, 14 May 2014 15:30:16 +0000 (11:30 -0400)] 
Fix: incorrect printf format

Fixes #777

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: handle ENOENT when creating a kernel event
David Goulet [Wed, 14 May 2014 15:27:00 +0000 (11:27 -0400)] 
Fix: handle ENOENT when creating a kernel event

The kernel tracer returns ENOENT if an event is not found thus warn the
user of that.

Fixes #761

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: move JUL filter creation to a function
David Goulet [Wed, 7 May 2014 18:12:13 +0000 (14:12 -0400)] 
Fix: move JUL filter creation to a function

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: JUL filtering done on the UST level
David Goulet [Wed, 7 May 2014 17:53:36 +0000 (13:53 -0400)] 
Fix: JUL filtering done on the UST level

This is to support enabling all events with different loglevels in two
different sessions.

For this, if any loglevel have been defined, the 'int_loglevel' filter
is added to the UST event. The liblttng-ust-jul library has been
modified to stop filtering loglevel in the agent.

This commit adds two tests, one for a back to back session that are
destroyed and a second one for multi loglevel session.

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: Don't include the binary in the live test's EXTRA_DIST
David Goulet [Mon, 5 May 2014 19:36:16 +0000 (15:36 -0400)] 
Fix: Don't include the binary in the live test's EXTRA_DIST

Signed-off-by: David Goulet <dgoulet@efficios.com>
9 years agoFix: add JUL filter to UST event on logger_name
David Goulet [Tue, 15 Apr 2014 19:05:42 +0000 (15:05 -0400)] 
Fix: add JUL filter to UST event on logger_name

This is to avoid having the JUL event copied in each sessions. See
ticket description for more details.

To achieve this, JUL filtering has been added to fix that bug.

Fixes #773

Signed-off-by: David Goulet <dgoulet@efficios.com>
Conflicts:
src/bin/lttng-sessiond/cmd.c

10 years agoFix: Racy event validation in tests
Christian Babeux [Fri, 18 Apr 2014 17:10:09 +0000 (13:10 -0400)] 
Fix: Racy event validation in tests

This pattern is fundamentally racy:

$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &

[...]

while [ -n "$(pidof $TESTAPP_BIN)" ]; do
   sleep 1
done
pass "Wait for application end"

[...]

tracing_teardown

validate_trace $EXACT_EVENT_COUNT

It is possible that the check for "pidof $TESTAPP_BIN" occurs _before_
the execve() of the applications (starting the applications in background
with & is basically a clone() + execve()). The consequence is that the check
succeed, never waiting for any applications to finish and then the tracing
sessions are prematurely teared down. Thus the resulting trace contains only
some events. We then validate for a fixed number of events and thus the test
fails caused by this racy scheduling situation.

The fix is to start the applications in foreground instead of background.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: rework utils_parse_size_suffix
Simon Marchi [Thu, 10 Apr 2014 15:30:19 +0000 (11:30 -0400)] 
Fix: rework utils_parse_size_suffix

Ok, so there are a lot of problems with this function (sorry :|). Taking
the regex road is probably to complicated for nothing, so here is a
version without regexes.

I added many test cases as suggested by Sandeep Chaudhary and Daniel
Thibault. I tested on both Intel 32 and 64 bits.

Fixes #633

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoUpdate version to v2.4.1 v2.4.1
David Goulet [Tue, 8 Apr 2014 19:14:25 +0000 (15:14 -0400)] 
Update version to v2.4.1

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't delete stream from connection recv list
David Goulet [Thu, 3 Apr 2014 17:14:00 +0000 (13:14 -0400)] 
Fix: don't delete stream from connection recv list

We don't need to delete them from the list during a connection destroy
because it's only a reference to the stream that might be valid or not
during the connection destroy. There is no need at all to access the
stream's pointer at that point.

Commit cd2ef1ef1d54ced9e4d0d03b865bb7fc6a905f80 did not fixed the full
issue so this should fix the use after free race for good.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: use after free of a relayd stream
David Goulet [Wed, 2 Apr 2014 14:31:34 +0000 (10:31 -0400)] 
Fix: use after free of a relayd stream

A race could occur with a stream destruction and a control connection
being destroyed emptying its recv_list. A freed stream could still be in
the list thus having a use after free during the connection destroy.

That was triggering undefined behavior from infinite looping to
segmentation faults.

We've observed this issue on high load stress test. A relayd received
all the stream but NOT the streams sent command which empty the list.
This can happen if a start tracing never occured or failed on the
application side thus the close stream command is sent to the relayd
freeing the stream before it is removed from that list.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't print stream name in error message
David Goulet [Tue, 1 Apr 2014 15:36:13 +0000 (11:36 -0400)] 
Fix: don't print stream name in error message

The stream received, in per UID, is actually a temporary stream object
that only contains the UST object data which is the relevant part for
UST to use.

Thus on error the name was random data thus print the valid handle
descriptor instead of invalid data.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: take session list lock when listing tp
David Goulet [Fri, 28 Mar 2014 13:58:03 +0000 (09:58 -0400)] 
Fix: take session list lock when listing tp

This is important since the list tracepoints command access the
application socket to ask the application for its TPs. The session list
lock protects the ordering of message for those sockets.

This was triggering out of order message between the session daemon and
an application thus triggering undefined behavior.

Fixes #774

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add consumer wake up pipe to avoid race
David Goulet [Wed, 19 Mar 2014 18:34:27 +0000 (14:34 -0400)] 
Fix: add consumer wake up pipe to avoid race

UST application will notify the wait_fd pipe for every subbuffer that it
writes and ready to be consumed. However, on *high* load systems, this
1:1 property can fail if the pipe gets filled up. For performance
reason, UST will ignore this error and continue since it can't wait for
the pipe to clear up.

This triggers a race condition where we have *one* wake up on the UST
pipe for potentially multiple subbuffers. A data pending command will
wait forever on streams that still has data but the data thread could'nt
consumed them because of this 1:n possible race. Using the stop command
without waiting would mean a memory/fd leak of the stream.

Thus, we add a consumer wake up pipe here that notifies the data thread
if there is still data to be read after a successful read subbuffer
call. With this, we end up handling the residual buffers if any since
the data thread is always notified when there is still data to be read.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't spawn relayd if URL is provided
David Goulet [Fri, 28 Mar 2014 17:19:47 +0000 (13:19 -0400)] 
Fix: don't spawn relayd if URL is provided

In the lttng command line tool, relayd should only be spawned for the
default use case which is no URL provided.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't ask data pending if session was not started
David Goulet [Tue, 25 Mar 2014 15:34:47 +0000 (11:34 -0400)] 
Fix: don't ask data pending if session was not started

Fixes #770

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: missing test file in EXTRA dist
David Goulet [Mon, 24 Mar 2014 20:07:51 +0000 (16:07 -0400)] 
Fix: missing test file in EXTRA dist

Fixes #753

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: allow empty URL for live session creation
David Goulet [Mon, 24 Mar 2014 18:23:00 +0000 (14:23 -0400)] 
Fix: allow empty URL for live session creation

This is actually very important so -C/-D can be used with lttng create
--live command and also the load command can set the control and data
URL independently.

This also adds a small test to make sure -C/-D works in live mode.

Fixes #769

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: missing valid return code when adding an URI to consumer
David Goulet [Mon, 24 Mar 2014 18:22:34 +0000 (14:22 -0400)] 
Fix: missing valid return code when adding an URI to consumer

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: syntax error in lttng.1
Michael Jeanson [Sat, 15 Mar 2014 17:55:11 +0000 (13:55 -0400)] 
Fix: syntax error in lttng.1

Signed-off-by: Michael Jeanson <mjeanson@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: check relayd fd leak in lttng cmdline
David Goulet [Wed, 12 Mar 2014 18:47:39 +0000 (14:47 -0400)] 
Fix: check relayd fd leak in lttng cmdline

Fixes coverity issue 1188185.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: remove unused tp in high-throughput test
Zifei Tong [Wed, 12 Mar 2014 09:44:10 +0000 (17:44 +0800)] 
Fix: remove unused tp in high-throughput test

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoUse autoconf AM_MAINTAINER_MODE.
Lars Persson [Wed, 12 Mar 2014 09:22:40 +0000 (10:22 +0100)] 
Use autoconf AM_MAINTAINER_MODE.

Give distribution maintainers the option to skip rebuilding autoconf and
automake generated files. The default behaviour is still to have the
rebuild rules enabled.

Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: clang 'constant-out-of-range-compare' warning
Zifei Tong [Tue, 4 Mar 2014 13:27:38 +0000 (21:27 +0800)] 
Fix: clang 'constant-out-of-range-compare' warning

This patch fixes two 'autological-constant-out-of-range-compare' clang
warnings caused by comparing enum type variables with -1.

It's possible that compilers optimize these two comparisons away.

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Unchecked session pointer when destroying a connection in relayd
Jérémie Galarneau [Tue, 4 Mar 2014 18:45:17 +0000 (13:45 -0500)] 
Fix: Unchecked session pointer when destroying a connection in relayd

An unknown command currently crashes the relay daemon since
destroy_connection calls destroy_session without checking whether or not
a session is associated with the connection.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoUpdate version to v2.4.0 v2.4.0
David Goulet [Fri, 28 Feb 2014 18:50:34 +0000 (13:50 -0500)] 
Update version to v2.4.0

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: improve lttng with live by spawning relayd
David Goulet [Fri, 28 Feb 2014 17:31:46 +0000 (12:31 -0500)] 
Fix: improve lttng with live by spawning relayd

The create --live, will try to spawn a default relayd if no URL is
given.

The lttng view now supports the live tracing mode thus lttng view is
usable with a live session.

Fixes #738

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: relayd should listen for viewers on localhost only by default
Mathieu Desnoyers [Fri, 28 Feb 2014 13:33:49 +0000 (08:33 -0500)] 
Fix: relayd should listen for viewers on localhost only by default

Having relayd listening by default on 0.0.0.0 (all interfaces) with a
protocol without authentication is an information leak waiting to
happen.

Users should explicitely specify if they want to listen on all
interfaces, using e.g. -L tcp://0.0.0.0:5344 (see lttng-relayd(8)
manpage for details). They should only do so if they use a firewall, or
are within a secured network.

Fixes #746

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: handle loglevel range ALL in list command
David Goulet [Thu, 27 Feb 2014 20:04:53 +0000 (15:04 -0500)] 
Fix: handle loglevel range ALL in list command

Print the ":" if we get the ALL range and not TYPE UNKNOWN.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoTests: add JUL test for multiple loglevel
David Goulet [Thu, 27 Feb 2014 19:48:07 +0000 (14:48 -0500)] 
Tests: add JUL test for multiple loglevel

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: index JUL event by name *and* loglevel
David Goulet [Thu, 27 Feb 2014 19:00:13 +0000 (14:00 -0500)] 
Fix: index JUL event by name *and* loglevel

This is to support multiple loglevels for a JUL event.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: JUL to enable user and root tracepoints
David Goulet [Thu, 27 Feb 2014 15:03:14 +0000 (10:03 -0500)] 
Fix: JUL to enable user and root tracepoints

This is needed to support the LTTng JUL agent to connect to both user
and root session daemon, we have to enable different tracepoint for the
two cases in order to avoid duplicating the trace payload in both the
user and root trace output.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Conflicts:
src/bin/lttng-sessiond/lttng-sessiond.h
src/bin/lttng-sessiond/main.c

10 years agoFix: handle the registration done command for JUL
David Goulet [Wed, 26 Feb 2014 21:13:34 +0000 (16:13 -0500)] 
Fix: handle the registration done command for JUL

Lockstep with lttng-ust.

Part of the fix for issue #692

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoTest fix: use temp file sync. of test app
David Goulet [Wed, 26 Feb 2014 20:13:46 +0000 (15:13 -0500)] 
Test fix: use temp file sync. of test app

Fixes #736

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: keep metadata channel attr in UST session
David Goulet [Wed, 26 Feb 2014 20:07:12 +0000 (15:07 -0500)] 
Fix: keep metadata channel attr in UST session

This is so that if we have NO application we can use the metadata
channel attributes once one appears.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoTests fix: Missing waitpid in fork test
Jérémie Galarneau [Wed, 26 Feb 2014 15:56:57 +0000 (10:56 -0500)] 
Tests fix: Missing waitpid in fork test

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add loglevel type to lttng list <name>
David Goulet [Wed, 26 Feb 2014 18:22:32 +0000 (13:22 -0500)] 
Fix: add loglevel type to lttng list <name>

For range loglevel, the <= is used and for single ==. For instance:

ev_log_range (loglevel <= TRACE_WARNING (4)) (type: tracepoint)
ev_log_single (loglevel == TRACE_NOTICE (5)) (type: tracepoint)

Fixes #628

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: minor rephrasing of the lttng.1 man page
David Goulet [Wed, 26 Feb 2014 17:04:57 +0000 (12:04 -0500)] 
Fix: minor rephrasing of the lttng.1 man page

Fixes #730

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Warn user if JUL port is already being used
David Goulet [Wed, 26 Feb 2014 16:45:45 +0000 (11:45 -0500)] 
Fix: Warn user if JUL port is already being used

Fixes #740

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add some sane default values to --live opt
David Goulet [Wed, 26 Feb 2014 16:29:57 +0000 (11:29 -0500)] 
Fix: add some sane default values to --live opt

The lttng create --live now takes optional arguments meaning if no USEC
or/and -U are found, some defaults value are used.

Fixes #738

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: possible NULL deref. in sessiond error path
Stefan Seefeld [Wed, 26 Feb 2014 03:44:30 +0000 (22:44 -0500)] 
Fix: possible NULL deref. in sessiond error path

Fxies #735

Signed-off-by: Stefan Seefeld <stefan@codesourcery.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: flag that kernel streams FDs has been sent
David Goulet [Tue, 25 Feb 2014 20:24:53 +0000 (15:24 -0500)] 
Fix: flag that kernel streams FDs has been sent

Flag the session *after* every stream was successfully sent.

Fixes #731

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: forbid session name creation if contains /
David Goulet [Tue, 25 Feb 2014 19:45:08 +0000 (14:45 -0500)] 
Fix: forbid session name creation if contains /

This adds a validation function for session name which for now denies
any session name containing '/'.

This is in response of bug #721 that actually uses a path as a session
name such as "test/../session1" which would then be concatenated to the
session path adding a relative path to it making this a serious security
issue.

Because of this issue, this is backported from master up to stable-2.3.

Fixes #721

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: don't start session if no channel
David Goulet [Tue, 25 Feb 2014 19:22:19 +0000 (14:22 -0500)] 
Fix: don't start session if no channel

This adds a new error code that indicates that the session contains NO
channel.

Fixes #715

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add missing relayd option to man page
David Goulet [Tue, 25 Feb 2014 19:02:32 +0000 (14:02 -0500)] 
Fix: add missing relayd option to man page

Fixes #706

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: report error if consumer can't be spawned
David Goulet [Tue, 25 Feb 2014 18:55:12 +0000 (13:55 -0500)] 
Fix: report error if consumer can't be spawned

On error of the UST consumer execl(), we now exit the forked process
like the kernel does.

Furthermore, fix an error handling value when timing out when waiting
for the consumer to bootstrap thus returning an error to the client and
not continuing with the command thinking that the consumer was actually
spawned.

So, the expected behavior is to wait for the pthread condition and if a
timeout is seen, the client is informed thus making the client command
hang for the default timeout value of 30 seconds.

Fixes #702

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: lttng list -u <name> should only list UST
David Goulet [Tue, 25 Feb 2014 17:42:04 +0000 (12:42 -0500)] 
Fix: lttng list -u <name> should only list UST

Fixes #654

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: kernel channel destroy on consumer if sent
David Goulet [Tue, 25 Feb 2014 17:21:32 +0000 (12:21 -0500)] 
Fix: kernel channel destroy on consumer if sent

An enable-channel immediately followed by a destroy session triggered an
assert on the consumer followed by the shutdown of the consumer thread
for the kernel.

This fix make sure we don't ask the consumer to destroy a channel if not
previously sent to it and handle not found channel on destroy.

Fixes #643

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: only create UST metadata on start trace
David Goulet [Tue, 25 Feb 2014 16:03:35 +0000 (11:03 -0500)] 
Fix: only create UST metadata on start trace

Fixes #739

Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoRevert "Fix: wrong condition on startup for low-activity streams"
David Goulet [Mon, 24 Feb 2014 19:35:05 +0000 (14:35 -0500)] 
Revert "Fix: wrong condition on startup for low-activity streams"

This reverts commit d3aac146d0800fe9820d51e5b9fa52e7543c1237.

Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: missing big endian conversion for one index field
Julien Desfossez [Mon, 24 Feb 2014 18:34:00 +0000 (13:34 -0500)] 
Fix: missing big endian conversion for one index field

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: wrong condition on startup for low-activity streams
Julien Desfossez [Mon, 24 Feb 2014 18:02:19 +0000 (13:02 -0500)] 
Fix: wrong condition on startup for low-activity streams

If we only received and sent one index, we should not be in the retry
condition.
The rstream->total_index_received == vstream->last_sent_index is checked
before.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: perror on index directory creation error
Julien Desfossez [Mon, 24 Feb 2014 18:02:18 +0000 (13:02 -0500)] 
Fix: perror on index directory creation error

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoComments fix: lttngerr.h -> error.h (./Changelog:754)
Jonathan Rajotte [Mon, 24 Feb 2014 00:50:52 +0000 (19:50 -0500)] 
Comments fix: lttngerr.h -> error.h (./Changelog:754)

Signed-off-by: Jonathan Rajotte <jonathan.r.julien@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: consumerd errors on exit
Mathieu Desnoyers [Fri, 21 Feb 2014 15:14:46 +0000 (10:14 -0500)] 
Fix: consumerd errors on exit

- The LTTNG_CONSUMER_STOP command is not used by sessiond anymore, so
  deprecate it,
- Ensure that the normal teardown (with signal handler) does not trigger
  a health error in consumer daemon by distinguishing between errors and
  "should exit" with different lttng_consumer_poll_socket() return values.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: scanf unbounded input
Mathieu Desnoyers [Fri, 21 Feb 2014 03:53:04 +0000 (22:53 -0500)] 
Fix: scanf unbounded input

Awaiting a proper cleanup (introducing nscanf), do what we can to
validate the scanf input using its utterly broken API.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: miscellaneous memory handling fixes
Mathieu Desnoyers [Thu, 20 Feb 2014 15:23:46 +0000 (10:23 -0500)] 
Fix: miscellaneous memory handling fixes

Issues found with Valgrind:

- Uninitialized memory sent through sendmsg,
- Uninitialized realloc memory,
- Erroneous pointer arithmetic in jul_list_events(),
- Memory leaks in kernel_consumer_add_channel(),
  kernel_consumer_add_metadata(),
- Memory leak (snapshot_destroy missing hash table cleanup),
- Uninitialized poll/epoll memory on realloc.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add missing VALGRIND ifdef checks and documentation
Mathieu Desnoyers [Thu, 20 Feb 2014 15:23:45 +0000 (10:23 -0500)] 
Fix: add missing VALGRIND ifdef checks and documentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoUpdate version to v2.4.0-rc5 v2.4.0-rc5
David Goulet [Fri, 14 Feb 2014 22:10:02 +0000 (17:10 -0500)] 
Update version to v2.4.0-rc5

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: race with index file creation
Julien Desfossez [Fri, 14 Feb 2014 19:25:26 +0000 (14:25 -0500)] 
Fix: race with index file creation

Only the data thread should create the index file since it is
responsible of filling the FD field of the index struct in memory.
When the control thread is ready to write the index, the FD is already
set.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: deadlock during rotation
Julien Desfossez [Fri, 14 Feb 2014 20:51:34 +0000 (15:51 -0500)] 
Fix: deadlock during rotation

The overwrite_lock is nested inside the viewer_stream_rotation_lock.
And the viewer_stream_rotate function is always called with the
viewer_stream_rotation_lock held.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: simplify get next index in live
David Goulet [Thu, 13 Feb 2014 18:58:19 +0000 (13:58 -0500)] 
Fix: simplify get next index in live

This fixes some case of unitialized status, use of bad ret value and
help modularize the get next index function.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: steal channel key in the consumer to avoid race
David Goulet [Wed, 12 Feb 2014 20:17:57 +0000 (15:17 -0500)] 
Fix: steal channel key in the consumer to avoid race

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: change ERR statement to DBG in kernel read subbuffer
David Goulet [Thu, 13 Feb 2014 15:55:47 +0000 (10:55 -0500)] 
Fix: change ERR statement to DBG in kernel read subbuffer

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: handle snapshot ENODATA in live timer
David Goulet [Thu, 13 Feb 2014 15:42:58 +0000 (10:42 -0500)] 
Fix: handle snapshot ENODATA in live timer

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: relayd leak on error in consumer splice()
David Goulet [Wed, 12 Feb 2014 16:19:43 +0000 (11:19 -0500)] 
Fix: relayd leak on error in consumer splice()

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: protect close_write_flag with the rotation lock
David Goulet [Tue, 11 Feb 2014 21:27:57 +0000 (16:27 -0500)] 
Fix: protect close_write_flag with the rotation lock

Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoMan: clarify loglevel for JUL domain
David Goulet [Wed, 12 Feb 2014 19:46:08 +0000 (14:46 -0500)] 
Man: clarify loglevel for JUL domain

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: Define __STDC_LIMIT_MACROS to fix C++ builds
Jérémie Galarneau [Mon, 10 Feb 2014 16:04:22 +0000 (11:04 -0500)] 
Fix: Define __STDC_LIMIT_MACROS to fix C++ builds

Necessary to include the fixed-width type limits on glibc versions
older than 2.18 when building with a C++ compiler.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: bad indentation of lttng list in man page
David Goulet [Tue, 4 Feb 2014 20:32:52 +0000 (15:32 -0500)] 
Fix: bad indentation of lttng list in man page

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: wrong data structure used in commit df41f83
David Goulet [Tue, 11 Feb 2014 21:36:30 +0000 (16:36 -0500)] 
Fix: wrong data structure used in commit df41f83

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add missing optional dependency to babeltrace in README
Christian Babeux [Fri, 7 Feb 2014 17:43:38 +0000 (12:43 -0500)] 
Fix: add missing optional dependency to babeltrace in README

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: cleanup inconsistent use of spaces/tabs in README
Christian Babeux [Fri, 7 Feb 2014 17:48:51 +0000 (12:48 -0500)] 
Fix: cleanup inconsistent use of spaces/tabs in README

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: only set the new_streams flag if a viewer is attached
Julien Desfossez [Mon, 10 Feb 2014 23:52:29 +0000 (18:52 -0500)] 
Fix: only set the new_streams flag if a viewer is attached

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: lttng-live documentation
Julien Desfossez [Mon, 10 Feb 2014 23:52:28 +0000 (18:52 -0500)] 
Fix: lttng-live documentation

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: remove dead code in relayd live code
David Goulet [Tue, 11 Feb 2014 21:08:43 +0000 (16:08 -0500)] 
Fix: remove dead code in relayd live code

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: use after free error code path
David Goulet [Tue, 11 Feb 2014 21:04:15 +0000 (16:04 -0500)] 
Fix: use after free error code path

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: wrong sizeof argument in live viewer create session
David Goulet [Tue, 11 Feb 2014 20:58:52 +0000 (15:58 -0500)] 
Fix: wrong sizeof argument in live viewer create session

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: zero out the reply structure in viewer_connect
David Goulet [Tue, 11 Feb 2014 20:16:34 +0000 (15:16 -0500)] 
Fix: zero out the reply structure in viewer_connect

Fixes #728

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: write index only if fd is valid
David Goulet [Tue, 11 Feb 2014 19:13:01 +0000 (14:13 -0500)] 
Fix: write index only if fd is valid

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: cleanup relayd on any I/O error in read subbuffer mmap
David Goulet [Tue, 11 Feb 2014 18:21:59 +0000 (13:21 -0500)] 
Fix: cleanup relayd on any I/O error in read subbuffer mmap

Any I/O operation that triggers an error now cleans the relayd since
there is no way we can recover from that in any cases and streams
associated to that relayd need to be cleaned up.

This commit also removes the "written" variable that is simply not
needed and was a bit confusing as a returned value.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: memory/fd leak when cleaning streams in channel
David Goulet [Tue, 11 Feb 2014 18:16:45 +0000 (13:16 -0500)] 
Fix: memory/fd leak when cleaning streams in channel

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: destroy streams in consumer del channel
David Goulet [Mon, 10 Feb 2014 22:23:20 +0000 (17:23 -0500)] 
Fix: destroy streams in consumer del channel

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add missing urcu wfqueue headers in relayd
David Goulet [Mon, 10 Feb 2014 22:21:14 +0000 (17:21 -0500)] 
Fix: add missing urcu wfqueue headers in relayd

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: in lttng_read/write deny count bigger than the possible returned value
David Goulet [Mon, 10 Feb 2014 18:43:08 +0000 (13:43 -0500)] 
Fix: in lttng_read/write deny count bigger than the possible returned value

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: fd leak when closing metadata stream
David Goulet [Thu, 6 Feb 2014 21:49:37 +0000 (16:49 -0500)] 
Fix: fd leak when closing metadata stream

Make sure to close the metadata poll pipe when the endpoint of the
stream dies out (ex: relayd stops unexpectedly). That was causing a fd
leak when we were destroying a metadata stream without using the close
metadata code path.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: read subbuffer mmap/splice signedness issue
David Goulet [Thu, 6 Feb 2014 19:16:06 +0000 (14:16 -0500)] 
Fix: read subbuffer mmap/splice signedness issue

Signed and unsigned values were compared thus making the code path where
ret = -1 being interpreted as ret > len == true thus not cleaning up the
relayd.

This patch simplifies the read subbuffer mmap operation since
lttng_write() now provides a guarantee that the return data is either
equal to the count passed or less which the later means the endpoint has
stop working.

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoDoc: live protocol clarifications
Julien Desfossez [Thu, 6 Feb 2014 15:50:56 +0000 (10:50 -0500)] 
Doc: live protocol clarifications

Updates about the get_new_stream, the attach procedure, the create
viewer_session and the multiple attach.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
10 years agoFix: remove unused create_viewer_session option
Julien Desfossez [Thu, 6 Feb 2014 15:21:21 +0000 (10:21 -0500)] 
Fix: remove unused create_viewer_session option

Since it is unused for now, don't bloat the ABI with that.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
10 years agoFix: don't sleep(1) on the consumer ready flag
David Goulet [Wed, 5 Feb 2014 22:40:59 +0000 (17:40 -0500)] 
Fix: don't sleep(1) on the consumer ready flag

This is way too long on especially when the first command that spawn the
consumer as to wait a full second on powerful system.

Bring this down to 0.1 sec sleep by using usleep().

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: free viewer session in connection_free()
David Goulet [Wed, 5 Feb 2014 21:37:46 +0000 (16:37 -0500)] 
Fix: free viewer session in connection_free()

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: add missing ctf trace delete before destroy
David Goulet [Wed, 5 Feb 2014 21:26:43 +0000 (16:26 -0500)] 
Fix: add missing ctf trace delete before destroy

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