lttng-tools.git
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>
8 years agoTest fix: ignore stderr at every step of randstring
Jérémie Galarneau [Wed, 9 Mar 2016 20:49:24 +0000 (15:49 -0500)] 
Test fix: ignore stderr at every step of randstring

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest fix: ignore stderr when generating random string
Jérémie Galarneau [Wed, 9 Mar 2016 20:26:37 +0000 (15:26 -0500)] 
Test fix: ignore stderr when generating random string

tr often reports a broken pipe when the head command exits
(after having received enough characters) which pollutes the
test output.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: test: use load_path instead of $1
Jonathan Rajotte [Thu, 14 Jan 2016 18:40:42 +0000 (13:40 -0500)] 
Fix: test: use load_path instead of $1

$1 is used for tap condition checking not the load path.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix warning when building Python bindings
Jérémie Galarneau [Tue, 23 Feb 2016 20:18:18 +0000 (15:18 -0500)] 
Fix warning when building Python bindings

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTest: prevent the spawning of a daemonized sessiond
Jonathan Rajotte [Tue, 8 Mar 2016 22:37:39 +0000 (17:37 -0500)] 
Test: prevent the spawning of a daemonized sessiond

Sets the default lttng-sessiond path to /bin/true to prevent the spawning
of a daemonized sessiond. This is necessary since 'lttng create' will spawn
its own sessiond if none is running. It also ensures that 'lttng create'
fails when no sessiond is running.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: There is more tests than the plan
Jonathan Rajotte [Thu, 15 Oct 2015 20:45:30 +0000 (16:45 -0400)] 
Fix: There is more tests than the plan

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: per-pid ust buffers flush race with application unregister
Mathieu Desnoyers [Wed, 24 Feb 2016 00:41:40 +0000 (19:41 -0500)] 
Fix: per-pid ust buffers flush race with application unregister

If an application exits between the moment we create the ust app session
(shadow copy) and the moment we send channels to the application,
sending channels may fail. If the application unregisters between the
the end of ust app session creation and the destroy that follows (ust
app session lock is released in between), we may see is_sent being
false.

This assert was initially there in the early days of lttng-tools when
the application was responsible for doing the flush. Now that the flush
has been moved to the consumer daemon, we don't need this assertion
anymore.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: Use ipv6 loopback adress in test_uri
Michael Jeanson [Thu, 18 Feb 2016 17:45:13 +0000 (12:45 -0500)] 
Fix: Use ipv6 loopback adress in test_uri

Some older version of Debian/Ubuntu and maybe other distros won't set
localhost to point on ::1 in the system hosts file and use instead a
custom name like ip6-localhost or ipv6-locahost which is not
standardized across distros.

To work around this, use the ipv6 loopback address instead of localhost.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: report already enabled event error to client
Jérémie Galarneau [Sun, 14 Feb 2016 23:22:03 +0000 (18:22 -0500)] 
Fix: report already enabled event error to client

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
src/bin/lttng-sessiond/cmd.c

8 years agoTests fix: source utils.sh before using conf_proc_count
Jérémie Galarneau [Fri, 12 Feb 2016 21:41:49 +0000 (16:41 -0500)] 
Tests fix: source utils.sh before using conf_proc_count

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: use configured processor count in getcpu override tests
Jérémie Galarneau [Fri, 12 Feb 2016 16:19:22 +0000 (11:19 -0500)] 
Tests: use configured processor count in getcpu override tests

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
tests/regression/ust/getcpu-override/test_getcpu_override

8 years agoTests: use configured processor count in snapshot tests
Jérémie Galarneau [Fri, 12 Feb 2016 16:17:42 +0000 (11:17 -0500)] 
Tests: use configured processor count in snapshot tests

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: Introduce conf_proc_count()
Jérémie Galarneau [Fri, 12 Feb 2016 16:17:18 +0000 (11:17 -0500)] 
Tests: Introduce conf_proc_count()

Tests are using the nproc utility which return the number of
_available_ CPUs. The distinction between online, available and
configured CPUs is subtle, but important.

The number of "online" CPUs can change at runtime as CPUs are
hot-plugged. This could happen during a test and result in
unexpected results.

The number of "configured" CPUs includes any CPU which may be
offline at the time.

The number of "available" CPUs, which is what is returned by the
nproc utility, may differ from both "online" and "configured"
counts. This is the case in containers which are assigned to a
subset of configured CPUs.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoTests: print a more precise test description in snapshot tests
Jérémie Galarneau [Fri, 12 Feb 2016 15:40:50 +0000 (10:40 -0500)] 
Tests: print a more precise test description in snapshot tests

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: handle negative clock offset for lttng-ust metadata
Mathieu Desnoyers [Mon, 8 Feb 2016 22:13:25 +0000 (17:13 -0500)] 
Fix: handle negative clock offset for lttng-ust metadata

In the unlikely situation where a system sets its hardware clock
(CLOCK_REALTIME) to 0 (Epoch) after boot, the difference

  monotonic - realtime

becomes negative.

Fixup this situation by returning a 0 offset in this case.

This ensures that trace viewer implementations (e.g. babeltrace) which
currently cannot handle the negative offset (known bug) still work with
the generated traces.

This patch should be applied to master and stable-2.7.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: do not print error and bug messages when quiet (-q) is present
Jonathan Rajotte [Mon, 11 Jan 2016 22:32:14 +0000 (17:32 -0500)] 
Fix: do not print error and bug messages when quiet (-q) is present

Conform to the lttng man page

fixes #988

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoUpdate version to v2.7.1 v2.7.1
Jérémie Galarneau [Thu, 7 Jan 2016 20:00:51 +0000 (15:00 -0500)] 
Update version to v2.7.1

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoBuild: fallback to AC_CHECK_LIBS when looking for popt and uuid
Jonathan Rajotte [Tue, 1 Dec 2015 20:19:01 +0000 (15:19 -0500)] 
Build: fallback to AC_CHECK_LIBS when looking for popt and uuid

Not all distro ship .pc so fallback to basic libs searching if necessary.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agotests/unit: fix object files' location
Samuel Martin [Tue, 1 Dec 2015 23:36:45 +0000 (00:36 +0100)] 
tests/unit: fix object files' location

Referring to *.o files under a .libs/ directory is not recommended
because this belongs to libtool's innards.

Indeed, libtool decides to place the *.o files in an
implementation-specific location:
- PIC *.o files go into a .libs/ directory;
- non-PIC *.o files are generated along side to their corresponding
  source files.

Using PIC objects to build executable is legit, thought it may
introduce some minor overhead at runtime.

However, hard-coding these PIC object files in the Makefile.am to build
executables breaks the build in case of static only build.

In this case, no PIC object files is generated, so the linker will not
found some of the needed objects files.

Changing these dependencies' path fixes the static build, keeping the
shared one ok, though the non-PIC object files are now always built.

Fixes #983.

Fix tested on git master and v2.6 with no change needed.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoconfigure.ac: fix static build
Samuel Martin [Sun, 22 Nov 2015 22:38:00 +0000 (23:38 +0100)] 
configure.ac: fix static build

For static build, some extra LDFLAGS may be needed.

Using PKG_CHECK_MODULES instead of AC_CHECK_LIB for librairy detection
allows to get all these flags. Then, the LIBS variable can be extended
with everything that is needed.

So, use PKG_CHECK_MODULES for popt and uuid detection; which both depend
on libintl.

This changes fixes build failures triggered with Buildroot, e.g.:
  http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/build-end.log

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: close indexes when rotating the trace files in mmap mode
Jérémie Galarneau [Fri, 27 Nov 2015 20:47:01 +0000 (15:47 -0500)] 
Fix: close indexes when rotating the trace files in mmap mode

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 years agoFix: close indexes when rotating the trace files in splice mode
Julien Desfossez [Fri, 27 Nov 2015 17:12:44 +0000 (12:12 -0500)] 
Fix: close indexes when rotating the trace files in splice mode

The consumer needs to close the old index file when doing a file
rotation before opening a new one.
The relay does not have this problem (handled with refcounts).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Don't spam session daemon logs on invalid UST context
Jérémie Galarneau [Thu, 19 Nov 2015 17:07:56 +0000 (12:07 -0500)] 
Fix: Don't spam session daemon logs on invalid UST context

Fixes #976

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Check for NULL hash tables on relay daemon teardown
Jérémie Galarneau [Mon, 2 Nov 2015 22:51:04 +0000 (17:51 -0500)] 
Fix: Check for NULL hash tables on relay daemon teardown

The relay daemon will log any "leaked" object on exit. However,
some errors encountered early-on during the daemon's
initialization may result in the teardown being executed with
uninitialized hash tables.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Verify directory's existence before calling mkdir
Jérémie Galarneau [Mon, 2 Nov 2015 16:39:59 +0000 (11:39 -0500)] 
Fix: Verify directory's existence before calling mkdir

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Unchecked NULL string in logging statement
Jérémie Galarneau [Fri, 23 Oct 2015 01:37:54 +0000 (21:37 -0400)] 
Fix: Unchecked NULL string in logging statement

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: include the filter expression in agent events' primary key
Alexandre Montplaisir [Fri, 11 Sep 2015 22:38:52 +0000 (18:38 -0400)] 
Fix: include the filter expression in agent events' primary key

Similar fix to a931962, but for filter expressions this time.

UST events's key already includes the filter bytecode, so adding the
string itself should not be needed.

Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix live timer calculation error
Mikael Beckius [Wed, 21 Oct 2015 19:48:29 +0000 (15:48 -0400)] 
Fix live timer calculation error

There is an calculation error for live timer. Variable
switch_timer_interval is based on microsecond, and it is not
right to assign switch_timer_interval mod 1000000 to var tv_nsec
which is based on nanosecond.

Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Remove dependency on glibc 2.12 caused by pthread_setname_np
Jérémie Galarneau [Wed, 30 Sep 2015 20:48:12 +0000 (16:48 -0400)] 
Fix: Remove dependency on glibc 2.12 caused by pthread_setname_np

prctl() can be used to set the same attribute set by
pthread_setname_np, but doesn't introduce a dependency on a newer
glibc. Using prctl(PR_SET_NAME) introduces a soft dependency on
Linux 2.6.9. However, the worker won't fail to launch if the call
fails as it is set out of convenience (debugger output).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Log and ignore SIGINT and SIGTERM in run_as worker
Jérémie Galarneau [Tue, 29 Sep 2015 16:19:00 +0000 (12:19 -0400)] 
Fix: Log and ignore SIGINT and SIGTERM in run_as worker

The run_as worker is in the same process group as its parent and
will receive both SIGINT and SIGTERM. However, we want to give
the worker a chance to tear itself down gracefully when its
parent closes the command socket.

The run_as worker will now ignore these signals (although it will
log them) and wait for the parent to induce the teardown.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoUpdate version to v2.7.0 v2.7.0
Jérémie Galarneau [Thu, 24 Sep 2015 19:14:45 +0000 (15:14 -0400)] 
Update version to v2.7.0

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Handle EINTR of waipid in run-as worker
Jérémie Galarneau [Thu, 24 Sep 2015 18:20:42 +0000 (14:20 -0400)] 
Fix: Handle EINTR of waipid in run-as worker

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Handle EINTR of waitpid when spawning a session daemon
Jérémie Galarneau [Thu, 24 Sep 2015 16:34:49 +0000 (12:34 -0400)] 
Fix: Handle EINTR of waitpid when spawning a session daemon

waitpid may fail for various reasons, being interrupted being
the most frequent. In such a case, status is left uninitialized
which results in the WIFSIGNALED and WIFEXITED macros returning
undefined value, resulting in surprising logging statements such
as "killed by signal 114".

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd a LOG() macro which handles dynamic severity levels
Jérémie Galarneau [Thu, 6 Aug 2015 18:57:17 +0000 (14:57 -0400)] 
Add a LOG() macro which handles dynamic severity levels

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: tests: support systems where PAGE_SIZE is not 4096
Michael Jeanson [Tue, 22 Sep 2015 21:14:45 +0000 (17:14 -0400)] 
Fix: tests: support systems where PAGE_SIZE is not 4096

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTest: jul/log4j: use -a instead of '*' to disable all events
Jonathan Rajotte [Tue, 22 Sep 2015 17:55:34 +0000 (13:55 -0400)] 
Test: jul/log4j: use -a instead of '*' to disable all events

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoReword warning on event disable
Jérémie Galarneau [Tue, 22 Sep 2015 16:12:20 +0000 (12:12 -0400)] 
Reword warning on event disable

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoClean-up: Remove unused test launchers
Jérémie Galarneau [Tue, 22 Sep 2015 15:59:44 +0000 (11:59 -0400)] 
Clean-up: Remove unused test launchers

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoHelp: add -j -l -p option to help string
Jonathan Rajotte [Mon, 21 Sep 2015 22:43:57 +0000 (18:43 -0400)] 
Help: add -j -l -p option to help string

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoman: update disable-event section
Jonathan Rajotte [Mon, 21 Sep 2015 22:43:56 +0000 (18:43 -0400)] 
man: update disable-event section

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoUse empty event name on disable -a for ust and agent domain
Jonathan Rajotte [Mon, 21 Sep 2015 22:43:55 +0000 (18:43 -0400)] 
Use empty event name on disable -a for ust and agent domain

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: disable kernel event based on name and event type
Jonathan Rajotte [Mon, 21 Sep 2015 22:43:54 +0000 (18:43 -0400)] 
Fix: disable kernel event based on name and event type

The -a argument is interpreted as a zero-length event name
instead of '*' which is actually a valid wildcard event
name by itself. This simplifies how a disable command is
handled by the session daemon.

The event type can now be passed as argument and is a
new criteria while disabling kernel events. The default
is to disable for all event types.

UST and agent domain do not yet support disabling by event
type.

e.g:
# Only disable kernel event of type tracepoint.
lttng disable -a -k --tracepoint

# Only disable the event with name '*' and type syscall.
lttng disable -k '*' --syscall

# Disable all kernel event of all type.
lttng disable -a -k

Fixes #925

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: Clean-up test-crash on SIGTERM and SIGINT
Jérémie Galarneau [Mon, 21 Sep 2015 22:14:02 +0000 (18:14 -0400)] 
Tests: Clean-up test-crash on SIGTERM and SIGINT

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Possible dereference of null pointers
Michael Jeanson [Mon, 21 Sep 2015 20:31:25 +0000 (16:31 -0400)] 
Fix: Possible dereference of null pointers

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Break out of loop when searching for a domain's agent
Jérémie Galarneau [Mon, 21 Sep 2015 20:38:01 +0000 (16:38 -0400)] 
Fix: Break out of loop when searching for a domain's agent

The list command never check if a domain's agent has been found
and lists the events of every agent.

This has two direct effects:

1) Memory leak of all agents' event descriptions, except the last
2) The session daemon lists the wrong agent's events

This fix check the agent's domain and breaks out of the loop once
one is found.

Fixes #906

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: int printed as uint
Michael Jeanson [Mon, 21 Sep 2015 19:19:30 +0000 (15:19 -0400)] 
Fix: int printed as uint

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add subdir-objects to Makefile.am
Mathieu Desnoyers [Thu, 17 Sep 2015 19:09:10 +0000 (15:09 -0400)] 
Fix: add subdir-objects to Makefile.am

Fixes the following warning introduced by the runas worker changes. Use
the same technique used in src/bin/lttng/Makefile.am.

src/common/Makefile.am:17: warning: source file 'sessiond-comm/unix.c' is in a subdirectory,
src/common/Makefile.am:17: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: tests: skip UST perf tests if not root
Mathieu Desnoyers [Thu, 17 Sep 2015 18:10:50 +0000 (14:10 -0400)] 
Fix: tests: skip UST perf tests if not root

Some distributions like Debian (e.g. Debian kernel 4.1.0-2-amd64) have
some grsecurity options enabled, such as CONFIG_GRKERNSEC_PERF_HARDEN.

Unfortunately, this option makes it impossible to use the SW page-fault
perf event as a normal user. It only leaves some HW events. However, we
can only use SW events within virtual machines.

Therefore, only run this test as root for now until we find a better
approach.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoUpdate version to v2.7.0-rc2 v2.7.0-rc2
Jérémie Galarneau [Fri, 18 Sep 2015 21:33:23 +0000 (17:33 -0400)] 
Update version to v2.7.0-rc2

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Check use_clone() instead of worker in run_as
Jérémie Galarneau [Fri, 18 Sep 2015 21:03:14 +0000 (17:03 -0400)] 
Fix: Check use_clone() instead of worker in run_as

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Perform rcu barrier before tearing down the run-as worker
Jérémie Galarneau [Fri, 18 Sep 2015 20:16:35 +0000 (16:16 -0400)] 
Fix: Perform rcu barrier before tearing down the run-as worker

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Handle hang-up gracefully in run-as
Jérémie Galarneau [Fri, 18 Sep 2015 19:50:02 +0000 (15:50 -0400)] 
Fix: Handle hang-up gracefully in run-as

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Only log app handle release on failure
Jérémie Galarneau [Fri, 18 Sep 2015 19:35:21 +0000 (15:35 -0400)] 
Fix: Only log app handle release on failure

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: shm-path: handling of snprintf return value
Mathieu Desnoyers [Fri, 18 Sep 2015 18:46:23 +0000 (14:46 -0400)] 
Fix: shm-path: handling of snprintf return value

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Wrong format specifier used in debug statement
Jérémie Galarneau [Fri, 18 Sep 2015 18:39:13 +0000 (14:39 -0400)] 
Fix: Wrong format specifier used in debug statement

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: Swap usages of pidof for pgrep --full
Jérémie Galarneau [Fri, 18 Sep 2015 16:59:20 +0000 (12:59 -0400)] 
Tests: Swap usages of pidof for pgrep --full

Some implementations of pidof (such as the one from procps-ng)
seem immune to changing a process' name using prctl() and
overwriting argv[0]. Using preg --full works around this
problem.

In time, we should ensure every deamon publishes a PID file
which can be reliably used by the tests.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: indefinitely wait for shm buffers to be unlinked
Jérémie Galarneau [Thu, 17 Sep 2015 20:35:29 +0000 (16:35 -0400)] 
Tests: indefinitely wait for shm buffers to be unlinked

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Hide run-as functions
Jérémie Galarneau [Thu, 17 Sep 2015 18:12:34 +0000 (14:12 -0400)] 
Fix: Hide run-as functions

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Hide sessiond-comm functions
Jérémie Galarneau [Thu, 17 Sep 2015 17:49:22 +0000 (13:49 -0400)] 
Fix: Hide sessiond-comm functions

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: remove duplicated implementation of rculfhash
Mathieu Desnoyers [Thu, 17 Sep 2015 16:48:41 +0000 (12:48 -0400)] 
Cleanup: remove duplicated implementation of rculfhash

lttng-tools features a duplicated copy of Userspace RCU rculfhash due to
interaction issues between runas clone() and internal libc mutexes.

Now that the runas implementation has been changed to use fork() and a
worker process, we don't need this work-around anymore. Remove the
duplicated rculfhash to lessen the maintenance burden.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: relayd: don't call lttng_ht_destroy in RCU read-side C.S.
Mathieu Desnoyers [Thu, 17 Sep 2015 16:48:40 +0000 (12:48 -0400)] 
Fix: relayd: don't call lttng_ht_destroy in RCU read-side C.S.

It is forbidden to call lttng_ht_destroy() within a RCU read-side
critical section.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: libc internal mutex races with run_as
Mathieu Desnoyers [Thu, 17 Sep 2015 15:30:29 +0000 (11:30 -0400)] 
Fix: libc internal mutex races with run_as

Implement a proper run_as worker process scheme to fix internal libc
mutex races. Those races lead to having the internal mutex held by
another process when clone() is called, thus hanging the clone child.

Now that we create the worker process when the parent process is
still single-threaded, we don't run into those issues. Implement a
standard fork + file descriptor passing over unnamed unix sockets rather
than the prior clone + shared file descriptor table, which was causing
issues with valgrind.

This adds a new process called "lttng-runas" for each sessiond
and consumerd process.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Hide readwrite symbols in common lib
Jérémie Galarneau [Thu, 17 Sep 2015 17:29:29 +0000 (13:29 -0400)] 
Fix: Hide readwrite symbols in common lib

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Hide pipe symbols in common lib
Jérémie Galarneau [Thu, 17 Sep 2015 17:29:11 +0000 (13:29 -0400)] 
Fix: Hide pipe symbols in common lib

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Hide daemonize symbols in common lib
Jérémie Galarneau [Thu, 17 Sep 2015 16:50:02 +0000 (12:50 -0400)] 
Fix: Hide daemonize symbols in common lib

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Hide RCU hashtable wrapper symbols
Jérémie Galarneau [Thu, 17 Sep 2015 15:29:06 +0000 (11:29 -0400)] 
Fix: Hide RCU hashtable wrapper symbols

RCU hashtable symbols shall not be exported in liblttng-ctl.so.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: prevent dangling pointer in utils_partial_realpath
Antoine Busque [Wed, 16 Sep 2015 06:58:40 +0000 (02:58 -0400)] 
Fix: prevent dangling pointer in utils_partial_realpath

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: rcu_read_unlock without parentheses has no side-effect
Jérémie Galarneau [Wed, 16 Sep 2015 23:49:56 +0000 (19:49 -0400)] 
Fix: rcu_read_unlock without parentheses has no side-effect

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing test file to EXTRA_DIST
Michael Jeanson [Tue, 15 Sep 2015 14:37:48 +0000 (10:37 -0400)] 
Fix: add missing test file to EXTRA_DIST

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFormat utils.sh messages
Jonathan Rajotte [Fri, 11 Sep 2015 14:46:06 +0000 (10:46 -0400)] 
Format utils.sh messages

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: use functions from utils.sh
Jonathan Rajotte [Fri, 11 Sep 2015 14:46:05 +0000 (10:46 -0400)] 
Tests: use functions from utils.sh

v2: remove redundant information in success message.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoReport error if any disable action fails
Jonathan Rajotte [Thu, 10 Sep 2015 20:10:57 +0000 (16:10 -0400)] 
Report error if any disable action fails

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: disable all ust events
Jonathan Rajotte [Thu, 10 Sep 2015 20:10:56 +0000 (16:10 -0400)] 
Fix: disable all ust events

Handle * event correctly.

Fixes #936

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoBring back event_ust_disable_all_tracepoints
Jonathan Rajotte [Thu, 10 Sep 2015 20:10:55 +0000 (16:10 -0400)] 
Bring back event_ust_disable_all_tracepoints

Revert part of be42c96885c522f857f146fa6f7ae53856e3bed2

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: sessiond: disable: match app event by name
Jonathan Rajotte [Wed, 9 Sep 2015 21:08:20 +0000 (17:08 -0400)] 
Fix: sessiond: disable: match app event by name

The use of a simple lookup and match on event name is insufficient
to identify the corresponding ust app event.

Fixes #914

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agolttng-crash: support symlink
Jonathan Rajotte [Wed, 9 Sep 2015 17:46:17 +0000 (13:46 -0400)] 
lttng-crash: support symlink

Fixes #915

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTest: lttng-crash and ust shm path
Jonathan Rajotte [Wed, 9 Sep 2015 17:46:16 +0000 (13:46 -0400)] 
Test: lttng-crash and ust shm path

Fixes #916

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: dereferencing null index pointer
Antoine Busque [Sun, 13 Sep 2015 05:13:38 +0000 (01:13 -0400)] 
Fix: dereferencing null index pointer

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: leaking memory from strdup in lttng-crash
Antoine Busque [Sun, 13 Sep 2015 04:54:04 +0000 (00:54 -0400)] 
Fix: leaking memory from strdup in lttng-crash

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: memleak in utils_partial_realpath
Antoine Busque [Sun, 13 Sep 2015 04:18:44 +0000 (00:18 -0400)] 
Fix: memleak in utils_partial_realpath

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: double free on enable-event
Antoine Busque [Sun, 13 Sep 2015 03:48:11 +0000 (23:48 -0400)] 
Fix: double free on enable-event

Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: error on no/multiple domain options
Philippe Proulx [Wed, 2 Sep 2015 17:33:52 +0000 (13:33 -0400)] 
Fix: error on no/multiple domain options

Fixes: #927
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: lttng-crash: segfault when parsing options
Philippe Proulx [Fri, 4 Sep 2015 22:47:50 +0000 (18:47 -0400)] 
Fix: lttng-crash: segfault when parsing options

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoPrint relayd stream indexes
Mathieu Desnoyers [Wed, 9 Sep 2015 15:56:37 +0000 (11:56 -0400)] 
Print relayd stream indexes

In debug output, print leaking stream index information when exiting
from relay daemon.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoEnhance relayd error reporting
Mathieu Desnoyers [Wed, 9 Sep 2015 15:56:36 +0000 (11:56 -0400)] 
Enhance relayd error reporting

relay_process_data has error cases that don't print any error to the
console. Add those cases, and enhance the information provided by error
output within handle_index_data().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: relayd: handle consumerd crashes without leak
Mathieu Desnoyers [Wed, 9 Sep 2015 15:56:34 +0000 (11:56 -0400)] 
Fix: relayd: handle consumerd crashes without leak

We can be clever about indexes partially received in cases where we
received the data socket part, but not the control socket part: since
we're currently closing the stream on behalf of the control socket, we
*know* there won't be any more control information for this socket.
Therefore, we can destroy all indexes for which we have received only
the file descriptor (from data socket). This takes care of consumerd
crashes between sending the data and control information for a packet.
Since those are sent in that order, we take care of consumerd crashes.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: LPOLLHUP and LPOLLERR when there is still data in pipe/socket
Mathieu Desnoyers [Wed, 9 Sep 2015 15:56:33 +0000 (11:56 -0400)] 
Fix: LPOLLHUP and LPOLLERR when there is still data in pipe/socket

The event mask returned by poll/epoll is a bitwise mask made of all the
events observed. On bidirectional sockets, there are cases where
combinations of LPOLLHUP/LPOLLERR and LPOLLIN/LPOLLPRI can be raised at
the same time.

Currently the overall behavior in sessiond, consumerd and relayd is to
handle LPOLLHUP or LPOLLERR immediately, whether or not there is still
data to read in the socket. Unfortunately, this behavior may discard the
last information made available on the pipe or socket.

Audit all uses of LPOLLHUP and LPOLLERR on sockets on which we expect
data to ensure that we deal with LPOLLIN or LPOLLPRI, and catch the
hangup when read or recvmsg returns 0. Keep the LPOLLHUP and LPOLLERR
handling, but only when LPOLLIN is not raised, just in case some
unforeseen error happens when sending the reply.

This is one correct case where we can handle LPOLLHUP and LPOLLERR
directly without caring about LPOLLIN: sockets where we are expected to
write and then read the reply (e.g. command sockets). It is then OK
for a dedicated thread to watch for LPOLLHUP and LPOLLERR.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Use 2.7 java JAR and class names
Jérémie Galarneau [Wed, 9 Sep 2015 12:15:26 +0000 (08:15 -0400)] 
Fix: Use 2.7 java JAR and class names

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: double RCU unlock on event_agent_disable_all
Jonathan Rajotte [Tue, 8 Sep 2015 22:32:12 +0000 (18:32 -0400)] 
Fix: double RCU unlock on event_agent_disable_all

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: unbalanced RCU read-side lock in enable event command
Mathieu Desnoyers [Mon, 7 Sep 2015 14:36:09 +0000 (10:36 -0400)] 
Fix: unbalanced RCU read-side lock in enable event command

The event validation fails, an unpaired RCU unlock is performed, thus
underflowing the RCU nesting counter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd rcu_read_ongoing() assertions around process_client_msg
Mathieu Desnoyers [Mon, 7 Sep 2015 14:36:08 +0000 (10:36 -0400)] 
Add rcu_read_ongoing() assertions around process_client_msg

process_client_msg ensures that RCU read-side lock should not be held
when calling it. Validate this using rcu_read_ongoing() at the entry and
exit points of this function. This allows us to catch unbalanced RCU
read-side lock within commands quickly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoClean-up and simplify event_agent_disable_all
Jérémie Galarneau [Sun, 6 Sep 2015 23:40:42 +0000 (19:40 -0400)] 
Clean-up and simplify event_agent_disable_all

event_agent_disable_all contains comments which make no sense since
they were blindly copy-pasted from event_agent_enable_all.

Also add an error_unlock label instead of open coding the unlock
on error.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: disable agent events by name
Philippe Proulx [Wed, 2 Sep 2015 16:55:47 +0000 (12:55 -0400)] 
Fix: disable agent events by name

The event_agent_disable() function only disables the first
agent event matching a given name. However, if multiple agent
events exist with different loglevels, but share the same name,
we want all of them to be disabled at once.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agosessiond: add loglevels_match()
Philippe Proulx [Wed, 2 Sep 2015 15:31:35 +0000 (11:31 -0400)] 
sessiond: add loglevels_match()

UST and agent event loglevel matching algorithm is the same
so factor out this code into a common utility.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: include loglevel type in agent event's primary key
Philippe Proulx [Wed, 2 Sep 2015 05:54:23 +0000 (01:54 -0400)] 
Fix: include loglevel type in agent event's primary key

Refs: #913

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: include loglevel type in UST event's primary key
Philippe Proulx [Wed, 2 Sep 2015 02:53:30 +0000 (22:53 -0400)] 
Fix: include loglevel type in UST event's primary key

Refs: #913

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agosessiond: use `loglevel_value` and `loglevel_type` names
Philippe Proulx [Wed, 2 Sep 2015 01:52:40 +0000 (21:52 -0400)] 
sessiond: use `loglevel_value` and `loglevel_type` names

By using the `loglevel_value` and `loglevel_type` names instead
of `loglevel` for one or the other, some unsettling
inconsistencies are exposed.

This patch only changes the names to show the weird stuff, e.g.:

    key.loglevel_type = loglevel_value;

A future patch will fix this.

The only `loglevel` names left untouched are those in public headers
as well as those in the tools<->UST ABI.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: kernel wildcards
Mathieu Desnoyers [Fri, 4 Sep 2015 23:53:19 +0000 (19:53 -0400)] 
Tests: kernel wildcards

Fixes #920

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: fix wildcard test path
Jérémie Galarneau [Sun, 6 Sep 2015 17:52:00 +0000 (13:52 -0400)] 
Tests: fix wildcard test path

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