lttng-ust.git
7 years agoVersion 2.6.7 stable-2.6 v2.6.7
Mathieu Desnoyers [Fri, 20 May 2016 21:49:06 +0000 (17:49 -0400)] 
Version 2.6.7

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoPrint DBG() message about compiler weak hidden symbol behavior
Mathieu Desnoyers [Fri, 20 May 2016 19:23:06 +0000 (15:23 -0400)] 
Print DBG() message about compiler weak hidden symbol behavior

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoDocumentation: ring buffer: SWITCH_FLUSH can be used when active
Mathieu Desnoyers [Wed, 18 May 2016 14:06:45 +0000 (10:06 -0400)] 
Documentation: ring buffer: SWITCH_FLUSH can be used when active

Snapshot mode tracing may use SWITCH_FLUSH while tracing is active.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: unchecked return value in trace_clock_read64_monotonic
Mathieu Desnoyers [Tue, 17 May 2016 16:05:10 +0000 (12:05 -0400)] 
Fix: unchecked return value in trace_clock_read64_monotonic

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: Java agent should use LTTNG_HOME
Mathieu Desnoyers [Wed, 11 May 2016 00:37:36 +0000 (20:37 -0400)] 
Fix: Java agent should use LTTNG_HOME

Both in UST C/C++ support and Python agent, LTTNG_HOME can be used to
override HOME for lttng-ust. Ensure the Java agent has the same
behavior.

Fixes: #881
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 years agoFix: examples make distcheck failure
Mathieu Desnoyers [Tue, 10 May 2016 22:10:43 +0000 (18:10 -0400)] 
Fix: examples make distcheck failure

"make distcheck" marks each source file on the srcdir in the extracted
dist tarball read-only. The examples copy from the srcdir into the
builddir before running the "make" examples, but this keeps the
read-only flag on the builddir directories, which fails the build
because the resulting objects cannot be created.

Fix this by ensuring the copied target directory for each example is
user-writeable.

Fixes: #903
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: endianness of integers received by filter
Mathieu Desnoyers [Tue, 26 Apr 2016 22:39:38 +0000 (18:39 -0400)] 
Fix: endianness of integers received by filter

We need to byteswap integers passed to the filter when they are tagged
as being in an endianness which differs from the architecture
endianness, so the integer comparisons make sense in terms of value
rather than raw bytes for those fields.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoVersion 2.6.6 v2.6.6
Mathieu Desnoyers [Tue, 26 Apr 2016 20:58:28 +0000 (16:58 -0400)] 
Version 2.6.6

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: disable use of __builtin_return_address(0) on 32-bit PowerPC
Mathieu Desnoyers [Wed, 17 Feb 2016 23:18:17 +0000 (18:18 -0500)] 
Fix: disable use of __builtin_return_address(0) on 32-bit PowerPC

It causes stack corruption in the tracepoint event probes.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoVersion 2.6.5 v2.6.5
Mathieu Desnoyers [Thu, 26 Nov 2015 16:53:18 +0000 (11:53 -0500)] 
Version 2.6.5

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: header size larger than 256 bytes
Mathieu Desnoyers [Sun, 25 Oct 2015 15:25:31 +0000 (11:25 -0400)] 
Fix: header size larger than 256 bytes

When adding large context (e.g. callstack), headers larger than 256
bytes cause discrepancy between calculated size and size written into
the trace buffers. This generates a corrupted trace and triggers a
warning in ring buffer backend, which triggers a safety net disabling
tracing for the current channel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoRemove stale tests/java-jul test
Mathieu Desnoyers [Thu, 22 Oct 2015 20:51:49 +0000 (16:51 -0400)] 
Remove stale tests/java-jul test

This test has been superseded by lttng-tools tests and
https://github.com/lttng/lttng-ust-java-tests .

This test was not in configure.ac nor had any automake Makefile.am
anyway.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: live timer calculation error
Mikael Beckius [Tue, 12 May 2015 09:04:34 +0000 (11:04 +0200)] 
Fix: live timer calculation error

There is an calculation error for live timer. Variable
chan->switch_timer_interval is based on microsecond, and it is not right
to assign chan->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: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Don't (re)define STAP_PROBEV
Stelios Bounanos [Wed, 14 Oct 2015 16:31:36 +0000 (17:31 +0100)] 
Fix: Don't (re)define STAP_PROBEV

Define a new LTTNG_STAP_PROBEV macro to avoid clobbering STAP_PROBEV or
emitting unwanted sdt probes when lttng-ust has been built without sdt
support.

Signed-off-by: Stelios Bounanos <sb@enotty.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoVersion 2.6.4 v2.6.4
Mathieu Desnoyers [Thu, 24 Sep 2015 20:37:08 +0000 (16:37 -0400)] 
Version 2.6.4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: don't dereference NULL pointers
Mathieu Desnoyers [Mon, 21 Sep 2015 20:44:38 +0000 (16:44 -0400)] 
Fix: don't dereference NULL pointers

Detected by scan-build.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoCleanup: Remove unused values
Mathieu Desnoyers [Mon, 21 Sep 2015 20:01:06 +0000 (16:01 -0400)] 
Cleanup: Remove unused values

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Value stored to 'has_waited' is never read
Mathieu Desnoyers [Mon, 21 Sep 2015 19:57:36 +0000 (15:57 -0400)] 
Fix: Value stored to 'has_waited' is never read

Reported by scan-build.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Argument with 'nonnull' attribute passed null
Mathieu Desnoyers [Mon, 21 Sep 2015 19:47:09 +0000 (15:47 -0400)] 
Fix: Argument with 'nonnull' attribute passed null

Reported by scan-build
API Argument with 'nonnull' attribute passed null libringbuffer
/ring_buffer_backend.c 380
API Argument with 'nonnull' attribute passed null libringbuffer
/ring_buffer_backend.c  420

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: sysconf() unchecked return value
Mathieu Desnoyers [Mon, 21 Sep 2015 17:43:08 +0000 (13:43 -0400)] 
Fix: sysconf() unchecked return value

Fix Coverity bug:

CID 1021259 (#1 of 1): Improper use of negative value
(NEGATIVE_RETURNS)5. negative_returns: sysconf(_SC_PAGESIZE) is passed
to a parameter that cannot be negative.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoVersion 2.6.3 v2.6.3
Mathieu Desnoyers [Wed, 9 Sep 2015 20:35:28 +0000 (16:35 -0400)] 
Version 2.6.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: close socket on protocol error, sendmsg MSG_NOSIGNAL
Mathieu Desnoyers [Wed, 26 Aug 2015 22:24:11 +0000 (18:24 -0400)] 
Fix: close socket on protocol error, sendmsg MSG_NOSIGNAL

Don't try to keep interacting with sessiond when a protocol error is
detected at the UST application side: this means we cannot trust the
protocol anymore, so there is no reason for keeping the socket open.
For instance, if the application is exiting and we receive a new stream,
we're effectively not reading the stream data, and we return an error.
Unfortunately, the session daemon may try to send us another command,
but we will try interpreting the stream data as a command, which is
invalid.

Also, use MSG_NOSIGNAL flag in the fds recvmsg, so the session daemon
don't get killed with SIGPIPE when it cannot send to the socket due to
connection closed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: add missing ust lock around objd_table_destroy()
Mathieu Desnoyers [Fri, 21 Aug 2015 23:11:56 +0000 (16:11 -0700)] 
Fix: add missing ust lock around objd_table_destroy()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: application exit race with pthread cancel
Mathieu Desnoyers [Mon, 17 Aug 2015 16:50:34 +0000 (09:50 -0700)] 
Fix: application exit race with pthread cancel

Listener threads can be cancelled with ust lock held, which can hang the
following ust cleanup routine, because tracepoint probe unregister needs
to take the ust lock.

Fix this by disabling pthread cancellation for the entire duration of
the ust lock.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Java agent: update ref count in enabledLoggers
Philippe Proulx [Tue, 7 Apr 2015 18:26:35 +0000 (14:26 -0400)] 
Fix: Java agent: update ref count in enabledLoggers

Integer objects are immutable in Java, so

    Integer refcount = enabledLoggers.get(name);
    refcount--;

does not update the value in enabledLoggers.

However, this bug "fixes" a bug in the session daemon
(LTTng-tools) which sends multiple _disable event_
commands for the same event name (one when the event is
disabled manually, and another one when the session is
destroyed). Therefore we use the registration done
command's version to know if the Java agent is connected to
a fixed or non-fixed session daemon, using the old
behaviour if connected to a non-fixed one.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Use $enableval with AC_ARG_ENABLE
Michael Jeanson [Wed, 8 Jul 2015 18:24:57 +0000 (14:24 -0400)] 
Fix: Use $enableval with AC_ARG_ENABLE

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Cleanup local_apps sock_info in lttng_ust_cleanup
Jérémie Galarneau [Tue, 7 Jul 2015 18:35:54 +0000 (14:35 -0400)] 
Fix: Cleanup local_apps sock_info in lttng_ust_cleanup

LTTng-UST will deadlock after a fork while waiting on the
"constructor_wait" semaphore if local apps, handled the session daemon
running under the current UID, are disabled or "not_allowed".

This deadlock can be triggered by setting an infinite registration
timeout, clearing the HOME environment variable and launching an app
which calls FORK(3). This will cause setup_local_apps() to fail to
determine the local_apps sock_path, thus leaving
local_apps.allowed == 0.

This, in turn, would cause lttng_ust_cleanup to skip the cleanup
of the local_apps sock_info after a fork,
leaving local_apps.constructor_sem_posted == 1. This would cause
handle_register_done() in the child to skip over the decrementation
of sem_count and post of the constructor_wait semaphore.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: handle sys_futex EINTR and EWOULDBLOCK
Mathieu Desnoyers [Mon, 6 Jul 2015 21:09:32 +0000 (17:09 -0400)] 
Fix: handle sys_futex EINTR and EWOULDBLOCK

Handling sys_futex EINTR allows us to retry waiting on the futex
immediately if we are interrupted by a signal without having to try
connecting to the session daemon.

This should not impact correctness though, as the wait scheme would
simply try to connect, fail, and try waiting again.

Also handle errors on FUTEX_WAKE.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: update liburcu URL
Mathieu Desnoyers [Thu, 2 Jul 2015 21:11:22 +0000 (17:11 -0400)] 
Fix: update liburcu URL

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: running java examples out of tree
Michael Jeanson [Tue, 30 Jun 2015 21:32:56 +0000 (17:32 -0400)] 
Fix: running java examples out of tree

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: java class check when uudecode is not present
Michael Jeanson [Tue, 30 Jun 2015 20:59:54 +0000 (16:59 -0400)] 
Fix: java class check when uudecode is not present

On systems where 'uudecode' is present, the java class check will
run a precompiled class file in the local directory. If the CLASSPATH
variable doesn't contain "." the test will fail regardless of the
presence of the tested for class on the classpath.

This fix makes the behavior of the test consistant whether 'uudecode'
is present or not.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix compilation warnings in the Java agent
Alexandre Montplaisir [Fri, 26 Jun 2015 22:03:31 +0000 (18:03 -0400)] 
Fix compilation warnings in the Java agent

- Remove unused imports.
- Access static fields statically.
- Mark static methods that can be.
- Remove exception declarations that are not actually thrown
  (on non-API methods only).

Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
8 years agoFix: out of tree build of java agents
Michael Jeanson [Thu, 25 Jun 2015 23:10:54 +0000 (19:10 -0400)] 
Fix: out of tree build of java agents

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: Use env CLASSPATH when building log4j example
Michael Jeanson [Thu, 25 Jun 2015 23:00:22 +0000 (19:00 -0400)] 
Fix: Use env CLASSPATH when building log4j example

The location of the log4j jar file is specified during configure with
the CLASSPATH envvar, reuse it when building the example.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: build log4j example when enabled
Michael Jeanson [Thu, 25 Jun 2015 21:13:07 +0000 (17:13 -0400)] 
Fix: build log4j example when enabled

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: perform volatile load of tracepoint state
Mathieu Desnoyers [Mon, 22 Jun 2015 14:30:02 +0000 (10:30 -0400)] 
Fix: perform volatile load of tracepoint state

Because tracepoint state is updated by lttng-ust threads, and read by
application threads, we need to perform a volatile load of that state.

Not having the volatile load can cause the compiler to optimize away the
reload of that state, keeping a local copy instead. For instance, a main
program consisting of a loop could keep the tracepoint state on its
stack or in registers without ever reloading it from memory.

Perform a volatile load (CMM_LOAD_SHARED()) of the tracepoint state.
Add the matching volatile store (CMM_STORE_SHARED()) in tracepoint.c for
the state update.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoVersion 2.6.2 v2.6.2
Mathieu Desnoyers [Thu, 18 Jun 2015 17:42:46 +0000 (13:42 -0400)] 
Version 2.6.2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoAdd aarch64 support to configure
Michael Jeanson [Thu, 18 Jun 2015 14:41:55 +0000 (10:41 -0400)] 
Add aarch64 support to configure

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: function instrumentation ip context
Mathieu Desnoyers [Wed, 10 Jun 2015 11:27:18 +0000 (13:27 +0200)] 
Fix: function instrumentation ip context

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: liblttng-ust-dl ip context
Mathieu Desnoyers [Wed, 10 Jun 2015 11:20:31 +0000 (13:20 +0200)] 
Fix: liblttng-ust-dl ip context

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: pthread wrapper ip context
Mathieu Desnoyers [Wed, 10 Jun 2015 11:15:28 +0000 (13:15 +0200)] 
Fix: pthread wrapper ip context

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: lttng-ust-malloc ip context
Mathieu Desnoyers [Wed, 10 Jun 2015 11:15:09 +0000 (13:15 +0200)] 
Fix: lttng-ust-malloc ip context

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoAllow TP_IP_PARAM arg name to be configured
Mathieu Desnoyers [Wed, 10 Jun 2015 11:14:08 +0000 (13:14 +0200)] 
Allow TP_IP_PARAM arg name to be configured

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: fetch caller address from tracef()
Mathieu Desnoyers [Tue, 9 Jun 2015 09:51:06 +0000 (11:51 +0200)] 
Fix: fetch caller address from tracef()

Don't fetch the address within the ust trampoline, but rather the caller
address.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoFix: building probe providers with C++ compiler
Mathieu Desnoyers [Thu, 7 May 2015 17:25:04 +0000 (13:25 -0400)] 
Fix: building probe providers with C++ compiler

Robert Daniels wrote:
> > I'm attempting to use lttng userspace tracing with a C++ application
> > on an ARM platform. I'm using GCC 4.8.4 on Linux 3.14 with the 2.6
> > release of lttng. I've compiled lttng-modules, lttng-ust, and
> > lttng-tools and have been able to get a simple test working with C
> > code.  When I attempt to run the hello.cxx test on my target it will
> > segfault.
>
>
> I spent a little time digging into this issue and finally discovered the
> cause of my segfault with ARM C++ tracepoints.
>
> There is a struct called 'lttng_event' in ust-events.h which contains an
> empty union 'u'.  This was the cause of my issue.  Under C, this empty union
> compiles to a zero byte member while under C++ it compiles to a one byte
> member, and in my case was four-byte aligned which caused my C++ code to
> have the 'cds_list_head node' offset incorrectly by four bytes.  This lead
> to an incorrect linked list structure which caused my issue.
>
> Since this union is empty, I simply removed it from the struct and everything
> worked correctly.
>
> I don't know the history or purpose behind this empty union so I'd like to
> know if this is a safe fix.  If it is I can submit a patch with the union
> removed.

That's a very nice catch!

We do not support building tracepoint probe provider with
g++ yet, as stated in lttng-ust(3):

"- Note for C++ support: although an application instrumented with
   tracepoints can be compiled with g++, tracepoint probes should be
   compiled with gcc (only tested with gcc so far)."

However, if it works fine with this fix, then I'm tempted to take it,
especially because removing the empty union does not appear to affect
the layout of struct lttng_event as seen from liblttng-ust, which must
be compiled with a C compiler,  and from probe providers compiled with
a C compiler. So all we are changing is the layout of a probe provider
compiled with a C++ compiler, which is anyway buggy at the moment,
because it is not compatible with the layout expected by liblttng-ust
compiled with a C compiler.

Reported-by: Robert Daniels <robert.daniels@vantagecontrols.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 years agoVersion 2.6.1 v2.6.1
Mathieu Desnoyers [Wed, 29 Apr 2015 15:18:34 +0000 (11:18 -0400)] 
Version 2.6.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: use lttng_secure_getenv to handle env. vars. involving paths
Mathieu Desnoyers [Thu, 23 Apr 2015 22:45:05 +0000 (18:45 -0400)] 
Fix: use lttng_secure_getenv to handle env. vars. involving paths

This is a security fix for applications linked against liblttng-ust
which are exposed as setuid binaries.

A malicious user which can run those applications could target those
environment variable paths to locations that would allow it to create
files in various areas of the filesystem.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: add missing getenv wrapper
Mathieu Desnoyers [Thu, 23 Apr 2015 22:48:43 +0000 (18:48 -0400)] 
Fix: add missing getenv wrapper

Required for old glibc.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Don't wait during registration if clock_gettime() fails
Jérémie Galarneau [Thu, 23 Apr 2015 17:07:38 +0000 (13:07 -0400)] 
Fix: Don't wait during registration if clock_gettime() fails

get_constructor_timeout() currently returns -1 which, according to
the lttng-ust(3) man page and lttng_ust_init() implementation,
"waits forever".

This changes the behavior to match what is expressed in the comments.

Comments in get_constructor_timeout() and get_timeout() are also
modified to match the following convention:

-1: wait forever
0: don't wait
1: wait for "constructor_delay_ms"

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Mismatching code and console output in log4j example
Jérémie Galarneau [Mon, 23 Feb 2015 21:22:53 +0000 (16:22 -0500)] 
Fix: Mismatching code and console output in log4j example

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 2.6.0 v2.6.0
Mathieu Desnoyers [Mon, 26 Jan 2015 19:46:47 +0000 (14:46 -0500)] 
Version 2.6.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: java-agent: out-of-tree path to java manifest
Jonathan Rajotte [Fri, 23 Jan 2015 18:22:11 +0000 (13:22 -0500)] 
Fix: java-agent: out-of-tree path to java manifest

This should also be backported to stable-2.6.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: missing parenthesis in offset_align_floor
Mathieu Desnoyers [Fri, 16 Jan 2015 16:33:00 +0000 (11:33 -0500)] 
Fix: missing parenthesis in offset_align_floor

Is currently unused. Triggers a compile error when used.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: add ustctl_has_perf_counters
Mathieu Desnoyers [Mon, 12 Jan 2015 22:11:32 +0000 (17:11 -0500)] 
Fix: add ustctl_has_perf_counters

Allow sessiond to 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>
9 years agoFix: add urcu-bp TLS fixup
Mathieu Desnoyers [Mon, 12 Jan 2015 18:27:53 +0000 (13:27 -0500)] 
Fix: add urcu-bp TLS fixup

When performing a library base address statedump, the UST threads can
grab the RCU read-side lock, which touch a TLS. We should "pre-fault"
this TLS in the constructor to eliminate a deadlock involving libc
dynamic loader lock.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: add missing poll.h include
Mathieu Desnoyers [Mon, 12 Jan 2015 16:09:18 +0000 (11:09 -0500)] 
Fix: add missing poll.h include

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: get_subbuf: bound number of consumerd retry
Mathieu Desnoyers [Mon, 5 Jan 2015 02:06:19 +0000 (21:06 -0500)] 
Fix: get_subbuf: bound number of consumerd retry

When an application traced with per-UID buffers vanishes between its
reserve and commit ring buffer operations (e.g. segfault), it may cause
the consumer daemon to enter an endless loop, awaiting for the
application to complete its commit.

Fix this situation by bounding the number of retry using an adaptative
approach: try actively for a few times, and then try a few more times
with a 10ms delay between attempts.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 2.6.0-rc3 v2.6.0-rc3
Mathieu Desnoyers [Fri, 12 Dec 2014 16:09:32 +0000 (11:09 -0500)] 
Version 2.6.0-rc3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: man: you can't link a lib with a static lib
Philippe Proulx [Wed, 26 Nov 2014 21:50:56 +0000 (16:50 -0500)] 
Fix: man: you can't link a lib with a static lib

Fixes: #825
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: context alignment not properly handled
Mathieu Desnoyers [Mon, 1 Dec 2014 23:18:13 +0000 (18:18 -0500)] 
Fix: context alignment not properly handled

This issue affects only architectures without efficient unaligned
accesses, only when a context field with larger alignment follows a
context field with smaller alignment. It generates unreadable traces
when such context fields are enabled in this configuration.

Fixes #867

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Shorthand option -cp not supported in all version of Java
Christian Babeux [Fri, 28 Nov 2014 21:39:50 +0000 (16:39 -0500)] 
Fix: Shorthand option -cp not supported in all version of Java

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: allow tracepoints to build with --std=c99
Mathieu Desnoyers [Mon, 17 Nov 2014 16:36:10 +0000 (17:36 +0100)] 
Fix: allow tracepoints to build with --std=c99

std=c99 without #define __USE_BSD does not work for tracepoint header,
due to missing endianness macros. Force their definition in the
ust-endian.h wrapper if they are missing.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: filter attach vs event enable race
Mathieu Desnoyers [Wed, 12 Nov 2014 23:08:04 +0000 (18:08 -0500)] 
Fix: filter attach vs event enable race

In order to correctly handle the use-case where events are enabled
_after_ trace is started, and _after_ applications are already being
traced, the event should be created in a "disabled" state, so that it
does not trace events until its filter is attached.

This fix needs to be done both in lttng-tools and lttng-ust. In order to
keep ABI compatibility between tools and ust within a stable release
cycle, we introduce a new "disabled" within struct lttng_ust_event
padding (previously zeroed). Newer LTTng-UST checks this flag, and
fallback on the old racy behavior (enabling the event on creation) if it
is unset.

Therefore, old session daemon works with newer lttng-ust of the same
stable release, and vice-versa. However, building lttng-tools requires
an upgraded lttng-ust, which contains the communication protocol with
the new "disabled" field.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: add a configure check for weak symbols support
Christian Babeux [Wed, 12 Nov 2014 19:35:21 +0000 (14:35 -0500)] 
Fix: add a configure check for weak symbols support

Fixes #236

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix coverity warning about sizeof(void **) != sizeof(void *)
Mathieu Desnoyers [Wed, 12 Nov 2014 21:05:36 +0000 (16:05 -0500)] 
Fix coverity warning about sizeof(void **) != sizeof(void *)

The size of the copied data is actually void *, not void **.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: off-by-one in sequence filter comparator
Mathieu Desnoyers [Sat, 8 Nov 2014 17:16:41 +0000 (12:16 -0500)] 
Fix: off-by-one in sequence filter comparator

If we pass the following sequence as event input:
- field name "seqfield2"
- seq. len.: 4
- sequence array: "testA" (5 characters),

The following filters do not have the intended effect:
* 'seqfield2=="testA"'
  - expected: no match.
  - actual behavior: match.

* 'seqfield2=="test"'
  - expected: match.
  - actual behavior: no match.

This is caused by an off-by-one in the comparison with sequence length
in the filter bytecode interpreter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Java Agent JAR file symlink should be created after objects install
Christian Babeux [Tue, 4 Nov 2014 21:28:19 +0000 (16:28 -0500)] 
Fix: Java Agent JAR file symlink should be created after objects install

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 2.6.0-rc2 v2.6.0-rc2
Mathieu Desnoyers [Tue, 4 Nov 2014 17:00:38 +0000 (12:00 -0500)] 
Version 2.6.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Add versioning to liblttng-ust-agent JAR
Christian Babeux [Mon, 3 Nov 2014 20:12:26 +0000 (15:12 -0500)] 
Fix: Add versioning to liblttng-ust-agent JAR

The liblttng-ust-agent JAR need versioning. The manifest file contains the
appropriate information about the JAR, such as the current version.

A symlink is also created and installed in order to point to the latest
version of the JAR.

e.g: liblttng-ust-agent.jar -> liblttng-ust-agent-1.0.0.jar

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Warn when log4j version is too old
Christian Babeux [Fri, 31 Oct 2014 19:33:59 +0000 (15:33 -0400)] 
Fix: Warn when log4j version is too old

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoUpdate Java agent documentation
Christian Babeux [Fri, 31 Oct 2014 19:33:40 +0000 (15:33 -0400)] 
Update Java agent documentation

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Try loading classes using the thread context class loader
Jérémie Galarneau [Fri, 31 Oct 2014 18:03:47 +0000 (14:03 -0400)] 
Fix: Try loading classes using the thread context class loader

LTTngAgent should load classes using the current thread context's
class loader and then try using the system class loader if a
ClassNotFoundException is thrown.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoUpdate version name v2.6.0-rc1
Mathieu Desnoyers [Mon, 20 Oct 2014 22:57:50 +0000 (18:57 -0400)] 
Update version name

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 2.6.0-rc1
Mathieu Desnoyers [Mon, 20 Oct 2014 22:54:31 +0000 (18:54 -0400)] 
Version 2.6.0-rc1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd missing file to gitignore
Mathieu Desnoyers [Thu, 16 Oct 2014 15:03:40 +0000 (17:03 +0200)] 
Add missing file to gitignore

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: preserve example files' timestamps when copying
Jérémie Galarneau [Thu, 16 Oct 2014 13:45:19 +0000 (09:45 -0400)] 
Fix: preserve example files' timestamps when copying

This fixes an issue where examples were always being rebuilt
when performing an out of tree build since the examples were
being copied to the build directory with a timestamp more
recent than the already-built example objects.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Abort loading log4j agent classes when detected log4j version is too old
Christian Babeux [Thu, 2 Oct 2014 20:31:56 +0000 (16:31 -0400)] 
Fix: Abort loading log4j agent classes when detected log4j version is too old

The Java Log4j agent rely on the getTimeStamp() method that was
introduced in log4j 1.2.15. This fix implement a runtime detection of
the log4j library capabilities and abort the loading of the relevant
agent classes if the version used is too old.

Thus, log4j tracing will be deactivated on older version of the
library.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoCleanup: Remove the no longer needed liblttng-ust-jul folder
Christian Babeux [Thu, 25 Sep 2014 16:08:11 +0000 (12:08 -0400)] 
Cleanup: Remove the no longer needed liblttng-ust-jul folder

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Wrong CLASSPATH when building liblttng-ust-java oot
Christian Babeux [Thu, 25 Sep 2014 16:07:32 +0000 (12:07 -0400)] 
Fix: Wrong CLASSPATH when building liblttng-ust-java oot

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: Wrong CLASSPATH when building liblttng-ust-java-agent oot
Christian Babeux [Wed, 24 Sep 2014 19:44:05 +0000 (15:44 -0400)] 
Fix: Wrong CLASSPATH when building liblttng-ust-java-agent oot

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRename public structure to avoid collisions
Simon Marchi [Wed, 13 Aug 2014 23:10:41 +0000 (19:10 -0400)] 
Rename public structure to avoid collisions

Since nobody raised any concern about this, I submit the patch for
merging. You can find the original discussion here:

  http://lists.lttng.org/pipermail/lttng-dev/2014-July/023364.html

(the rest of the message is identical to the RFC post)

When trying to use lttng-ust with a program that defines its own struct
tracepoint, a name collision arises and compilation fails (see example
lower).

I suggest the following renames (the problem only showed up with struct
tracepoint in my case, but let's be proactive):

 * struct tracepoint -> struct lttng_ust_tracepoint
 * struct tracepoint_probe -> struct lttng_ust_tracepoint_probe
 * struct tracepoint_dlopen -> struct lttng_ust_tracepoint_dlopen

Strictly speaking, those names are part of the public API of LTTng, so I
understand that it would be a felony to rename it, since it breaks the
holy API. However, those structures are only used through some macros,
and I am not aware of any sensible use case where a user of lttng-ust
would directly reference those structures. Therefore, it should not break
any existing code. If you do have such a use case, where it would break
your code, please jump in the discussion.

This should not break any application instrumented and built before the
change. Tested by building "hello" before and tracing it after the
change.

Here is an example of error due to the name collision. This is when
building gdb, which I try to instrument with lttng-ust.

In file included from /usr/local/include/lttng/tracepoint.h:28:0,
                 from ust_tracepoints.h:15,
                 from inf-ptrace.c:38:
/usr/local/include/lttng/tracepoint-types.h:32:8: error: redefinition of
‘struct tracepoint’
 struct tracepoint {
        ^
In file included from inferior.h:37:0,
                 from inf-ptrace.c:22:
breakpoint.h:817:8: note: originally defined here
 struct tracepoint
        ^
Makefile:1088: recipe for target 'inf-ptrace.o' failed
make: *** [inf-ptrace.o] Error 1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRefactor liblttng-ust-jul in liblttng-ust-agent
Christian Babeux [Mon, 15 Sep 2014 03:11:30 +0000 (23:11 -0400)] 
Refactor liblttng-ust-jul in liblttng-ust-agent

This is a major refactor of the initial implementation of the UST JUL
agent. The agent now support the log4j logging backend.

The agent can now be built in three different configurations:

1) Java agent with JUL support:

$ ./configure --enable-java-agent-jul

2) Java agent with Log4j support:

$ export CLASSPATH=$CLASSPATH:/path/to/log4j.jar
$ ./configure --enable-java-agent-log4j

3) Java agent with JUL + Log4j support

$ export CLASSPATH=$CLASSPATH:/path/to/log4j.jar
$ ./configure --enable-java-agent-all

To build the agent with log4j support, make sure that the log4j jar
is in your Java classpath.

The configure script will automatically detect the appropriate Java
binaries to use in order to build the Java agent.

The name of the agent jar file is now "liblttng-ust-agent.jar".
It will be installed in the arch-agnostic "$prefix/share/java" path
e.g: "/usr/share/java".

In order to support older applications using the "org.lttng.ust.jul"
package, a transitional package is built with the same name.

All applications should move to use the "org.lttng.ust.agent" package.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoBuild the liblttng-ust-java library using the new M4 macros
Christian Babeux [Mon, 15 Sep 2014 03:30:45 +0000 (23:30 -0400)] 
Build the liblttng-ust-java library using the new M4 macros

The liblttng-ust-java can now be built without passing paths to
the JDK:

$ ./configure --enable-jni-interface

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd M4 macros helpers to build Java programs
Christian Babeux [Mon, 15 Sep 2014 03:28:38 +0000 (23:28 -0400)] 
Add M4 macros helpers to build Java programs

These M4 were taken from the autoconf archive [1].

[1] - http://www.gnu.org/software/autoconf-archive

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoModernize README using Markdown
Philippe Proulx [Wed, 17 Sep 2014 03:29:06 +0000 (23:29 -0400)] 
Modernize README using Markdown

This commit also:

  * adds a project description at the top
  * simplifies the steps to build/link a user
    application with LTTng-UST and provides examples
    of commands
  * updates the Package contents list

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoDocumentation: clarify event name in lttng-ust.3
Mathieu Desnoyers [Thu, 11 Sep 2014 15:19:05 +0000 (11:19 -0400)] 
Documentation: clarify event name in lttng-ust.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd cscope to gitignore
Mathieu Desnoyers [Tue, 9 Sep 2014 14:09:13 +0000 (10:09 -0400)] 
Add cscope to gitignore

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoconfigure.ac: fix "missing jni.h" error message
Philippe Proulx [Tue, 2 Sep 2014 20:12:55 +0000 (16:12 -0400)] 
configure.ac: fix "missing jni.h" error message

DIR in --with-java-jdk=DIR must point to the JDK base
directory, not the actual JDK include directory.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: remove references to trace_printf()
Mathieu Desnoyers [Wed, 13 Aug 2014 16:27:46 +0000 (12:27 -0400)] 
Fix: remove references to trace_printf()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoChange JUL agent to use the new ABI
David Goulet [Fri, 8 Aug 2014 16:48:48 +0000 (12:48 -0400)] 
Change JUL agent to use the new ABI

Two things have changed, the agent port file created by the session
daemon, the name is now "agent.port". The second thing is that upon
registration, the agent needs to send its domain which is here
LTTNG_DOMAIN_JUL (val: 3).

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 2.5.0 v2.5.0
Mathieu Desnoyers [Wed, 16 Jul 2014 22:18:11 +0000 (18:18 -0400)] 
Version 2.5.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMutex while updating statedump_pending is not needed
Mathieu Desnoyers [Wed, 16 Jul 2014 21:40:53 +0000 (17:40 -0400)] 
Mutex while updating statedump_pending is not needed

Take care of coverity warning ** CID 1226392:  Data race condition  (MISSING_LOCK)
/liblttng-ust/lttng-ust-comm.c: 1704 in lttng_ust_sockinfo_session_enabled()

It's not that the lock is missing, it's that we don't need to hold the
lock when doing the other modification.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoRevert "Turn base address dump into experimental feature"
Paul Woegerer [Mon, 14 Jul 2014 08:38:25 +0000 (10:38 +0200)] 
Revert "Turn base address dump into experimental feature"

This reverts commit b11abb674e50c67e3410ab2bd5d0a263e88b73ba.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: document ust_fork_mutex nesting
Mathieu Desnoyers [Wed, 16 Jul 2014 14:35:43 +0000 (10:35 -0400)] 
Fix: document ust_fork_mutex nesting

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoBugfix for #745 deadlock with baddr statedump+fork
Paul Woegerer [Mon, 14 Jul 2014 08:38:24 +0000 (10:38 +0200)] 
Bugfix for #745 deadlock with baddr statedump+fork

Fixes #745

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoMove enablers syncing after the channel registration
Francis Deslauriers [Thu, 10 Jul 2014 22:22:14 +0000 (18:22 -0400)] 
Move enablers syncing after the channel registration

Fixes possible race condition where an event registration is received
before its channel registration by the consumer.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoAdd lttng_ust_notrace to static inline functions
Paul Woegerer [Mon, 7 Jul 2014 14:04:21 +0000 (16:04 +0200)] 
Add lttng_ust_notrace to static inline functions

The static inline functions
__tracepoint_provider_mismatch_<TRACEPOINT_PROVIDER> and
__tracepoint_provider_check_<TRACEPOINT_PROVIDER> are missing the
lttng_ust_notrace attribute to prevent them from getting instrumented
with -finstrument-functions (if e.g. defined in CFLAGS). This patch is
adding the attribute to those functions.

Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agolttng ust: support ppc64le within configure
Michel Normand [Mon, 30 Jun 2014 16:12:19 +0000 (12:12 -0400)] 
lttng ust: support ppc64le within configure

Takes care of https://bugzilla.redhat.com/show_bug.cgi?id=1114691

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoVersion 2.5.0-rc2 v2.5.0-rc2
Mathieu Desnoyers [Fri, 27 Jun 2014 14:07:32 +0000 (10:07 -0400)] 
Version 2.5.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 years agoFix: lttng-ust-jul: set thread in daemon mode
David Goulet [Thu, 26 Jun 2014 19:07:54 +0000 (15:07 -0400)] 
Fix: lttng-ust-jul: set thread in daemon mode

This way, when the JVM stops the main thread, the agent's thread will be
automatically shutdown thus making the .dispose() call optional.

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