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>
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>
Jonathan Rajotte [Mon, 21 Sep 2015 18:31:33 +0000 (14:31 -0400)]
Cleanup: Unnecessary bit shift
Reported by cppcheck [1].
[1]
https://ci.lttng.org/view/Code%20quality/job/lttng-ust_master_cppcheck/5/cppcheckResult/source.10/
Proposed-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Antoine Busque [Mon, 21 Sep 2015 18:19:43 +0000 (14:19 -0400)]
Clean-up: remove extraneous "found" parameters in ust-elf
In lttng-ust-elf.c, static functions used to extract build ID or debug
link information had an extraneous `found` parameter, carrying no more
information than could be obtained by checking the other out
parameters against NULL. The resulting simplified logic should also
prevent static analysis tools from misidentifying resource leaks.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
Philippe Proulx [Sat, 5 Sep 2015 17:47:13 +0000 (13:47 -0400)]
doc: add Python example
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Philippe Proulx [Sat, 5 Sep 2015 17:38:01 +0000 (13:38 -0400)]
Fix: Python agent: do not register twice to same port
It is possible that one of the session daemons left its agent.port
file on the file system, for example when killed with SIGKILL. It
is also common that both those session daemons use the same port for
listening to agent connections. In this case, if one session daemon
is running, but two agent.port files exist, the Python agent would
connect its two threads to the same session daemon, leading to
everything done twice: list shows events twice, tracing records
events twice, etc.
This patch ensures that if two agent.port files are found and have
the same content, only one thread is used.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Antoine Busque [Tue, 8 Sep 2015 21:33:18 +0000 (17:33 -0400)]
Fix: potential leaks in error paths
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Antoine Busque [Tue, 8 Sep 2015 21:24:16 +0000 (17:24 -0400)]
Fix: double free in liblttng-ust-dl
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Fri, 4 Sep 2015 21:31:31 +0000 (17:31 -0400)]
Fix: make check in OOT build with absolute path
The previous patch fixed the out of tree build when the configure script
was called with a path relative to the builddir but still failed when
the path was absolute. This works with both.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 4 Sep 2015 06:00:09 +0000 (02:00 -0400)]
Fix: elf: leaks on error paths
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 4 Sep 2015 05:50:56 +0000 (01:50 -0400)]
Cleanup: coding style
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 4 Sep 2015 05:48:58 +0000 (01:48 -0400)]
Cleanup: elf: use off_t for offsets, size_t for len
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 4 Sep 2015 05:43:31 +0000 (01:43 -0400)]
Cleanup: eliminate implicit sign-extension
Coverity reported:
CID
1321723 (#1 of 1): Unintended sign extension
(SIGN_EXTENSION)sign_extension: Suspicious implicit sign extension:
elf->ehdr->e_shentsize with type unsigned short (16 bits, unsigned) is
promoted in index * elf->ehdr->e_shentsize to type int (32 bits,
signed), then sign-extended to type unsigned long (64 bits, unsigned).
If index * elf->ehdr->e_shentsize is greater than 0x7FFFFFFF, the upper
bits of the result will all be 1.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 4 Sep 2015 05:35:47 +0000 (01:35 -0400)]
Fix: elf: NULL pointer dereference
Coverity reported:
CID
1321730 (#1 of 1): Dereference null return value (NULL_RETURNS)15.
dereference: Dereferencing a pointer that might be null _build_id when
calling lttng_ust_read.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 3 Sep 2015 20:14:41 +0000 (16:14 -0400)]
Fix: add missing ust-elf.h header to dist
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 3 Sep 2015 20:11:38 +0000 (16:11 -0400)]
Fix: make check in out of tree build
Use the elf data files from the source dir when running make check in an
out of tree builddir and add the data files to dist.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 1 Sep 2015 17:29:39 +0000 (13:29 -0400)]
Fix: old gcc warnings
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 1 Sep 2015 16:55:02 +0000 (12:55 -0400)]
Fix: old gcc warning
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 22:34:18 +0000 (18:34 -0400)]
Fix: remove stale lttng-ust-elf.h from makefile
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 22:25:02 +0000 (18:25 -0400)]
Fix: elf: uninitialized ret
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 21:27:39 +0000 (17:27 -0400)]
Fix: test elf: handle NULL debug file
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 21:25:07 +0000 (17:25 -0400)]
test: elf move constants to top of implementation
Declare them static const.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 21:19:20 +0000 (17:19 -0400)]
Fix: elf test prog arg checking
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 20:50:50 +0000 (16:50 -0400)]
baddr statedump: remove dependency on file streams
None of the rest of UST used by applications use file streams (only the
sessiond uses a file streams for metadata). Therefore, use file
descriptors directly for baddr statedump.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 31 Aug 2015 20:50:03 +0000 (16:50 -0400)]
baddr statedump: hold ust lock around allocations
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Antoine Busque [Thu, 30 Jul 2015 20:37:04 +0000 (16:37 -0400)]
Add unit tests for lttng_ust_elf
This adds unit tests for UST's ELF parser. Also included are test ELF
files for multiple architectures (x86, x86_64, armeb, aarch64_be). The
procedure to generate these test files is described in
`tests/ust-elf/README.md`.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Antoine Busque [Thu, 2 Jul 2015 15:55:53 +0000 (11:55 -0400)]
Add memory size, build id, and debug link info to statedump and dl
Implement a minimal ELF parser allowing to compute an executable's
in-memory size and to read its build id and debug link info, if any,
at runtime. This is performed during base address statedump, and on
dlopen when using the `liblttng-ust-dl.so` helper.
This adds a `memsz` field to `lttng_ust_statedump:soinfo` and
`lttng_ust_dl:dlopen`. Also adds two events to both providers,
`build_id` and `debug_link`, which are only traced when the
corresponding information is found in the executable file. They can be
matched with the corresponding `soinfo` or `dlopen` via the `baddr`
field shared amongst all the events. Build ID and debug link are
standard methods of identifying and retrieving debug information
corresponding to a specific version of an executable.
The fields `size` and `mtime` from the existing `soinfo` and `dlopen`
events have been removed as they provided no valuable information for
analysis, whereas build ID or debug link allow unambiguous retrieval
of the debug information, and the on-disk `size` is superseded by the
in-memory `memsz`.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
Mathieu Desnoyers [Tue, 25 Aug 2015 11:12:51 +0000 (07:12 -0400)]
Cleanup: more descriptive error message
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
Mathieu Desnoyers [Tue, 11 Aug 2015 16:11:57 +0000 (12:11 -0400)]
Cleanup: configure layout for python agent detection
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Mon, 10 Aug 2015 18:45:34 +0000 (14:45 -0400)]
Build: python agent: use setup.py over autoconf
This change provides a valid way of installing the agent. The autoconf
python macro provides the wrong installation path for
python 3 under Debian and Ubuntu due to distro-specific packaging for
python 2.7 and 3.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Mon, 10 Aug 2015 18:45:33 +0000 (14:45 -0400)]
Build: add python interpreter used by python agent if built
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Mon, 10 Aug 2015 18:45:32 +0000 (14:45 -0400)]
Doc: basic lttng ust python agent documentation
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Mon, 10 Aug 2015 18:45:31 +0000 (14:45 -0400)]
Build: use AM_PATH_PYTHON to resolve python when building agent
The agent can be built against a forced python version by exporting
PYTHON environment variable at configure time.
ex:
$ export PYTHON=python3
$ ./configure --enable-python-agent
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Mon, 10 Aug 2015 18:45:30 +0000 (14:45 -0400)]
Build: only check if python exists in path
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 6 Aug 2015 23:49:26 +0000 (19:49 -0400)]
Update version to 2.8.0-pre
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Thu, 6 Aug 2015 17:41:50 +0000 (13:41 -0400)]
Fix: Send the correct Java agent return code when disabling events
When receiving a "disable event" command from the sessiond for
an event that is not known, the Java agent should send the
"unknown logger name" return code, not the "invalid command" one.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Thu, 30 Jul 2015 23:52:14 +0000 (19:52 -0400)]
Fix: Correctly handle the command to disable all events
Missed a return statement in the method to handle disable
event commands. The "*" event would get disabled correctly,
but the execution would fall-through and fail later on,
incorrectly reporting a failure.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Thu, 30 Jul 2015 19:37:31 +0000 (15:37 -0400)]
Small refactor of the Java agent's TCP client
Better separate the "commands" (sent from the sessiond to the
agent) from the "responses" (sent from the agent to the sessiond
as replies to commands) into distinct objects.
ISessiondCommand#execute() is now an interface method, and it
returns an ILttngAgentResponse.
This more rigorous handling of commands and responses will make
it easier to add support for additional commands in the future.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Thu, 30 Jul 2015 20:11:55 +0000 (16:11 -0400)]
Rename Java Agent event names to "event"
Previously, separate event names were used for events targeting
a root session daemon or a user one. Those were "sys_event" and
"user_event", respectively.
Now that the Java side only sends one event type, we can rename
it to simply "event".
This patch is dependant on a similar update on the lttng-tools
side.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jérémie Galarneau [Thu, 30 Jul 2015 20:43:21 +0000 (16:43 -0400)]
Rename Python agent tracepoint to "event"
This rename comes as an effort to remain consistent with the tracepoint
naming scheme used by Log4J and JUL.
The associated change in lttng-tools is introduced as of
d8c7bda0.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Wed, 29 Jul 2015 20:29:54 +0000 (16:29 -0400)]
Allow compiling the Java agent with Java 1.6
Previous patch
d60dfbe inadvertently made use of
ReflectiveOperationException, which was introduced in Java 7.
To continue being able to compile the agent with Java 6, we
can list individual exception types instead.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Mon, 27 Jul 2015 19:41:01 +0000 (15:41 -0400)]
Restore concurrent build when Java agent is enabled
Add a missing target dependency in lttng-ust-agent-common, to
make sure it does not try to package the .jar before the classes
are actually compiled.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Wed, 22 Jul 2015 02:56:15 +0000 (22:56 -0400)]
Refactor Java agent to let applications manage the log handlers
Major refactoring of the UST Java agent and its JUL and log4j
logging facilities.
Split up the big LTTngAgent class into two separate agent
singletons, one for JUL and one for log4j.
The large parts of common code remain in the -common package
in AbstractLttngAgent, with the API-specific implementations
in their respective -jul or -log4j package.
This removes the need for circular-dependencies (which were
worked around using reflection) between the common and the
other packages.
The applications are now expected to instantiate their
JUL Handler or log4j LogAppender themselves, and to attach
them to corresponding Logger objects. The LttngLogHandler and
LttngLogAppender classes are now made public to allow this.
Agents are now spawned automatically on demand, as Handler
objects are created. Once the last handler/appender is
close()'d, the agent is disposed as well. This reduces the
number of threads and socket connections to the minimum that
is necessary.
The two separate tracepoints in the JNI libraries, "tracepointS"
and "tracepointU", are now merged into one. Events sent to
either the root or user session daemon will use the same call.
The LTTngAgent.getLTTngAgent() API is kept for compatibility
with applications using it, but now marked @Deprecated. The
functionality underneath was re-implemented using the new
classes, but the behaviour should be kept the same.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Thu, 23 Jul 2015 20:02:51 +0000 (16:02 -0400)]
Doc: add LTTNG_UST_CLOCK_PLUGIN to man page
Also add indications on how to use the plugin with lttng-tools.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jonathan Rajotte [Thu, 23 Jul 2015 20:02:50 +0000 (16:02 -0400)]
Doc: add LTTNG_UST_GETCPU_PLUGIN to man page
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Wed, 22 Jul 2015 02:50:54 +0000 (22:50 -0400)]
Cleanup: Add Javadoc to all public methods and members
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Wed, 22 Jul 2015 02:50:44 +0000 (22:50 -0400)]
Fix: Small fixes to the Java agent example files
Remove unused imports.
Add missing dispose() in the log4j example.
Fix typos.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Fri, 17 Jul 2015 23:07:50 +0000 (19:07 -0400)]
Update doc/java-agent.txt to reflect the new packaging
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Tue, 30 Jun 2015 00:13:50 +0000 (20:13 -0400)]
Split Java agent library in 3 separate jars
Instead of having one .jar whose content is dependent on the
configure flags used for the build, we can produce 3 separate
jars whose contents will always be the same:
lttng-ust-agent-common
lttng-ust-agent-jul
lttng-ust-agent-log4j
The configure flag will now determine if the jul/log4j packages
are built or not.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Fri, 17 Jul 2015 17:00:41 +0000 (13:00 -0400)]
Remove deprecated org.lttng.ust.jul.LTTngAgent class
This interface was deprecated back in 2.6. All users should now
use the org.lttng.ust.agent.jul.LTTngAgent class instead.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Fri, 17 Jul 2015 22:06:27 +0000 (18:06 -0400)]
Use tar-ustar format for the dist archive
By default, Automake uses the old tar v7 format, which does not
support file paths longer than 99 characters. With the upcoming
Java agent refactoring, this becomes a problem.
This patch switches to the newer tar-ustar format, which supports
longer file paths in the archive.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 16 Jul 2015 16:07:27 +0000 (12:07 -0400)]
Fix: remove generated file from git tree
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 15 Jul 2015 18:42:05 +0000 (14:42 -0400)]
Version 2.7.0-rc1
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
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>
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>
Philippe Proulx [Tue, 30 Jun 2015 23:45:10 +0000 (19:45 -0400)]
.gitignore: ignore Python agent generated files
Reported-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Philippe Proulx [Tue, 30 Jun 2015 23:39:36 +0000 (19:39 -0400)]
Add ctf_sequence_hex() macro
This patch adds the `_elem_type_base` parameter to
the internal _ctf_sequence_encoded() macro to
specify the sequence's element type's base.
ctf_sequence_hex() sets the `_elem_type_base`
parameter to 16.
This is convenient for recording byte buffers and
viewing them in hexadecimal.
Suggested-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Antoine Busque [Tue, 30 Jun 2015 21:59:01 +0000 (17:59 -0400)]
Fix: set soinfo_data's vdso flag correctly in base address statedump
The vdso flag is set to 0 when the executable can be found on disk.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
Mathieu Desnoyers [Tue, 30 Jun 2015 17:04:27 +0000 (13:04 -0400)]
Cleanup: remove extra whitespace in configure output
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Tue, 30 Jun 2015 15:55:40 +0000 (11:55 -0400)]
Default to no unaligned access on unsupported archs
[ Edit by Mathieu: change configure output style to match current style. ]
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Alexandre Montplaisir [Mon, 29 Jun 2015 20:55:00 +0000 (16:55 -0400)]
cleanup: Coding style fixes to the Java agent
- Use camelCase for regular members and FULL_CAPS for static final
ones (except for API classes).
- All members of an interface are public static final by default,
no need to repeat the modifiers.
- Marked final some fields that could be.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Alexandre Montplaisir [Mon, 29 Jun 2015 20:32:22 +0000 (16:32 -0400)]
cleanup: Mark obsolete JUL agent as @Deprecated
Java has a @Deprecated annotation to indicate deprecated classes
(or methods, members, etc.). This will keep the code available for
backwards compatibility, but will emit a warning to any user calling
it.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
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>
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>
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>
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>
Mathieu Desnoyers [Tue, 23 Jun 2015 17:36:47 +0000 (13:36 -0400)]
Bump tracer version to 2.7.0-pre
Trace viewers use the tracer minor version to know which event name to
expect for the statedump. Since we changed the namespacing of those
events for 2.7, switch the tracer minor version to "7" before rc1, hence
the use of "pre" at this stage of the release process.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
Mathieu Desnoyers [Thu, 18 Jun 2015 18:42:56 +0000 (14:42 -0400)]
Add demo-tracelog to gitignore file
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
Mathieu Desnoyers [Sat, 13 Jun 2015 09:27:07 +0000 (11:27 +0200)]
Implement cpu_id context for filtering
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 10 Jun 2015 11:32:30 +0000 (13:32 +0200)]
ust cyg-profile: use same class for entry and exit
Share same serialization functions for entry and exit events.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
Mathieu Desnoyers [Wed, 10 Jun 2015 11:17:33 +0000 (13:17 +0200)]
Remove caller field from malloc events
This duplicates info now available in the "ip" context.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
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>
Mathieu Desnoyers [Wed, 10 Jun 2015 06:54:37 +0000 (08:54 +0200)]
tracelog: use same class for all loglevels
Each loglevel can be serialized by the exact same serialization
function. Therefore, use a single tracepoint class for all those.
This diminishes the code size of the probe, and therefore its impact on
the instruction cache.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 9 Jun 2015 14:38:21 +0000 (16:38 +0200)]
fix tracelog namespacing of loglevels
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 9 Jun 2015 14:21:00 +0000 (16:21 +0200)]
Add tracelog documentation to lttng-ust(3)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 9 Jun 2015 13:55:07 +0000 (15:55 +0200)]
Implement demo-tracelog example
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 9 Jun 2015 11:56:47 +0000 (13:56 +0200)]
Implement tracelog API
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
Antoine Busque [Mon, 25 May 2015 23:17:09 +0000 (19:17 -0400)]
Rename helper providers and events for consistency
This patch renders uniform the provider names of UST helpers by making
them all start with the "lttng_ust_" prefix. Also, the helper formerly
known as "ust_baddr" is now "lttng_ust_dl", and its "push" and "pop"
events are now "dlopen" and "dlclose", respectively. This is in line
with the other helpers, for which the name of the provider reflects
the name of the library, and the names of events correspond to those
of the traced functions.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Antoine Busque [Mon, 25 May 2015 23:12:30 +0000 (19:12 -0400)]
Refactor state dump system
This patch refactors the state dump system. The state dump provider is
now "lttng_ust_statedump". Each process' state dump is now delimited
by a pair of "start" and "end" events. These events mark the beginning
and end of the state dump, which happens once per traced application
per session. Note that for a given (process, session) pair, begin/end
events are serialized and will match. However, in a session, state
dumps from different processes may be interleaved. The vpid context
should be used to identify which events belong to which process.
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Philippe Proulx [Wed, 1 Apr 2015 00:09:54 +0000 (20:09 -0400)]
Refactor Python agent
This patch refactors the whole LTTng-UST Python agent.
Notorious changes are:
* Python module "lttng_agent" moved to Python package
"lttngust". This removes "agent" from the name, which
really is an implementation detail. "lttngust" is used
because "lttng" would clash with LTTng-tools Python
bindings.
* Python package instead of simple module. Splitting the
code in various modules will make future development
easier.
* Use daemon threads to make sure logging with tracing
support is available as long as the regular threads live,
while making sure that the application exits instantly when
its regular threads die.
* Create client threads and register to session daemons
at import time. This allows the package to be usable just
by importing it (no need to instanciate any specific class
or call any specific function).
* Do not use a semaphore + sleep to synchronize client threads
with the importing thread: use a blocking synchronized
queue with appropriate timeouts.
* Add debug statements at strategic locations, enabled by
setting the $LTTNG_UST_PYTHON_DEBUG environment variable
to 1 before importing the package.
* Override the default session daemon registration timeout
with $LTTNG_UST_PYTHON_REGISTER_TIMEOUT (ms).
* Override the default session daemon registration retry
delay with $LTTNG_UST_PYTHON_REGISTER_RETRY_DELAY (ms).
* Honor $LTTNG_HOME (to retrieve session daemon TCP ports).
* Do not use an absolute path when loading the tracepoint
provider shared object. Users should use the
$LD_LIBRARY_PATH environment variable to override the
default library path when running Python instead.
* Do not keep an event dictionary since this brings issues
when enabling/disabling events with the same name in
different sessions.
* Make sure the reference count does not go below 0,
which could happen when destroying a session which contains
events that are disabled already.
* Minor improvements to make the code more Pythonic.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
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>
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>
Mathieu Desnoyers [Tue, 14 Apr 2015 22:13:19 +0000 (18:13 -0400)]
Fix: getcpu/clock plugin handle leak
Keep the handle to the shared object in a static variable. Use it to
check whether it has already been initialized.
We don't allow dlclose() for now though, so it technically leaks, but at
least we keep a reference to the handle.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 14 Apr 2015 18:07:36 +0000 (14:07 -0400)]
Fix: add missing new ldl dependency for liblttng-ust-ctl
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.046002 seconds and 4 git commands to generate.