Fix: alignment problems on targets not supporting unaligned access.
Accessing floats, doubles and 64 bit int at unaligned addresses is not
supported on all configurations of arm processors and if it is it's
emulated and slow. This patch replaces direct assignments with memcpy.
Signed-off-by: Fredrik Markström <fredrik.markstrom@gmail.com> Signed-off-by: Roy Li <rongqing.li@windriver.com> Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 23 May 2014 19:04:23 +0000 (15:04 -0400)]
Fix: don't send consumer error to sessiond in teardown
At that point, the control socket has been closed thus the session
daemon is aware that the consumer died. The consumer exit reason is not
even handled by the session daemon.
In the case of the session daemon tearing down, the consumer should
avoid trying to send data on a potentially closed socket.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 23 May 2014 18:36:33 +0000 (14:36 -0400)]
Don't print time and pid/tid in ERR() and WARN()
The lttng command line uses these two macros to print information to the
user. With the time and pid/tid, it is not really user friendly and
useful for the user.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Wed, 21 May 2014 19:19:22 +0000 (15:19 -0400)]
Fix: Tests with racy event validation
Similar to d7ee608c00feacea3cfd5a740df64e5215347cb9, make sure that the
event validation scheme is not racy. If we need to wait for applications
to complete simply start them in foreground or use the built-in 'wait'
command in bash to wait for applications started in background.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 21 May 2014 16:09:15 +0000 (12:09 -0400)]
Fix: disable-event/channel return error if no domain
The disable-event/channel command now check for a UST/kernel session
before trying to disable the object. If none exists, it returns an error
without creating a domain.
Fixes #638
Signed-off-by: David Goulet <dgoulet@efficios.com>
Jan Glauber [Wed, 14 May 2014 14:26:32 +0000 (16:26 +0200)]
Configurable kernel module probes support
Create a kernel module probes list and use it to load the specified
probes. The probes are selectable by the --kmod-probes command line
option to lttng-sessiond or the LTTNG_KMOD_PROBES environment variable.
If neither is set all probes are loaded so the current behaviour is not
changed.
Signed-off-by: Jan Glauber <jan.glauber@gmail.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 7 May 2014 17:53:36 +0000 (13:53 -0400)]
Fix: JUL filtering done on the UST level
This is to support enabling all events with different loglevels in two
different sessions.
For this, if any loglevel have been defined, the 'int_loglevel' filter
is added to the UST event. The liblttng-ust-jul library has been
modified to stop filtering loglevel in the agent.
This commit adds two tests, one for a back to back session that are
destroyed and a second one for multi loglevel session.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Introduce perf:cpu:* and perf:thread:* performance monitoring counter
contexts. perf:cpu: is used for kernel tracing, and perf:thread: is used
for UST. perf:* is kept for backward compatibility, but not shown in
lttng add-context --help anymore.
Example usages of performance counters have been adapted to this new
interface.
For the lttng.h API We introduce LTTNG_EVENT_CONTEXT_PERF_CPU_COUNTER
and LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER as the API counterparts of
the new command line options. LTTNG_EVENT_CONTEXT_PERF_COUNTER is kept
for backward compatibility.
For ABIs with the tracers, introduce the new
LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER to support this new UST feature.
Rename LTTNG_KERNEL_CONTEXT_PERF_COUNTER to
LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER, following the same change in
lttng-modules (keeping the same enum entry value).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
This patch enables lttng-tools to run on top of glibc 2.8.
Overall it fixes 2 things:
1. No support for epoll_create1(..) and EPOLL_CLOEXEC.
2. No support for htobe/betoh
For 1, we revert back to epoll_create() and then sets CLOEXEC through
fcntl instead.
For 2, we define htobe/betoh as part of the compat/endian.h and make
sure that any users of those functions actually include compat/endian.h
instead of implicit include of system endian.h
while [ -n "$(pidof $TESTAPP_BIN)" ]; do
sleep 1
done
pass "Wait for application end"
[...]
tracing_teardown
validate_trace $EXACT_EVENT_COUNT
It is possible that the check for "pidof $TESTAPP_BIN" occurs _before_
the execve() of the applications (starting the applications in background
with & is basically a clone() + execve()). The consequence is that the check
succeed, never waiting for any applications to finish and then the tracing
sessions are prematurely teared down. Thus the resulting trace contains only
some events. We then validate for a fixed number of events and thus the test
fails caused by this racy scheduling situation.
The fix is to start the applications in foreground instead of background.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Override the session.xsd path with an ENV. variable
The LTTNG_SESSION_CONFIG_XSD_PATH environment variable can be used to
specify a path which contains the session configuration schema. This
will allow save-load tests to be ran without installing the XSD on the
system.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Simon Marchi [Thu, 10 Apr 2014 15:30:19 +0000 (11:30 -0400)]
Fix: rework utils_parse_size_suffix
Ok, so there are a lot of problems with this function (sorry :|). Taking
the regex road is probably to complicated for nothing, so here is a
version without regexes.
I added many test cases as suggested by Sandeep Chaudhary and Daniel
Thibault. I tested on both Intel 32 and 64 bits.
Fixes #633
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Thu, 3 Apr 2014 17:14:00 +0000 (13:14 -0400)]
Fix: don't delete stream from connection recv list
We don't need to delete them from the list during a connection destroy
because it's only a reference to the stream that might be valid or not
during the connection destroy. There is no need at all to access the
stream's pointer at that point.
David Goulet [Wed, 2 Apr 2014 14:31:34 +0000 (10:31 -0400)]
Fix: use after free of a relayd stream
A race could occur with a stream destruction and a control connection
being destroyed emptying its recv_list. A freed stream could still be in
the list thus having a use after free during the connection destroy.
That was triggering undefined behavior from infinite looping to
segmentation faults.
We've observed this issue on high load stress test. A relayd received
all the stream but NOT the streams sent command which empty the list.
This can happen if a start tracing never occured or failed on the
application side thus the close stream command is sent to the relayd
freeing the stream before it is removed from that list.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 1 Apr 2014 15:36:13 +0000 (11:36 -0400)]
Fix: don't print stream name in error message
The stream received, in per UID, is actually a temporary stream object
that only contains the UST object data which is the relevant part for
UST to use.
Thus on error the name was random data thus print the valid handle
descriptor instead of invalid data.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 28 Mar 2014 13:58:03 +0000 (09:58 -0400)]
Fix: take session list lock when listing tp
This is important since the list tracepoints command access the
application socket to ask the application for its TPs. The session list
lock protects the ordering of message for those sockets.
This was triggering out of order message between the session daemon and
an application thus triggering undefined behavior.
Fixes #774
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 19 Mar 2014 18:34:27 +0000 (14:34 -0400)]
Fix: add consumer wake up pipe to avoid race
UST application will notify the wait_fd pipe for every subbuffer that it
writes and ready to be consumed. However, on *high* load systems, this
1:1 property can fail if the pipe gets filled up. For performance
reason, UST will ignore this error and continue since it can't wait for
the pipe to clear up.
This triggers a race condition where we have *one* wake up on the UST
pipe for potentially multiple subbuffers. A data pending command will
wait forever on streams that still has data but the data thread could'nt
consumed them because of this 1:n possible race. Using the stop command
without waiting would mean a memory/fd leak of the stream.
Thus, we add a consumer wake up pipe here that notifies the data thread
if there is still data to be read after a successful read subbuffer
call. With this, we end up handling the residual buffers if any since
the data thread is always notified when there is still data to be read.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Mar 2014 19:52:31 +0000 (15:52 -0400)]
Fix: use NULL url for load live session
For a live session, the control and data URI are mandatory thus pass
NULL to the create session so we can set them afterwards by a set
consumer URL call.
net:// can't be used for control and data so this fixes the uri to url
string by printing "tcp://" instead of net:// which is more accurate and
the good way to actually print the URL to the user.
Fixes #767
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Mar 2014 18:23:00 +0000 (14:23 -0400)]
Fix: allow empty URL for live session creation
This is actually very important so -C/-D can be used with lttng create
--live command and also the load command can set the control and data
URL independently.
This also adds a small test to make sure -C/-D works in live mode.
Fixes #769
Signed-off-by: David Goulet <dgoulet@efficios.com>