lttng-ust:stable-2.11

Last commit made on 2020-09-22
Get this branch:
git clone -b stable-2.11 https://git.launchpad.net/lttng-ust

Branch merges

Branch information

Name:
stable-2.11
Repository:
lp:lttng-ust

Recent commits

2886e46... by Mathieu Desnoyers on 2020-09-22

Fix: ustctl_release_object: eliminate double-close/free on error

When ustctl_release_object returns an error, it is unclear to the caller
what close/free side effects were effectively performed and which were
not. So the only courses of action are to either leak file descriptors
or memory, or call ustctl_release_object again which can trigger double
close or double free.

Fix this by setting the file descriptors to -1 after successful close,
and pointers to NULL after successful free.

Signed-off-by: Mathieu Desnoyers <email address hidden>

1e160d5... by Michael Jeanson <email address hidden> on 2020-07-13

tests: return the proper TAP exit code

The C TAP library provides the 'exit_status()' function that will return
the proper exit code according to the number of tests that succeeded or
failed.

Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I786527dfa9cfe2d1a7c8bc80086d54186f60b4d9

5e15e5e... by Jonathan Rajotte on 2020-06-17

Fix: python agent: 'time' has no attribute 'clock'

The time.clock() function was removed in python 3.8 and is marked as
deprecated since python 3.3. See PEP 418 for more details [1].

Solution
=====

When the python version is greater than 3.2 use the
`time.perf_counter()` function [2]. Otherwise, fall back to
`time.clock()`.

Introduce a compat module to the lttngust agent package providing the
`_clock` function.

[1] https://www.python.org/dev/peps/pep-0418/
[2] https://docs.python.org/3/library/time.html#time.perf_counter

Signed-off-by: Jonathan Rajotte <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I3d6d8b24309d45d43b634dc2a6b4d5dbc12da3aa

a32694f... by Christophe Bedard on 2020-06-01

Fix: libc-wrapper: undef temporary token rather than value

The lttng-ust malloc wrapper defines pthread_mutex_lock/unlock
preprocessor tokens to ust_malloc_spin_lock/unlock around the definition
of a TLS variable, which uses pthread mutexes when relying on the
pthread key fallback. Undefining those tokens should be done on the
preprocessor token, rather than its value.

Signed-off-by: Christophe Bedard <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I2053b79c88000e272c29b25ca105b1352ecfabd7

0548a25... by Michael Jeanson <email address hidden> on 2020-06-26

Fix: support compile units including 'sys/sdt.h' without defining SDT_USE_VARIADIC

Instead of using SDT_USE_VARIADIC from 'sys/sdt.h', use our own namespaced
macros since the instrumented application might already have included
'sys/sdt.h' without variadic support.

Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: Idfece1a65a5296a90d33370bc8d73ea554c14b0f

89909e3... by Francis Deslauriers <email address hidden> on 2020-05-05

Fix: event probes attached before event enabled

Background
==========
When userspace events with exclusions are enabled by the CLI user, the
session daemon enables the events in a 3-steps process using the
following ustctl commands:
1. `LTTNG_UST_EVENT` to create an event and get an handle on it,
2. `LTTNG_UST_EXCLUSION` to attach exclusions, and
3. `LTTNG_UST_ENABLE` to activate the tracing of this event.

Also, the session daemon uses the `LTTNG_UST_SESSION_START` to start the
tracing of events. In various use cases, this can happen before OR after
the 3-steps process above.

Scenario
========
If the`LTTNG_UST_SESSION_START` is done before the 3-steps process the
tracer will end up not considering the exclusions and trace all events
matching the event name glob pattern provided at step #1.

This is due to the fact that when we do step #1, we end up calling
`lttng_session_lazy_sync_enablers()`. This function will sync the event
enablers if the session is active (which it is in our scenario because
of the _SESSION_START).
Syncing the enablers will then match event name glob patterns provided
by the user to the event descriptors of the tracepoints and attach
probes in their corresponding callsite on matches.

All of this is done before we even received the exclusions in step #2.

Problem
=======
The problem is that we attach probes to tracepoints before being sure we
received the entire description of the events.
Step #2 may reduced the set of tracepoints to trace so we must wait
until exclusions are all received to attached probes to tracepoints.

Solution
========
Only match event names and exclusions (and ultimately, register probes)
on enabled enablers to ensure that no other modifications will be
applied to the event.

Event enablers are enabled when at step #3.

Note
====
Filters are not causing problems here because adding a filter won't
change what tracepoints are to be traced.

Signed-off-by: Francis Deslauriers <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: Id984f266d976f346b001db81cd8a2b74965b5ef2

6aad8ee... by Mathieu Desnoyers on 2020-04-23

Fix: agent: read: end of loop condition should exclude 0

Causes the agent to hang endlessly waiting for completion of the
loop.

Signed-off-by: Mathieu Desnoyers <email address hidden>

dc60181... by Michael Jeanson <email address hidden> on 2020-04-22

fix: Java examples CLASSPATH override

Variables provided to make as arguments, called 'command variables' can't
be reassigned a new value in the Makefile. Since the CLASSPATH is now
passed this way in the glue between automake and the example makefiles,
use different names for the internal variables.

Change-Id: Id6289273f211f544a66d933a96f06df75243415f
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

dafacb7... by Michael Jeanson <email address hidden> on 2020-04-22

fix: Add CLASSPATH to autoconf precious variables

This will record the value of CLASSPATH in the autoconf cache and ensure
it's used when calling make even if it's not exported to the
environment.

Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: Ia06070dd352f9d3b6956a1ec0f4eb1d024f73179

757cf67... by Mathieu Desnoyers on 2020-04-22

Fix: Java agent: close session daemon socket on error

When catching an error, close the socket used to communicate with the
session daemon rather than leaking it, before retrying to connect.

Also, when sleep is interrupted, there is no point in printing
out the stack trace. Just retry connection immediately.

Signed-off-by: Mathieu Desnoyers <email address hidden>