Would deal with spaces in the env. var. if there are any. It does not
seem to be important in practice (currently), because automake seems to
fail on CC including spaces at configure time.
Make sure that the ust_baddr_statedump probe is registered prior to
using the tracepoint in lttng_ust_baddr_statedump(). This fix solves the
issue that in rare cases the very first ust_baddr_statedump events were
missing.
Use a reference counting approach that allows constructors/destructors
of the probe to be called many times, as long as the number of calls to
constructor matches the number of calls to destructor.
Reported-by: Paul Woegerer <paul_woegerer@mentor.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Paul Woegerer [Tue, 10 Dec 2013 13:07:51 +0000 (14:07 +0100)]
Fix: baddr_statedump tracepoint registration
Ensure baddr_statedump tracepoint registration is completed prior to
using the tracepoint in lttng_ust_baddr_statedump().
Make liblttng-ust-dl robust for explicit baddr_statedump tracepoint
deregistration in lttng_ust_cleanup() (prevent dlopen/dlclose to get
traced if ust_baddr tracepoints are not available).
Signed-off-by: Paul Woegerer <paul_woegerer@mentor.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix RCU races by ensuring every UST source file using RCU read-side lock
is marked as _LGPL_SOURCE. The dynamic binding to urcu-bp relies on the
dynamic loader, and it seems not to behave well when used from
constructors.
Use Userspace RCU with this commit to completely fix baddr races:
"Fix: urcu-bp interaction with threads vs constructors/destructors"
It should use lib_ring_buffer_read_offset_address() to get the packet
being read, rather than lib_ring_buffer_offset_address(), which is only
meant to be used when writing to the packet.
Compile liblttng-ust-baddr c files into liblttng-ust
Move them into liblttng-ust/, where they are now compiled.
This is to ensure we don't rely on statically linked libs (and
associated constructor problems), and that we don't install a shared
object in the system needlessly.
By using the timestamp sampled at space reservation when the packet is
being filled as "end timestamp" for a packet, we can ensure there is no
overlap between packet timestamp ranges, so that packet timestamp end <=
following packets timestamp begin.
Overlap between consecutive packets becomes an issue when the end
timestamp of a packet is greater than the end timestamp of a following
packet, IOW a packet completely contains the timestamp range of a
following packet. This kind of situation does not allow trace viewers
to do binary search within the packet timestamps. This kind of situation
will typically never occur if packets are significantly larger than
event size, but this fix ensures it can never even theoretically happen.
The only case where packets can still theoretically overlap is if they
have equal begin and end timestamps, which is valid.
David Goulet [Wed, 20 Nov 2013 16:35:35 +0000 (11:35 -0500)]
JUL: fix enable all event for delayed Logger
This adds a HashMap containing the enabled Logger names (and wildcard
'*'). This is used to make sure we don't enable twice the same Logger
for the '*' event name (enable all -a).
Signed-off-by: David Goulet <dgoulet@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Jon Bernard [Fri, 15 Nov 2013 14:12:47 +0000 (09:12 -0500)]
Escape minus signs in lttng-ust-cyg-profile manpage
By default, "-" chars are interpreted as hyphens (U+2010) by groff, not
as minus signs (U+002D). Since options to programs use minus signs
(U+002D), this means for example in UTF-8 locales that you cannot cut
and paste options, nor search for them easily.
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:35 +0000 (12:22 +0200)]
Add a check against excluders
When matching enablers with events, first check against all
excluders of the enabler. If the event matches with any of the excluders,
then the event does not match with the enabler.
[ Edit by Mathieu Desnoyers: apply coding style changes. ]
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:34 +0000 (12:22 +0200)]
Add handler for LTTNG_UST_EXCLUSION in UST ABI
Add message handler for the LTTNG_UST_EXCLUSION command in
UST ABI. Copy the exclusion data into a lttng_ust_excluder_node
structure and pass it to the enabler command handler.
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:33 +0000 (12:22 +0200)]
Store exclusions to enablers
Implement a function that adds exclusions to the list in the enabler.
Call this function in the enabler command handler when the
LTTNG_UST_EXCLUSION command is received.
JP Ikaheimonen [Thu, 7 Nov 2013 10:22:32 +0000 (12:22 +0200)]
Add excluders to enabler structure
Define a structure that holds excluders and can be used in lists.
Add a list holding these structures to the enabler structure.
Initialize and destroy the list when the enabler is initialized
and destroyed.
David Goulet [Thu, 7 Nov 2013 21:34:23 +0000 (16:34 -0500)]
Add liblttng-ust-jul for JUL support
The build system creates a jar file named liblttng-ust-jul.jar to be
linked with the Java application. A public library named
liblttng-ust-jul.so is also created and must be in the library path of
the Java application in order for the LTTngAgent to use it for the
tracer's JNI call.
A unit test is also added and integrated with the "make check" command.
Signed-off-by: David Goulet <dgoulet@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: application SIGBUS when starting in parallel with sessiond
There is a race between application startup and sessiond startup, where
there is an intermediate state where applications can SIGBUS if they see
a zero-sized shm, if the shm has been created, but not ftruncated yet.
On the UST side, fix this by ensuring that UST can read the shared
memory file descriptor with a read() system call before they try
accessing it through a memory map (which triggers the SIGBUS if the
access goes beyond the file size).
On the sessiond side, another commit needs to ensure that the shared
memory is writeable by applications as long as its size is 0, which
allow applications to perform ftruncate and extend its size.
We need to perform both connect and sending registration message before
doing the next connect otherwise we may reach unix socket connect queue
max limits and block on the 2nd connect while the session daemon is
awaiting the first connect registration message.
This happens in scenarios where unix socket connect queues are nearly
full.
Fix: ust-comm recvmsg should handle partial receive
Handles cases where unix socket buffer is full. Without this fix, the
session daemon kicks out application that happen to have their
registration message split into multiple recvmsg on the sessiond side.
For the "ordered comparison of pointer with integer zero" warning, fix
this by comparing (type) -1 against (type) 0 instead of just 0, so if
"type" is a pointer type, this pointer type will be applied to the right
operand too, thus fixing the warning.
Ikaheimonen, JP [Mon, 7 Oct 2013 13:33:02 +0000 (09:33 -0400)]
Add usage reference count for tracepoints
Keep track of how many libraries use a tracepoint, and disable the
tracepoint when the number of users drops to zero.
A new reference counter is added to tracepoint_entry. This keeps track
of how many callsites use that tracepoint.
When you have libraries and/or executables sharing tracepoints, you
cannot just disable your tracepoints when the library is unregistered.
You must check that the tracepoint is not used by any other libraries
before you disable it.
Function lib_disable_tracepoints becomes unnecessary, and is removed.
These new calls export the data required for the consumer to
generate the index while tracing :
- timestamp begin
- timestamp end
- events discarded
- context size
- packet size
- stream id
Prepare the ring-buffer config to have custom callbacks. These custom
callbacks are not related to the ring-buffer operations but allow
applications to add custom functions.
No additional feature or change in behaviour in this patch.
Allow overriding the path where the system-wide sessiond is expected to
keep its runtime files.
It does _not_ allow multiple instances of system-wide sessiond to run in
parallel though, because the wait shm files still requires having only
one single system-wide sessiond at any given time.
Amit Margalit [Mon, 8 Jul 2013 16:10:31 +0000 (12:10 -0400)]
Allow environment variable LTTNG_HOME to override HOME
Patch functionality - If LTTNG_HOME environment variable exists, it is
used instead of HOME. Reason for patch - We are trying to deploy LTTng
on a system where $HOME is on a filesystem mounted read-only, but cannot
afford to run lttng as a different user and cannot move the home
directories of users to writeable locations.
This function allows the consumer to write at most one packet of data to
the channel, that way we can push data to the ring buffer without
risking to block on subbuffer switch.