deliverable/lttng-tools.git
9 years agoFix: zero memory passed to create channel kernel ioctl
Mathieu Desnoyers [Mon, 6 Apr 2015 16:16:11 +0000 (12:16 -0400)] 
Fix: zero memory passed to create channel kernel ioctl

Valgrind complains about uninitialized memory passed to ioctl.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Check that lttng create --live's time is not zero
Jérémie Galarneau [Thu, 2 Apr 2015 22:44:58 +0000 (18:44 -0400)] 
Fix: Check that lttng create --live's time is not zero

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Validate lttng_create_session_live's timer is > 0
Jérémie Galarneau [Thu, 2 Apr 2015 22:37:18 +0000 (18:37 -0400)] 
Fix: Validate lttng_create_session_live's timer is > 0

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoUI: Only show live timer when the session is in live mode
Jérémie Galarneau [Thu, 2 Apr 2015 22:09:29 +0000 (18:09 -0400)] 
UI: Only show live timer when the session is in live mode

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoUI: Only show tracker PID state when enabled
Jérémie Galarneau [Thu, 2 Apr 2015 22:07:45 +0000 (18:07 -0400)] 
UI: Only show tracker PID state when enabled

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoImplement kernel filter support
Mathieu Desnoyers [Tue, 11 Nov 2014 21:31:40 +0000 (16:31 -0500)] 
Implement kernel filter support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agosyscall tracing: update tests
Mathieu Desnoyers [Wed, 5 Nov 2014 21:54:48 +0000 (16:54 -0500)] 
syscall tracing: update tests

Update syscall tracing tests following the semantic changes of enablers
in lttng-modules and disable behavior of lttng-sessiond.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoSupport lttng-modules syscall wildcards
Mathieu Desnoyers [Wed, 5 Nov 2014 00:14:19 +0000 (19:14 -0500)] 
Support lttng-modules syscall wildcards

While we are there, fix semantic issues with disable-event and various
types of instrumentation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 years agoImplement lttng-modules tracepoint wildcard support
Mathieu Desnoyers [Mon, 3 Nov 2014 20:52:36 +0000 (15:52 -0500)] 
Implement lttng-modules tracepoint wildcard support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix build when configuring with --disable-lttng-ust
Jérémie Galarneau [Tue, 31 Mar 2015 20:02:17 +0000 (16:02 -0400)] 
Fix build when configuring with --disable-lttng-ust

Mark trace_ust_list_tracker_pids as static inline to eliminate
"multiple definition" error.

Fix ust_app_global_update() stub to reflect the signature change
introduced by a9ad0c8f

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing function prototype to trace-ust.h header
Mathieu Desnoyers [Fri, 20 Mar 2015 19:16:11 +0000 (15:16 -0400)] 
Fix: add missing function prototype to trace-ust.h header

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoImplement PID tracker content listing
Mathieu Desnoyers [Wed, 28 Jan 2015 14:50:07 +0000 (09:50 -0500)] 
Implement PID tracker content listing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoImplement UST PID tracker
Mathieu Desnoyers [Mon, 26 Jan 2015 19:01:12 +0000 (14:01 -0500)] 
Implement UST PID tracker

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Remove unimplemented UST domains
Mathieu Desnoyers [Sun, 25 Jan 2015 15:08:10 +0000 (10:08 -0500)] 
Cleanup: Remove unimplemented UST domains

They will be implemented as options of the UST domains.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoImplement PID tracking for kernel tracing
Mathieu Desnoyers [Sat, 27 Sep 2014 21:29:12 +0000 (17:29 -0400)] 
Implement PID tracking for kernel tracing

Implement PID tracking (per-session) for kernel tracing. Only
save/restore and MI are missing.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: leak on error in lttng-crash
Mathieu Desnoyers [Fri, 27 Mar 2015 19:52:00 +0000 (15:52 -0400)] 
Fix: leak on error in lttng-crash

Found by Coverity:
** CID 1291945:  Resource leaks  (RESOURCE_LEAK)
/src/bin/lttng-crash/lttng-crash.c: 769 in copy_crash_data()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMan page fixes: missing --version option and typo
Jérémie Galarneau [Thu, 26 Mar 2015 21:38:17 +0000 (17:38 -0400)] 
Man page fixes: missing --version option and typo

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: add lttng-crash(1) man page
Jérémie Galarneau [Thu, 26 Mar 2015 21:37:07 +0000 (17:37 -0400)] 
Docs: add lttng-crash(1) man page

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: lttng-crash refers to "lttng"
Jérémie Galarneau [Thu, 26 Mar 2015 21:21:07 +0000 (17:21 -0400)] 
Docs: lttng-crash refers to "lttng"

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: possible use of uninitialized data in loglevel conversion funcs
Jérémie Galarneau [Thu, 26 Mar 2015 19:07:35 +0000 (15:07 -0400)] 
Fix: possible use of uninitialized data in loglevel conversion funcs

str will be uninitialized if inputstr[0] == '\0'

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: possible evaluation of garbage values in fini_validation_ctx()
Jérémie Galarneau [Thu, 26 Mar 2015 19:02:40 +0000 (15:02 -0400)] 
Fix: possible evaluation of garbage values in fini_validation_ctx()

Zero-out struct validation_ctx on creation.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Remove stale #ifdef-ed-out code from spawn_viewer()
Jérémie Galarneau [Thu, 26 Mar 2015 18:57:59 +0000 (14:57 -0400)] 
Cleanup: Remove stale #ifdef-ed-out code from spawn_viewer()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Possible call to execvp with NULL argument on allocation failure
Jérémie Galarneau [Thu, 26 Mar 2015 18:57:50 +0000 (14:57 -0400)] 
Fix: Possible call to execvp with NULL argument on allocation failure

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Possible call to strtoul() with NULL argument
Jérémie Galarneau [Thu, 26 Mar 2015 18:49:52 +0000 (14:49 -0400)] 
Fix: Possible call to strtoul() with NULL argument

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: clarify lttng.1 shm-path section
Jérémie Galarneau [Thu, 26 Mar 2015 16:51:31 +0000 (12:51 -0400)] 
Docs: clarify lttng.1 shm-path section

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Missing return value check in extract_trace_recursive()
Jérémie Galarneau [Wed, 25 Mar 2015 22:29:29 +0000 (18:29 -0400)] 
Fix: Missing return value check in extract_trace_recursive()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: recursive_rmdir: empty all empty subdir
Mathieu Desnoyers [Thu, 18 Dec 2014 03:28:04 +0000 (22:28 -0500)] 
Fix: recursive_rmdir: empty all empty subdir

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMove file creation/unlink from liblttng-ust-ctl to consumerd
Mathieu Desnoyers [Tue, 16 Dec 2014 01:24:46 +0000 (20:24 -0500)] 
Move file creation/unlink from liblttng-ust-ctl to consumerd

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agolttng-crash: support recursive traces
Mathieu Desnoyers [Mon, 15 Dec 2014 03:56:04 +0000 (22:56 -0500)] 
lttng-crash: support recursive traces

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoshm-path: remove directory hierarchy on destroy
Mathieu Desnoyers [Mon, 15 Dec 2014 03:29:53 +0000 (22:29 -0500)] 
shm-path: remove directory hierarchy on destroy

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoImplement --shm-path option for UST sessions (per-uid channels)
Mathieu Desnoyers [Tue, 8 Jul 2014 14:12:23 +0000 (10:12 -0400)] 
Implement --shm-path option for UST sessions (per-uid channels)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Reduce scope of connections in main relayd thread
Jérémie Galarneau [Fri, 27 Feb 2015 16:34:44 +0000 (11:34 -0500)] 
Cleanup: Reduce scope of connections in main relayd thread

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Reduce scope of relayd connections in live thread
Jérémie Galarneau [Fri, 27 Feb 2015 16:34:04 +0000 (11:34 -0500)] 
Cleanup: Reduce scope of relayd connections in live thread

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: connection_find_by_sock() must be called with rcu_read_lock
Jérémie Galarneau [Fri, 27 Feb 2015 04:09:35 +0000 (23:09 -0500)] 
Docs: connection_find_by_sock() must be called with rcu_read_lock

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRename current release as 2.7.0-pre
Jérémie Galarneau [Fri, 13 Feb 2015 17:23:02 +0000 (12:23 -0500)] 
Rename current release as 2.7.0-pre

This change is introduced to make the release name clearer than "master"
which may be misleading.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: grammar fix in Makefile
Jérémie Galarneau [Fri, 13 Feb 2015 16:57:54 +0000 (11:57 -0500)] 
Docs: grammar fix in Makefile

runned -> ran

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoChange release name to master
Jérémie Galarneau [Fri, 13 Feb 2015 16:52:06 +0000 (11:52 -0500)] 
Change release name to master

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoconfigure: add type availability checking
Jonathan Rajotte [Mon, 2 Feb 2015 21:33:57 +0000 (16:33 -0500)] 
configure: add type availability checking

Based on autoscan diagnostic

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoconfigure: add check for compiler inline keyword support
Jonathan Rajotte [Mon, 2 Feb 2015 21:33:56 +0000 (16:33 -0500)] 
configure: add check for compiler inline keyword support

Check support of the inline keyword by the compiler.
If not supported, inline is replaced by the appropriate keyword or nothing.[1]

Based on autoscan diagnostic

[1]http://www.gnu.org/software/autoconf/manual/autoconf.html#AC_005fC_005fINLINE

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoconfigure: missing check for needed header
Jonathan Rajotte [Mon, 2 Feb 2015 21:33:55 +0000 (16:33 -0500)] 
configure: missing check for needed header

Based on autoscan diagnostic:

autoscan: warning: missing AC_CHECK_HEADERS([arpa/inet.h]) wanted by:
src/common/uri.c:21
src/common/sessiond-comm/sessiond-comm.h:38
src/bin/lttng/utils.c:28
autoscan: warning: missing AC_CHECK_HEADERS([netdb.h]) wanted by:
src/common/uri.c:22
autoscan: warning: missing AC_CHECK_HEADERS([netinet/in.h]) wanted by:
src/common/uri.h:21
src/common/sessiond-comm/sessiond-comm.h:39
src/bin/lttng/utils.c:27
autoscan: warning: missing AC_CHECK_HEADERS([paths.h]) wanted by:
src/common/daemonize.c:22
src/bin/lttng-sessiond/main.c:25
autoscan: warning: missing AC_CHECK_HEADERS([stddef.h]) wanted by:
src/common/defaults.c:20
src/common/hashtable/rculfhash-mm-chunk.c:25
src/bin/lttng-sessiond/ust-clock.h:26
autoscan: warning: missing AC_CHECK_HEADERS([sys/file.h]) wanted by:
src/common/utils.c:34
autoscan: warning: missing AC_CHECK_HEADERS([sys/ioctl.h]) wanted by:
src/common/kernel-ctl/kernel-ctl.c:22
autoscan: warning: missing AC_CHECK_HEADERS([sys/mount.h]) wanted by:
src/bin/lttng-sessiond/main.c:33
src/bin/lttng-relayd/live.c:30
src/bin/lttng-relayd/main.c:31
autoscan: warning: missing AC_CHECK_HEADERS([sys/param.h]) wanted by:
src/common/hashtable/utils.c:57
autoscan: warning: missing AC_CHECK_HEADERS([sys/time.h]) wanted by:
src/common/compat/compat-poll.c:23
src/bin/lttng-sessiond/ust-clock.h:24
src/bin/lttng-sessiond/fd-limit.c:21

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoconfigure: missing check of functions
Jonathan Rajotte [Mon, 2 Feb 2015 21:33:54 +0000 (16:33 -0500)] 
configure: missing check of functions

Based on autoscan diagnostic

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: test: log4j: missing static test files for dist and out of tree build
Jonathan Rajotte [Fri, 30 Jan 2015 22:04:57 +0000 (17:04 -0500)] 
Fix: test: log4j: missing static test files for dist and out of tree build

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
9 years agoFix: test: java-jul:missing static test files for dist and out of tree build
Jonathan Rajotte [Fri, 30 Jan 2015 22:04:56 +0000 (17:04 -0500)] 
Fix: test: java-jul:missing static test files for dist and out of tree build

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
9 years agoFix: out-of-tree build: missing xsd file for mi test execution
Jonathan Rajotte [Fri, 30 Jan 2015 18:30:11 +0000 (13:30 -0500)] 
Fix: out-of-tree build: missing xsd file for mi test execution

This need to be backported to stable 2.6.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: out-of-tree build: missing xsd file for save-load test execution
Jonathan Rajotte [Fri, 30 Jan 2015 18:30:10 +0000 (13:30 -0500)] 
Fix: out-of-tree build: missing xsd file for save-load test execution

This need to be backported to stable 2.6 and stable 2.5

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: remove unused end_no_session label in ust_app_flush_session()
Jérémie Galarneau [Fri, 30 Jan 2015 06:47:56 +0000 (01:47 -0500)] 
Cleanup: remove unused end_no_session label in ust_app_flush_session()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Remove unused "end" label in push_metadata()
Jérémie Galarneau [Fri, 30 Jan 2015 06:47:11 +0000 (01:47 -0500)] 
Cleanup: Remove unused "end" label in push_metadata()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoTests: Run health check test_thread_ok as part of root_regression
Jérémie Galarneau [Mon, 26 Jan 2015 17:14:13 +0000 (12:14 -0500)] 
Tests: Run health check test_thread_ok as part of root_regression

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: deadlock between UST registry lock and consumer lock
Mathieu Desnoyers [Fri, 23 Jan 2015 16:29:00 +0000 (11:29 -0500)] 
Fix: deadlock between UST registry lock and consumer lock

Reorganize locking of ust registry and consumer socket communication.

commit ce34fcd0 "Fix: per-uid flush and ust registry locking" attempted
to fix locking related to the UST registry, but doing so introduced a
deadlock. The actual solution is to reverse the order in which the UST
registry and the consumer lock nest: the UST registry will now to
responsible for serializing the registry content, and the consumer lock
will only protect communication with the consumer, as it should. This
deals with a TODO in the code.

The reason why this was not done from the beginning is that there was
originally an intent to make sure the ust registry lock is not held for
a long time, thus not while communicating with the consumer daemon.
However, when live has been implemented, it required communication with
the consumer daemon while the ust registry is held anyway. Therefore,
there is not much point anymore in trying to make sure this lock is not
held across the communication with consumerd in push_metadata. This
allows us to greatly simplify locking of the UST registry.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: uninitialized return value
Mathieu Desnoyers [Fri, 23 Jan 2015 16:28:59 +0000 (11:28 -0500)] 
Fix: uninitialized 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: build failure using disable-lttng-ust configure option
Jérémie Galarneau [Thu, 22 Jan 2015 20:17:34 +0000 (15:17 -0500)] 
Fix: build failure using disable-lttng-ust configure option

A stub for ust_app_get_size_one_more_packet_per_stream() is missing
which causes the build to fail when using the --disable-lttng-ust
configuration option.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Remove unused variable
Jérémie Galarneau [Thu, 22 Jan 2015 20:04:35 +0000 (15:04 -0500)] 
Cleanup: Remove unused variable

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: setuid/setgid daemons should not get sensitive env. var./args
Mathieu Desnoyers [Fri, 16 Jan 2015 17:48:20 +0000 (12:48 -0500)] 
Fix: setuid/setgid daemons should not get sensitive env. var./args

Also, don't allow lttng command line interface to run as setuid/setgid
binary.

Fixes #780

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: grab more than one packet for snapshots
Mathieu Desnoyers [Thu, 15 Jan 2015 22:24:27 +0000 (17:24 -0500)] 
Fix: grab more than one packet for snapshots

There are a few issues with snapshot size: when taking a snapshot
without specifying any "max size" (should be unlimited), only a single
packet from each stream is saved. We expect all stream available content
to be saved. There is a similar issue when a max size is specified.

Also, trying to make all streams save as much data has unexpected
corner-cases: for instance, if we have this configuration:
- kernel channels: 2 subbuffers of 1MB x 8 CPUs
- per-PID UST channels: 16 subbuffers of 4kB x 8 CPUs x 100 apps

would require the user to have a very large max size, since it would try
to fit (8 + (100 * 8)) * 1MB = 808MB of sub-buffers, else it would fail.
This issue here is using the largest subbuffer size as the criterion
applied to all channels.

We fix those issues by simplifying the algorithm used to calculate how
much data to grab. Rather than calculating the size to grab from each
stream, we calculate a number of packets to grab. It fails if we cannot
grab at least one packet from each stream in the session. Then checks if
it can grab 2 packets from each stream, and so on, until there is no
more space available (based on max size). This is not a perfect
solution, but has the merit of being simple to understand, and has no
(or few) unexpected corner-cases.

Fixes #860

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: per-uid flush and ust registry locking
Mathieu Desnoyers [Thu, 15 Jan 2015 22:24:26 +0000 (17:24 -0500)] 
Fix: per-uid flush and ust registry locking

Commit c4b88406 "Fix: ust-app: per-PID app unregister vs tracing stop
races" introduces a regression for per-UID flush. It can be triggered by
the test_high_throughput_limits (root regression) test. For per-UID
tracing, we need to use the registry channel ID, not the per-application
channel ID, when asking the consumer daemon to flush.

When doing this fix, we notice that the locking rules of push_metadata()
are weird. A per-ust app session lock is protecting registry data, which
makes it impossible to call push_metadata from a ust session level (for
the entire session) in the case of per-UID tracing. Moreover, it's
unclear how holding a per-application lock can protect a registry shared
across applications in per-UID tracing. Therefore, we move all accesses
to the registry metadata_key and metadata_closed fields into the
registry lock critical section. We now only rely on RCU to ensure
existance of registry across push_metadata(), rather than relying on the
per-application session lock.

It also takes care of a documentation vs code mismatch: push_metadata()
documents that "The session lock MUST be acquired here before calling
this.", but in reality, it's the application session lock which is held
across those calls. Removing this requirement, and relying on RCU
instead, fixes this mismatch.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: Missing optional dependency on lttng-ust in README.md
Jérémie Galarneau [Thu, 15 Jan 2015 20:39:20 +0000 (15:39 -0500)] 
Docs: Missing optional dependency on lttng-ust in README.md

Reported-by: Jonathan Rajotte <jonathan.rajotte@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoDocs: Grammar fixes in the lttng manpage
Jérémie Galarneau [Wed, 14 Jan 2015 23:41:10 +0000 (18:41 -0500)] 
Docs: Grammar fixes in the lttng manpage

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing UST perf counter support check
Mathieu Desnoyers [Mon, 12 Jan 2015 22:14:52 +0000 (17:14 -0500)] 
Fix: add missing UST perf counter support check

Report whether performance counters are supported by UST on the
architecture as soon as the user try to enable a perf counter context.

Fixes #851

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: tests: integer too large for long type
Mathieu Desnoyers [Tue, 2 Dec 2014 22:21:12 +0000 (17:21 -0500)] 
Fix: tests: integer too large for long type

Compiler warns on 32-bit builds.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: undefined operation on last_relay_viewer_session_id
Mathieu Desnoyers [Tue, 2 Dec 2014 22:21:11 +0000 (17:21 -0500)] 
Fix: undefined operation on last_relay_viewer_session_id

Triggers compiler warning on 32-bit build.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: print format type mismatch
Mathieu Desnoyers [Tue, 2 Dec 2014 22:21:10 +0000 (17:21 -0500)] 
Fix: print format type mismatch

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: print format type mismatch
Mathieu Desnoyers [Tue, 2 Dec 2014 22:21:09 +0000 (17:21 -0500)] 
Fix: print format type mismatch

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Remove structurally dead code from relayd
Jérémie Galarneau [Thu, 8 Jan 2015 23:06:20 +0000 (18:06 -0500)] 
Fix: Remove structurally dead code from relayd

CID 1262070:  Structurally dead code  (UNREACHABLE)

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Remove logically dead code
Jérémie Galarneau [Thu, 8 Jan 2015 22:57:11 +0000 (17:57 -0500)] 
Cleanup: Remove logically dead code

*** CID 1262071:  Logically dead code  (DEADCODE)
/src/bin/lttng-sessiond/ht-cleanup.c: 130 in thread_ht_cleanup()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Remove unused label
Jérémie Galarneau [Thu, 8 Jan 2015 21:02:13 +0000 (16:02 -0500)] 
Cleanup: Remove unused label

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Remove unused argument in debug statement
Jérémie Galarneau [Thu, 8 Jan 2015 20:43:24 +0000 (15:43 -0500)] 
Fix: Remove unused argument in debug statement

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: exit threads not only on goto restart
Mathieu Desnoyers [Mon, 5 Jan 2015 21:43:08 +0000 (16:43 -0500)] 
Fix: exit threads not only on goto restart

Exit threads as soon as number of FD is 0, on every loop (no need for
goto restart special case). Number of FD being 0 is a sufficient
condition for exiting the thread: it means the quit pipe has been
removed from the poll set.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: poll: show the correct number of fds
Mathieu Desnoyers [Mon, 5 Jan 2015 21:43:07 +0000 (16:43 -0500)] 
Fix: poll: show the correct number of fds

LTTNG_POLL_GETNB() uses wait nb_fd, which is only updated after
lttng_poll_wait returns.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: call lttng_poll_set_max_size before start threads
Mathieu Desnoyers [Mon, 5 Jan 2015 21:43:06 +0000 (16:43 -0500)] 
Fix: call lttng_poll_set_max_size before start threads

This changes the location of lttng_poll_set_max_size() call within
sessiond main() to call it before creating the ht_cleanup thread. This
fix is only needed on top of the main refactoring patch.

This fix also adds checks for lttng_poll_set_max_size() error values.

Fixes #747

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: compat poll: add missing empty revents checks
Mathieu Desnoyers [Mon, 5 Jan 2015 21:43:05 +0000 (16:43 -0500)] 
Fix: compat poll: add missing empty revents checks

Poll returns the entire array, including entries that have no activity.
We need to check them explicitly.

Fixes #747

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: various compat poll/epoll issues
Mathieu Desnoyers [Mon, 5 Jan 2015 21:43:04 +0000 (16:43 -0500)] 
Fix: various compat poll/epoll issues

poll:
- fix two nb_fd off by one in "add",
- simplify array size calculation,
- add error checking,
- compress the content of array before resizing it on "del"
  (out-of-bound memory access issue),
- set wait.nb_fd = 0 when no FD are present in array on wait,
- remove need_realloc flag: this can be checked internally by comparing
  current->alloc_size and wait->alloc_size. Minimize the number of
  duplicated state.

epoll:
- add error checking,
- simplify array size calculation (make it similar to poll),
- Set default size when poll_max_size is 0 within
  compat_epoll_set_max_size(), which allow better error checking
  elsewhere in epoll compat code.

Fixes #747

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoAdd debugging output to ht-cleanup thread
Mathieu Desnoyers [Mon, 5 Jan 2015 21:43:03 +0000 (16:43 -0500)] 
Add debugging output to ht-cleanup thread

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: mi: snapshot: missing error handling for session name
Jonathan Rajotte [Tue, 6 Jan 2015 15:59:47 +0000 (10:59 -0500)] 
Fix: mi: snapshot: missing error handling for session name

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: ust-app: per-PID app unregister vs tracing stop races
Mathieu Desnoyers [Mon, 5 Jan 2015 02:25:09 +0000 (21:25 -0500)] 
Fix: ust-app: per-PID app unregister vs tracing stop races

There are various races with UST application unregister performed
concurrently with tracing stop operation when tracing with per-pid
buffers. This randomly affects availability of data shortly after the
data pending check returns that no more data is available.

ust_app_stop_trace_all() iterates on all applications in the ust_app_ht
hash table to issue a flush on all buffers. This is needed to ensure
that the sub-buffers being written to are made available to the
consumer, for both data consumption, and for the data pending check.
Failure to execute the sub-buffer flush makes following data pending
check return that there is no data in the buffers too early, thus
resulting in an incomplete trace.

It is therefore important that an application flushes all its buffers
before it is removed from the ust_app_ht.

This is where ust_app_unregister() needs to be fixed. Note that
ust_app_unregister() executes concurrently with
ust_app_stop_trace_all(), only taking the per-session lock. The order of
flush vs hash table removal therefore matters:

We need to push the metadata before removing application from
ust_app_ht. We also need to issue a flush for all application buffers
before removing the application from ust_app_ht.

Once this is fixed, there is yet another race, this time in
ust_app_flush_trace() (now renamed ust_app_flush_session()). It is
caused by the use of ustctl_sock_flush_buffer() which asks the
application to perform the buffer flush. Unfortunately, if the
application vanishes (not reachable anymore), but its unregistration has
not yet been processed by sessiond, then ust_app_stop_trace_all() will
fail to flush the application buffers, because
ustctl_sock_flush_buffer() will fail.

This final issue is fixed by asking the consumer daemon to flush the
associated channel rather than relying on the application.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: data pending: allow empty streams
Mathieu Desnoyers [Mon, 5 Jan 2015 02:25:08 +0000 (21:25 -0500)] 
Fix: data pending: allow empty streams

There are cases where a stream can be completely empty (no packet to
write) with UST: for instance, if a traced application is either
preempted for a long time, terminated, or stopped, between reserve and
commit. This will make the consumer consider that this stream has no
data ready. If this situation occurs in the first sub-buffer of a
stream, this stream will have no data at all (0 bytes).

Therefore, we need to let the data pending check consider that no data
is pending in this situation, otherwise it can make the data pending
check always return that there is data pending.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: ust snapshot: cleanup after error
Mathieu Desnoyers [Mon, 5 Jan 2015 02:25:07 +0000 (21:25 -0500)] 
Fix: ust snapshot: cleanup after error

The "break" statement on error skips the rest of the functions, thus
leaving test applications running after the end of the test, which is a
side-effect on the following tests.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Mismatching return type in ust_app_ht_alloc() stub
Jérémie Galarneau [Wed, 7 Jan 2015 21:46:53 +0000 (16:46 -0500)] 
Fix: Mismatching return type in ust_app_ht_alloc() stub

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: lock file already taken is error, not warning
Mathieu Desnoyers [Mon, 5 Jan 2015 20:58:49 +0000 (15:58 -0500)] 
Cleanup: lock file already taken is error, not warning

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: ust-app null pointer check needed for main refactoring
Mathieu Desnoyers [Mon, 5 Jan 2015 20:05:22 +0000 (15:05 -0500)] 
Fix: ust-app null pointer check needed for main refactoring

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: relayd: centralize thread stopping function
Mathieu Desnoyers [Thu, 18 Dec 2014 18:02:07 +0000 (13:02 -0500)] 
Cleanup: relayd: centralize thread stopping function

Rather than relying on having main.c and live.c threads both using the
same notification pipe from different stop_thread implementations,
centralize thread stop in one central function exposed to both main.c
and live.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: Replace all perror() uses by the PERROR macro
Jérémie Galarneau [Mon, 5 Jan 2015 21:30:41 +0000 (16:30 -0500)] 
Cleanup: Replace all perror() uses by the PERROR macro

PERROR prints the perror() message in our own logging format rather
than going straight to stderr.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRefactor relayd main/set_options/cleanup
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:24 +0000 (20:45 -0500)] 
Refactor relayd main/set_options/cleanup

- Enforce symmetry between allocation and teardown,
- Handle all errors,
- Return all errors as EXIT_FAILURE,
- Standardize on zero being success, nonzero being error,
  (rather than < 0 being error),
- Fix pthread PERROR: we need to store ret into errno before
  calling PERROR, since pthread API does not set errno,
- Join errors now fall-through, rather than rely on the OS
  to teardown the rest.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRefactor consumerd main/cleanup
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:23 +0000 (20:45 -0500)] 
Refactor consumerd main/cleanup

- Enforce symmetry between allocation and teardown,
- Handle all errors,
- Return all errors as EXIT_FAILURE,
- Standardize on zero being success, nonzero being error,
  (rather than < 0 being error),
- Fix pthread PERROR: we need to store ret into errno before
  calling PERROR, since pthread API does not set errno,
- Join errors now fall-through, rather than rely on the OS
  to teardown the rest.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoRefactor sessiond main/cleanup/ht-cleanup
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:22 +0000 (20:45 -0500)] 
Refactor sessiond main/cleanup/ht-cleanup

Main reason for this entire patchset: move teardown of ht-cleanup thread
_after_ the sessiond cleanup which needs to destroy hash tables. This
fixes leaks at sessiond teardown that makes the valgrind output hard to
use. As this has been done, various other issues with error handling,
leaks, and symmetry of allocation and teardown have been fixed, which
makes this a refactoring.

- Enforce symmetry between allocation and teardown,
- Handle all errors,
- Return all errors as EXIT_FAILURE,
- Standardize on zero being success, nonzero being error,
  (rather than < 0 being error),
- Fix pthread PERROR: we need to store ret into errno before
  calling PERROR, since pthread API does not set errno,
- Join errors now fall-through, rather than rely on the OS
  to teardown the rest.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMissing error handling: consumer_signal_init should return its error status
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:21 +0000 (20:45 -0500)] 
Missing error handling: consumer_signal_init should return its error status

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: consumerd: lines over 80 columns
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:20 +0000 (20:45 -0500)] 
Cleanup: consumerd: lines over 80 columns

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoCleanup: consumerd: use PERROR rather than perror
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:19 +0000 (20:45 -0500)] 
Cleanup: consumerd: use PERROR rather than perror

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoCleanup: lttng-consumerd: remove stale TODO comment
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:18 +0000 (20:45 -0500)] 
Cleanup: lttng-consumerd: remove stale TODO comment

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMisleading error handling: utils_create_pid_file() should return 0 on success
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:17 +0000 (20:45 -0500)] 
Misleading error handling: utils_create_pid_file() should return 0 on success

fprintf returns a positive value on success, which is used as return
value for utils_create_pid_file(), which is odd. This is in preparation
for main() refactoring.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMissing error handling: consumerd parse_args should return errors to caller
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:16 +0000 (20:45 -0500)] 
Missing error handling: consumerd parse_args should return errors to caller

In preparation for having main() handle the return value.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoMissing error handling: ust_app_ht_alloc should return error status
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:15 +0000 (20:45 -0500)] 
Missing error handling: ust_app_ht_alloc should return error status

In preparation for having sessiond main() handle the error.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: ust app leak on UST buffer creation error
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:14 +0000 (20:45 -0500)] 
Fix: ust app leak on UST buffer creation error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: leak on UST buffer registry creation error
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:13 +0000 (20:45 -0500)] 
Fix: leak on UST buffer registry creation error

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: agents ht leaks on destroy session
Mathieu Desnoyers [Thu, 18 Dec 2014 01:45:12 +0000 (20:45 -0500)] 
Fix: agents ht leaks on destroy session

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: add missing RCU read unlock
Mathieu Desnoyers [Wed, 24 Dec 2014 17:10:01 +0000 (12:10 -0500)] 
Fix: add missing RCU read unlock

Master commit 24eb8569dc841f318d7964ca9a0ad0a4f9508a8e
"Fix: Missing RCU read locks in syscall_list_channel()"

Introduces unbalanced RCU read-side lock/unlock. Should be applied to
master and stable-2.6.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: help message for Python agent mentions Java
Julien Desfossez [Fri, 12 Dec 2014 14:53:40 +0000 (09:53 -0500)] 
Fix: help message for Python agent mentions Java

Bad copy/paste.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: don't destroy the sockets if the snapshot was successful
Julien Desfossez [Tue, 9 Dec 2014 21:38:05 +0000 (16:38 -0500)] 
Fix: don't destroy the sockets if the snapshot was successful

Missing a goto to skip the error condition that was destroying the
relayd sockets even if a snapshot was successful. We want to keep them
open to reuse them for the next snapshots.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Missing RCU read locks in syscall_list_channel()
Jérémie Galarneau [Tue, 2 Dec 2014 03:07:03 +0000 (22:07 -0500)] 
Fix: Missing RCU read locks in syscall_list_channel()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: Missing RCU read lock in kernel_destroy_session()
Jérémie Galarneau [Tue, 2 Dec 2014 03:06:23 +0000 (22:06 -0500)] 
Fix: Missing RCU read lock in kernel_destroy_session()

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 years agoFix: channel names are not validated
Philippe Proulx [Thu, 27 Nov 2014 22:35:32 +0000 (17:35 -0500)] 
Fix: channel names are not validated

This patch ensures:

  1. A channel name does not contain any '/' character, since
     relative paths may be injected in the channel name
     otherwise (knowing that the channel name is eventually
     part of a file name)
  2. A channel name does not start with a '.' character, since
     trace readers (Babeltrace is one of them) could interpret
     files starting with a dot as hidden files and ignore
     them when opening the CTF trace

Fixes: #751
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.045277 seconds and 5 git commands to generate.