deliverable/lttng-ust.git
10 years agoFix: malloc wrapper: infinite recursion with compat TLS
Mathieu Desnoyers [Tue, 18 Mar 2014 14:27:03 +0000 (10:27 -0400)] 
Fix: malloc wrapper: infinite recursion with compat TLS

Fixes #765

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: lttng-ust needs -ldl for tracef()
Mathieu Desnoyers [Sat, 15 Mar 2014 13:43:26 +0000 (09:43 -0400)] 
Fix: lttng-ust needs -ldl for tracef()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: typo in lttng-ust.3
Mathieu Desnoyers [Sat, 15 Mar 2014 13:36:01 +0000 (09:36 -0400)] 
Fix: typo in lttng-ust.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: liblttng-ust-libc-wrapper recursive use of calloc
Mathieu Desnoyers [Sat, 15 Mar 2014 00:31:13 +0000 (20:31 -0400)] 
Fix: liblttng-ust-libc-wrapper recursive use of calloc

When built with URCU with --disable-compiler-tls, URCU tls-compat.h uses
calloc in its TLS compat layer. This is used by RCU read-side, which is
used by tracepoint. So using a tracepoint in calloc triggers an infinite
recursion, since its first use of the TLS (with TLS compat) calls
calloc.

Fix this issue by keeping a per-thread nesting counter, and as soon as
we are allocating memory from a context nested within the memory
allocator, don't trace.

Don't trace from the static allocator: keep it as simple as possible,
since this is our fallback.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: add demo-tracef to dist tarball
Mathieu Desnoyers [Fri, 14 Mar 2014 22:24:16 +0000 (18:24 -0400)] 
Fix: add demo-tracef to dist tarball

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: add missing header files for tracef
Mathieu Desnoyers [Fri, 14 Mar 2014 21:34:41 +0000 (17:34 -0400)] 
Fix: add missing header files for tracef

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoImplement tracef() instrumentation API
Mathieu Desnoyers [Thu, 12 Dec 2013 12:29:26 +0000 (07:29 -0500)] 
Implement tracef() instrumentation API

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAdd 'unused' attribute to tracepoint callback
Zifei Tong [Fri, 14 Mar 2014 13:23:21 +0000 (21:23 +0800)] 
Add 'unused' attribute to tracepoint callback

Compiling tracepoint provider with clang generates 'Wunused-function'
warnings. Add 'unused' attribute to silence these warnings.

Fixes #760

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoUse autoconf AM_MAINTAINER_MODE
Lars Persson [Wed, 12 Mar 2014 09:28:49 +0000 (10:28 +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: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: mismatch between code and comments
Zifei Tong [Tue, 4 Mar 2014 12:50:14 +0000 (20:50 +0800)] 
Fix: mismatch between code and comments

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: incorrect urcu git URL in README
Mathieu Desnoyers [Mon, 10 Mar 2014 15:16:35 +0000 (11:16 -0400)] 
Fix: incorrect urcu git URL in README

Reported-by: Ruslan Uvashev <ruslan.uvashev@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.4.0
Mathieu Desnoyers [Fri, 28 Feb 2014 18:33:51 +0000 (13:33 -0500)] 
Version 2.4.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: JUL test: update to API change
Mathieu Desnoyers [Fri, 28 Feb 2014 18:26:28 +0000 (13:26 -0500)] 
Fix: JUL test: update to API change

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: Cast from pointer to different integer size warning
Mathieu Desnoyers [Fri, 28 Feb 2014 15:40:33 +0000 (10:40 -0500)] 
Fix: Cast from pointer to different integer size warning

Occurs on a 32-bit build. Caused by casting pointer arguments to 64-bit
integers (in the filter stack preparation code).

Fixes #691

Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoTurn base address dump into experimental feature
Paul Woegerer [Fri, 28 Feb 2014 09:02:00 +0000 (10:02 +0100)] 
Turn base address dump into experimental feature

Instead of having base address state dump enabled by default make it
necessary to explicitly enable it with environment variable
LTTNG_UST_WITH_EXPERIMENTAL_BADDR_STATEDUMP.

Documentation is updated to reflect this change and explain about the
experimental nature of this feature.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: JUL support multiple loglevels
David Goulet [Thu, 27 Feb 2014 19:51:55 +0000 (14:51 -0500)] 
Fix: JUL support multiple loglevels

Fixes #744

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: Skip lttng-gen-tp example build if Python is missing
Jérémie Galarneau [Thu, 27 Feb 2014 17:30:41 +0000 (12:30 -0500)] 
Fix: Skip lttng-gen-tp example build if Python is missing

Fixes #665

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: dynamically fetch the session daemon port
David Goulet [Thu, 27 Feb 2014 16:53:22 +0000 (11:53 -0500)] 
Fix: dynamically fetch the session daemon port

When connecting to the session daemon, fetch the port at each try. This
moves the read port file functions to the TCP session daemon client
where the connect happens.

If the port file is not found, simply retry 3 seconds later. Also, this
adds a timeout to the acquire semaphore of 3 seconds.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: JUL agent connect to user and root sessiond
David Goulet [Thu, 27 Feb 2014 15:06:52 +0000 (10:06 -0500)] 
Fix: JUL agent connect to user and root sessiond

In order to achieve such a thing, two tracepoints are used where one is
for the regular user and the other one for root. This is to avoid
duplicating the payload in the user and root traces.

Furthermore, if a root port is found, a new thread is started to handle
the second session daemon.

This is lockstep commit with lttng-tools:
f43f95a9a82e01eed34593260d510bd32e2083ec

Fixes #732

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoFix: handle registration done command
David Goulet [Wed, 26 Feb 2014 21:06:31 +0000 (16:06 -0500)] 
Fix: handle registration done command

This makes the getLTTngAgent() call wait until we receive that message
so that in the meantime the session daemon can enable events.

Fixes #692

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: Unsynchronized access in LTTngTCPSessiondClient
Jérémie Galarneau [Tue, 25 Feb 2014 21:32:05 +0000 (16:32 -0500)] 
Fix: Unsynchronized access in LTTngTCPSessiondClient

enabledEventList is shared between the LTTngThread and eventTimer
threads but is not synchronized.

This patch changes enabledEventList's type from an ArrayList to a
synchronized HashSet.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCleanup: fix comment
Mathieu Desnoyers [Tue, 25 Feb 2014 11:43:46 +0000 (06:43 -0500)] 
Cleanup: fix comment

Fixes #652

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: Dump executable base-address with readlink
Paul Woegerer [Tue, 25 Feb 2014 09:47:00 +0000 (10:47 +0100)] 
Fix: Dump executable base-address with readlink

The previous approach only worked if the traced executable was invoked
via its fully qualified path. Using readlink to determine the full
qualified path of the traced executable works reliably even when the
traced executable is started via PATH lookup.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: add assert for NULL dereference
Mathieu Desnoyers [Fri, 21 Feb 2014 18:16:20 +0000 (13:16 -0500)] 
Fix: add assert for NULL dereference

CID 1021248 (#1 of 1): Dereference null return value (NULL_RETURNS)3.
dereference: Dereferencing a null pointer "obj".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: tracepoint out of memory handling
Mathieu Desnoyers [Fri, 21 Feb 2014 18:13:14 +0000 (13:13 -0500)] 
Fix: tracepoint out of memory handling

CID 1021247 (#1 of 1): Dereference null return value (NULL_RETURNS)3.
dereference: Dereferencing a null pointer "pl".

Handle more gracefully add_callsite memory allocation failure too.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: dereference before null check
Mathieu Desnoyers [Fri, 21 Feb 2014 18:00:59 +0000 (13:00 -0500)] 
Fix: dereference before null check

Found by Coverity:
CID 1090602 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking "stream" suggests that it may be null,
but it has already been dereferenced on all paths leading to the check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCleanup: remove logically dead code
Mathieu Desnoyers [Fri, 21 Feb 2014 17:54:07 +0000 (12:54 -0500)] 
Cleanup: remove logically dead code

CID 1021235 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line:
Execution cannot reach this statement "case LTTNG_UST_LOGLEVEL_ALL:".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: handle sysconf errors
Mathieu Desnoyers [Fri, 21 Feb 2014 16:01:01 +0000 (11:01 -0500)] 
Fix: handle sysconf errors

CID 1021261 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)10.
negative_returns: "sysconf(30)" is passed to a parameter that cannot be
negative.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: java-jul/Makefile should not be marked as a binary
Jérémie Galarneau [Tue, 18 Feb 2014 18:59:35 +0000 (13:59 -0500)] 
Fix: java-jul/Makefile should not be marked as a binary

java-jul/Makefile is part of bin_SCRIPTS which causes it to be
installed under /usr/local/bin.

It is already installed as an example.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.4.0-rc4
Mathieu Desnoyers [Fri, 14 Feb 2014 16:42:38 +0000 (11:42 -0500)] 
Version 2.4.0-rc4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCleanup: remove extra space in dlerror wrapper
Mathieu Desnoyers [Fri, 14 Feb 2014 15:13:32 +0000 (10:13 -0500)] 
Cleanup: remove extra space in dlerror wrapper

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: work-around glibc lying about dlsym()/dlerror() leafness
Mathieu Desnoyers [Fri, 14 Feb 2014 15:02:51 +0000 (10:02 -0500)] 
Fix: work-around glibc lying about dlsym()/dlerror() leafness

Especially in the LTTng-UST malloc instrumentation, we run into the
following situation:

1) Our calloc wrapper is called,
2) we setup the static allocator,
3) we call dlsym() to lookup the symbol of the real allocator,
4) dlsym() calls into calloc(), which is overridden by our own wrapper.
   Our calloc does not see that the static allocator has been set,
   because the stores setting up the static allocator have been optimized
   away by gcc-4.8 (in O2), because the dlsym() prototype declares it
   with the "leaf" attribute, and thus we end up doing an infinite
   recursion, and eventually a segmentation fault.

Thanks to Alexander Monakov for pointing out the culprit of this glibc
bug.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCleanup: add lttng_ust_malloc_wrapper_init prototype to header
Mathieu Desnoyers [Wed, 12 Feb 2014 22:00:58 +0000 (17:00 -0500)] 
Cleanup: add lttng_ust_malloc_wrapper_init prototype to header

Ensure the weak symbol prototype matches the non-weak function.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: malloc libc instrumentation wrapper
Mathieu Desnoyers [Sat, 8 Feb 2014 22:12:16 +0000 (17:12 -0500)] 
Fix: malloc libc instrumentation wrapper

calloc and realloc wrt dlsym and dlerror can trigger segmentation
faults. Ensure that we fully populate the allocator symbols all at once,
and also ensure that we use the static allocator while doing the dlsym
lookups.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: add LTTngEvent class to fix delayed logger
David Goulet [Fri, 7 Feb 2014 20:09:12 +0000 (15:09 -0500)] 
Fix: add LTTngEvent class to fix delayed logger

This commit introduces a new object called LTTngEvent that represent a
LTTng event containing some attributes, for now loglevel data.

Instead of moving event string name around, this object is created once
and kept in the log handler so once a record is publish we can match
attributes such as loglevels.

This has to be done in order to fix the issue where we have a Logger
that appears later on during runtime (with the timer that poll every 5
seconds). With a created event object we can lookup back the event
attributes and enabled it accordingly. Same goes with the * (all events)
where we now keep the loglevel values process wide so we can force the
new events to use it.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: FD leak in liblttng-ust-ctl
Mathieu Desnoyers [Fri, 7 Feb 2014 16:54:06 +0000 (11:54 -0500)] 
Fix: FD leak in liblttng-ust-ctl

Make sure wait/wakeup stream and channel FDs are closed at teardown.
This led to FD leaks on the consumer daemon when the relay daemon
disconnects unexpectedly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: liblttng-ust-dl Makefile flags mismatch
Mathieu Desnoyers [Wed, 5 Feb 2014 00:38:48 +0000 (19:38 -0500)] 
Fix: liblttng-ust-dl Makefile flags mismatch

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: liblttng-ust-fork Makefile flags mismatch
Mathieu Desnoyers [Wed, 5 Feb 2014 00:38:19 +0000 (19:38 -0500)] 
Fix: liblttng-ust-fork Makefile flags mismatch

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: out of tree examples build
Mathieu Desnoyers [Tue, 4 Feb 2014 20:08:25 +0000 (15:08 -0500)] 
Fix: out of tree examples build

Fixes #664
Fixes #703

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: C++: incomplete extern C guard transition
Mathieu Desnoyers [Mon, 3 Feb 2014 18:41:35 +0000 (13:41 -0500)] 
Fix: C++: incomplete extern C guard transition

Recently, commits to fix SDT issues with extern C
(https://bugs.lttng.org/issues/597) brougt in compile errors when the
tracepoint is defined in the same file where the tracepoint provider is
created.

This was due to the presence of extern C guards in tracepoint-event.h, a
header dedicated to tracepoint probe provider compilation. After commits
"Tracepoint probes don't need extern C", it should have gone away. This
is the main fix done by this patch.

This patch also adds missing extern C guards in ust-error.h and
ust-events.h.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.4.0-rc3
Mathieu Desnoyers [Wed, 29 Jan 2014 16:54:41 +0000 (11:54 -0500)] 
Version 2.4.0-rc3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: add missing JUL loglevel handling
David Goulet [Tue, 28 Jan 2014 22:29:09 +0000 (17:29 -0500)] 
Fix: add missing JUL loglevel handling

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCleanup gen-tp: add quotes around AM_CC
Mathieu Desnoyers [Tue, 14 Jan 2014 15:00:08 +0000 (10:00 -0500)] 
Cleanup gen-tp: add quotes around AM_CC

Would deal with spaces in the env. var. if there are any. It does not
seem to be important in practice (currently), because automake seems to
fail on CC including spaces at configure time.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoPass the CC variable to the example Makefiles
Jérémie Galarneau [Fri, 10 Jan 2014 21:38:05 +0000 (16:38 -0500)] 
Pass the CC variable to the example Makefiles

Cross-compilation fails when using the --host configure option
since the cross-compiler is not invoked by the hand-made Makefiles
in doc/examples.

The CC variable must be passed explicitly to ensure the host's
default compiler is not invoked.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agocleanup ust_baddr and ust_baddr_statedump doc
Mathieu Desnoyers [Wed, 8 Jan 2014 15:13:11 +0000 (10:13 -0500)] 
cleanup ust_baddr and ust_baddr_statedump doc

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agobaddr: add ust_baddr and ust_baddr_statedump doc
Paul Woegerer [Thu, 19 Dec 2013 15:21:19 +0000 (16:21 +0100)] 
baddr: add ust_baddr and ust_baddr_statedump doc

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: baddr_statedump tracepoint registration
Mathieu Desnoyers [Mon, 16 Dec 2013 13:36:06 +0000 (08:36 -0500)] 
Fix: baddr_statedump tracepoint registration

Make sure that the ust_baddr_statedump probe is registered prior to
using the tracepoint in lttng_ust_baddr_statedump(). This fix solves the
issue that in rare cases the very first ust_baddr_statedump events were
missing.

Use a reference counting approach that allows constructors/destructors
of the probe to be called many times, as long as the number of calls to
constructor matches the number of calls to destructor.

Reported-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: baddr out of tree build
Mathieu Desnoyers [Wed, 11 Dec 2013 16:29:23 +0000 (11:29 -0500)] 
Fix: baddr out of tree build

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.4.0-rc2
Mathieu Desnoyers [Tue, 10 Dec 2013 19:17:34 +0000 (14:17 -0500)] 
Version 2.4.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: baddr_statedump tracepoint registration
Paul Woegerer [Tue, 10 Dec 2013 13:07:51 +0000 (14:07 +0100)] 
Fix: baddr_statedump tracepoint registration

Ensure baddr_statedump tracepoint registration is completed prior to
using the tracepoint in lttng_ust_baddr_statedump().

Make liblttng-ust-dl robust for explicit baddr_statedump tracepoint
deregistration in lttng_ust_cleanup() (prevent dlopen/dlclose to get
traced if ust_baddr tracepoints are not available).

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: baddr deadlocks and RCU races
Mathieu Desnoyers [Sun, 8 Dec 2013 15:28:47 +0000 (10:28 -0500)] 
Fix: baddr deadlocks and RCU races

Fix deadlocks wrt internal libc mutexes.

Fix RCU races by ensuring every UST source file using RCU read-side lock
is marked as _LGPL_SOURCE. The dynamic binding to urcu-bp relies on the
dynamic loader, and it seems not to behave well when used from
constructors.

Use Userspace RCU with this commit to completely fix baddr races:

"Fix: urcu-bp interaction with threads vs constructors/destructors"

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: lock exit mutex when creating threads
Mathieu Desnoyers [Wed, 4 Dec 2013 22:08:17 +0000 (23:08 +0100)] 
Fix: lock exit mutex when creating threads

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: baddr deadlock with lttng-ust destructor
Mathieu Desnoyers [Tue, 3 Dec 2013 21:47:52 +0000 (22:47 +0100)] 
Fix: baddr deadlock with lttng-ust destructor

Was hanging lttng-tools tests/regression/ust/overlap/test_overlap

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agobaddr: include missing header
Mathieu Desnoyers [Tue, 3 Dec 2013 17:08:09 +0000 (18:08 +0100)] 
baddr: include missing header

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agobaddr: get session under lock
Mathieu Desnoyers [Tue, 3 Dec 2013 17:04:17 +0000 (18:04 +0100)] 
baddr: get session under lock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: take the ust lock around session iteration in statedump
Mathieu Desnoyers [Sat, 30 Nov 2013 14:42:50 +0000 (15:42 +0100)] 
Fix: take the ust lock around session iteration in statedump

This is crafted _very_ carefully: we need to always take the ust lock
_within_ the dynamic loader lock.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: baddr_statedump deadlock with JUL tracing
Paul Woegerer [Fri, 29 Nov 2013 13:32:54 +0000 (14:32 +0100)] 
Fix: baddr_statedump deadlock with JUL tracing

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: client_packet_header() uses wrong packet
Mathieu Desnoyers [Sat, 30 Nov 2013 10:47:05 +0000 (11:47 +0100)] 
Fix: client_packet_header() uses wrong packet

It should use lib_ring_buffer_read_offset_address() to get the packet
being read, rather than lib_ring_buffer_offset_address(), which is only
meant to be used when writing to the packet.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCleanup: fix typo in ring buffer backend comment
Mathieu Desnoyers [Sat, 30 Nov 2013 10:45:51 +0000 (11:45 +0100)] 
Cleanup: fix typo in ring buffer backend comment

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoCompile liblttng-ust-baddr c files into liblttng-ust
Mathieu Desnoyers [Thu, 28 Nov 2013 15:38:52 +0000 (16:38 +0100)] 
Compile liblttng-ust-baddr c files into liblttng-ust

Move them into liblttng-ust/, where they are now compiled.

This is to ensure we don't rely on statically linked libs (and
associated constructor problems), and that we don't install a shared
object in the system needlessly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAllow suppressing of base-address-state tracing
Paul Woegerer [Thu, 28 Nov 2013 12:26:54 +0000 (13:26 +0100)] 
Allow suppressing of base-address-state tracing

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoIntegrate base-address statedump into lttng-ust
Paul Woegerer [Thu, 28 Nov 2013 12:26:52 +0000 (13:26 +0100)] 
Integrate base-address statedump into lttng-ust

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: eliminate timestamp overlap between packets
Mathieu Desnoyers [Sun, 24 Nov 2013 09:11:16 +0000 (04:11 -0500)] 
Fix: eliminate timestamp overlap between packets

By using the timestamp sampled at space reservation when the packet is
being filled as "end timestamp" for a packet, we can ensure there is no
overlap between packet timestamp ranges, so that packet timestamp end <=
following packets timestamp begin.

Overlap between consecutive packets becomes an issue when the end
timestamp of a packet is greater than the end timestamp of a following
packet, IOW a packet completely contains the timestamp range of a
following packet.  This kind of situation does not allow trace viewers
to do binary search within the packet timestamps. This kind of situation
will typically never occur if packets are significantly larger than
event size, but this fix ensures it can never even theoretically happen.

The only case where packets can still theoretically overlap is if they
have equal begin and end timestamps, which is valid.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: lttng-gen-tp to build out of tree
David Goulet [Fri, 22 Nov 2013 19:16:39 +0000 (14:16 -0500)] 
Fix: lttng-gen-tp to build out of tree

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: compile doc/ after JUL/Java
David Goulet [Fri, 22 Nov 2013 18:50:01 +0000 (13:50 -0500)] 
Fix: compile doc/ after JUL/Java

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoJUL: add Hello.java in doc/examples
David Goulet [Wed, 20 Nov 2013 20:24:02 +0000 (15:24 -0500)] 
JUL: add Hello.java in doc/examples

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix lttng-ust(3) manpage
Mathieu Desnoyers [Sat, 23 Nov 2013 17:55:44 +0000 (12:55 -0500)] 
Fix lttng-ust(3) manpage

Describe that TRACEPOINT_CREATE_PROBES is needed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoJUL: fix enable all event for delayed Logger
David Goulet [Wed, 20 Nov 2013 16:35:35 +0000 (11:35 -0500)] 
JUL: fix enable all event for delayed Logger

This adds a HashMap containing the enabled Logger names (and wildcard
'*'). This is used to make sure we don't enable twice the same Logger
for the '*' event name (enable all -a).

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: typo in JNICALL for the JUL tracepoint
David Goulet [Wed, 20 Nov 2013 15:04:04 +0000 (10:04 -0500)] 
Fix: typo in JNICALL for the JUL tracepoint

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: move va_end to outermost label
Mathieu Desnoyers [Tue, 19 Nov 2013 02:16:06 +0000 (21:16 -0500)] 
Fix: move va_end to outermost label

Coverity:

** CID 1021237:  Missing varargs init or cleanup  (VARARGS)
/snprintf/vfprintf.c: 955 in ust_safe_vfprintf()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: add missing NULL check after allocation
Mathieu Desnoyers [Tue, 19 Nov 2013 02:07:13 +0000 (21:07 -0500)] 
Fix: add missing NULL check after allocation

Found by coverity:

** CID 1021246:  Dereference null return value  (NULL_RETURNS)
/libringbuffer/shm.c: 80 in shm_object_table_create()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix cleanup: all spaces before flags
Mathieu Desnoyers [Fri, 15 Nov 2013 19:52:41 +0000 (14:52 -0500)] 
Fix cleanup: all spaces before flags

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agofix: lttng-gen-tp: add missing spaces around flags
Mathieu Desnoyers [Fri, 15 Nov 2013 19:43:45 +0000 (14:43 -0500)] 
fix: lttng-gen-tp: add missing spaces around flags

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoVersion 2.4.0-rc1
Mathieu Desnoyers [Fri, 15 Nov 2013 18:55:22 +0000 (13:55 -0500)] 
Version 2.4.0-rc1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agodoc/examples: error out when a subdir make fails
Mathieu Desnoyers [Fri, 15 Nov 2013 18:48:28 +0000 (13:48 -0500)] 
doc/examples: error out when a subdir make fails

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoJUL: fix out of tree build
Mathieu Desnoyers [Fri, 15 Nov 2013 18:24:40 +0000 (13:24 -0500)] 
JUL: fix out of tree build

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoJava/jul: fix make dist
Mathieu Desnoyers [Fri, 15 Nov 2013 17:17:02 +0000 (12:17 -0500)] 
Java/jul: fix make dist

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoJUL: install documentation and jar file
Mathieu Desnoyers [Fri, 15 Nov 2013 16:59:46 +0000 (11:59 -0500)] 
JUL: install documentation and jar file

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAdd missing copyrights to test scripts
Mathieu Desnoyers [Fri, 15 Nov 2013 15:46:08 +0000 (10:46 -0500)] 
Add missing copyrights to test scripts

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoEscape minus signs in lttng-ust-cyg-profile manpage
Jon Bernard [Fri, 15 Nov 2013 14:12:47 +0000 (09:12 -0500)] 
Escape minus signs in lttng-ust-cyg-profile manpage

By default, "-" chars are interpreted as hyphens (U+2010) by groff, not
as minus signs (U+002D). Since options to programs use minus signs
(U+002D), this means for example in UTF-8 locales that you cannot cut
and paste options, nor search for them easily.

Source: http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html

Signed-off-by: Jon Bernard <jbernard@tuxion.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix spelling mistake in lttng-ust manpage
Jon Bernard [Fri, 15 Nov 2013 14:12:33 +0000 (09:12 -0500)] 
Fix spelling mistake in lttng-ust manpage

Signed-off-by: Jon Bernard <jbernard@tuxion.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix tests/benchmark
Zifei Tong [Fri, 15 Nov 2013 15:04:55 +0000 (23:04 +0800)] 
Fix tests/benchmark

Add copyright notice.

Remove extern C guard with respect to #597.

Signed-off-by: Zifei Tong <soariez@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoImplement base-address-state tracing
Paul Woegerer [Thu, 14 Nov 2013 18:39:49 +0000 (19:39 +0100)] 
Implement base-address-state tracing

Dump the base-address state (executable and shared objects) into session
on session-enable (per-session events).

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoBase-address tracing for dlopen and dlclose
Paul Woegerer [Thu, 14 Nov 2013 17:03:25 +0000 (18:03 +0100)] 
Base-address tracing for dlopen and dlclose

Provide an LD_PRELOAD library to allow tracing of calls to dlopen and
dlclose.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAdd a check against excluders
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:35 +0000 (12:22 +0200)] 
Add a check against excluders

When matching enablers with events, first check against all
excluders of the enabler. If the event matches with any of the excluders,
then the event does not match with the enabler.

[ Edit by Mathieu Desnoyers: apply coding style changes. ]

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAdd handler for LTTNG_UST_EXCLUSION in UST ABI
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:34 +0000 (12:22 +0200)] 
Add handler for LTTNG_UST_EXCLUSION in UST ABI

Add message handler for the LTTNG_UST_EXCLUSION command in
UST ABI. Copy the exclusion data into a lttng_ust_excluder_node
structure and pass it to the enabler command handler.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoStore exclusions to enablers
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:33 +0000 (12:22 +0200)] 
Store exclusions to enablers

Implement a function that adds exclusions to the list in the enabler.
Call this function in the enabler command handler when the
LTTNG_UST_EXCLUSION command is received.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoAdd excluders to enabler structure
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:32 +0000 (12:22 +0200)] 
Add excluders to enabler structure

Define a structure that holds excluders and can be used in lists.
Add a list holding these structures to the enabler structure.
Initialize and destroy the list when the enabler is initialized
and destroyed.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoSend exclusion data through ustcomm
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:31 +0000 (12:22 +0200)] 
Send exclusion data through ustcomm

Define a function ustctl_set_exclusion that sends the
exclusion data through ustcomm with the LTTNG_UST_EXCLUSION
command message.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoDefine exclusion structure for UST ABI
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:30 +0000 (12:22 +0200)] 
Define exclusion structure for UST ABI

Define a structure for holding exception data. The last data item
is a flexible array that contains a variable number of
exclusions names.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoDefine a new command LTTNG_UST_EXCLUSION
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:29 +0000 (12:22 +0200)] 
Define a new command LTTNG_UST_EXCLUSION

Define a new command id for attaching exclusions to enablers.
Define the structure for passing the command.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: package of LTTngUst.h was renamed without renaming target in makefile
Michael Jeanson [Wed, 13 Nov 2013 17:21:47 +0000 (12:21 -0500)] 
Fix: package of LTTngUst.h was renamed without renaming target in makefile

Signed-off-by: Michael Jeanson <mjeanson@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: check for java .class in package subfolders
Michael Jeanson [Wed, 13 Nov 2013 17:16:18 +0000 (12:16 -0500)] 
Fix: check for java .class in package subfolders

Signed-off-by: Michael Jeanson <mjeanson@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 years agoFix: java library to use user define JDK at compile time
David Goulet [Mon, 11 Nov 2013 17:52:23 +0000 (12:52 -0500)] 
Fix: java library to use user define JDK at compile time

Signed-off-by: David Goulet <dgoulet@efficios.com>
10 years agoAdd liblttng-ust-jul for JUL support
David Goulet [Thu, 7 Nov 2013 21:34:23 +0000 (16:34 -0500)] 
Add liblttng-ust-jul for JUL support

The build system creates a jar file named liblttng-ust-jul.jar to be
linked with the Java application. A public library named
liblttng-ust-jul.so is also created and must be in the library path of
the Java application in order for the LTTngAgent to use it for the
tracer's JNI call.

A unit test is also added and integrated with the "make check" command.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: application SIGBUS when starting in parallel with sessiond
Mathieu Desnoyers [Wed, 6 Nov 2013 12:03:10 +0000 (07:03 -0500)] 
Fix: application SIGBUS when starting in parallel with sessiond

There is a race between application startup and sessiond startup, where
there is an intermediate state where applications can SIGBUS if they see
a zero-sized shm, if the shm has been created, but not ftruncated yet.

On the UST side, fix this by ensuring that UST can read the shared
memory file descriptor with a read() system call before they try
accessing it through a memory map (which triggers the SIGBUS if the
access goes beyond the file size).

On the sessiond side, another commit needs to ensure that the shared
memory is writeable by applications as long as its size is 0, which
allow applications to perform ftruncate and extend its size.

Fixes #623

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: Minor corrections to the lttng-ust man page
Jérémie Galarneau [Wed, 23 Oct 2013 16:09:06 +0000 (12:09 -0400)] 
Fix: Minor corrections to the lttng-ust man page

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoDocumentation cleanup: Overhaul of the lttng-gen-tp man page
Jérémie Galarneau [Wed, 23 Oct 2013 16:08:15 +0000 (12:08 -0400)] 
Documentation cleanup: Overhaul of the lttng-gen-tp man page

Fix a couple of typos, mistakes and out-of date informations.

[Mathieu: added extra fix recommended by Daniel Thibault]

Acked-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoWarning cleanup: add missing padding initializer
Mathieu Desnoyers [Thu, 31 Oct 2013 12:21:55 +0000 (08:21 -0400)] 
Warning cleanup: add missing padding initializer

Reported-by: Marcus Tomlinson <themarcustomlinson@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: socket connect hang on heavy loads
Mathieu Desnoyers [Fri, 11 Oct 2013 19:03:24 +0000 (15:03 -0400)] 
Fix: socket connect hang on heavy loads

We need to perform both connect and sending registration message before
doing the next connect otherwise we may reach unix socket connect queue
max limits and block on the 2nd connect while the session daemon is
awaiting the first connect registration message.

This happens in scenarios where unix socket connect queues are nearly
full.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.042759 seconds and 5 git commands to generate.