1
0
Fork 1
mirror of https://git.lttng.org/lttng-tools.git synced 2026-04-12 09:49:30 -04:00
No description
  • C++ 71.2%
  • Shell 10.2%
  • Python 7.8%
  • C 6.8%
  • M4 2.6%
  • Other 1.3%
Find a file
Jérémie Galarneau b46f9528eb Fix: tests: consumer pause testpoint FIFO EOF mishandled as error
Observed issue
==============

The notification tests (test_notification_multi_app,
test_notif_ust_buffer_usage) occasionally hang on CI

Cause
=====

The consumer pause testpoint reads from a named FIFO opened with
O_NONBLOCK. Between test script echo commands, no process has the
FIFO open for writing. Per POSIX, read() on a FIFO with O_NONBLOCK
and no writers returns 0 (EOF), not -1 with errno set to EAGAIN.

After a 0-byte read, errno is unchanged from its previous value.
The testpoint then evaluates:

    ret = (errno == EAGAIN) ? 0 : -errno;

If errno happens to be non-zero and not EAGAIN, the testpoint returns a
non-zero value, causing the data thread to exit silently. Without the
data thread, buffers cannot drain and buffer usage notifications are
never produced, hanging the test.

Solution
========

Explicitly handle read() returning 0 (EOF) as a non-error
condition before falling through to the errno check.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Icc574898cc1d86593f7635d9441338528c902840
2026-04-10 15:56:54 -04:00
.vscode Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
doc sessiond: Add --spawn-consumers option 2026-03-05 19:42:14 +00:00
extras Add SPDX copyright headers to documentation files 2026-03-05 19:27:16 +00:00
include Add SPDX copyright headers to all Makefiles 2026-03-05 19:26:57 +00:00
LICENSES Add SPDX copyright headers to data files 2026-03-05 19:27:18 +00:00
m4 Add SPDX copyright headers to m4 macros 2026-03-05 19:27:07 +00:00
src consumerd: Fix segfault when starting metadata switch timer 2026-04-09 14:28:52 -04:00
tests Fix: tests: consumer pause testpoint FIFO EOF mishandled as error 2026-04-10 15:56:54 -04:00
version Add SPDX copyright headers to documentation files 2026-03-05 19:27:16 +00:00
.clang-format Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.clang-format-ignore Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.clang-tidy Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.commit_template .commit_template: update style and info 2026-03-24 14:35:23 -04:00
.commit_template.license Add SPDX copyright headers to data files 2026-03-05 19:27:18 +00:00
.editorconfig Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.git-blame-ignore-revs Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.gitignore common: Add stub lttng-relayd tracepoint provider 2026-03-26 16:16:51 -04:00
.gitreview Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.lcovrc Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
.shellcheckrc tests: utils.sh: Make shellcheck happy 2025-08-18 15:45:51 -04:00
.travis.yml Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
bootstrap Add SPDX copyright headers to all Makefiles 2026-03-05 19:26:57 +00:00
ChangeLog Add SPDX copyright headers to documentation files 2026-03-05 19:27:16 +00:00
CLAUDE.md Add SPDX copyright headers to documentation files 2026-03-05 19:27:16 +00:00
CodingStyle.md Delete obsolete kernel-CodingStyle.txt 2026-03-05 19:27:27 +00:00
configure.ac relayd: Hook-up lttng-relayd tracepoints 2026-03-26 16:16:55 -04:00
CONTRIBUTING.md Add SPDX copyright headers to documentation files 2026-03-05 19:27:16 +00:00
format-cpp Fix: format-cpp: all files excluded when ignore file contains blank lines 2026-03-06 16:58:41 +00:00
LICENSE Convert LICENSES to the REUSE standard 2026-03-05 19:26:49 +00:00
Makefile.am Add SPDX copyright headers to data files 2026-03-05 19:27:18 +00:00
pre-inst-env.in doc: generate man pages in section subdirectories 2026-01-15 18:53:08 +00:00
pyproject.toml Add SPDX copyright headers to support files 2026-03-05 19:27:09 +00:00
README.adoc configure.ac: require Python ≥ 3.5 with --enable-tests (default) 2026-03-05 19:30:22 +00:00

Jenkins Coverity

LTTngtools is a set of components to control LTTng tracing.

The project includes:

  • The LTTng session daemon.

  • The LTTng consumer daemon.

  • The LTTng relay daemon.

  • liblttngctl, a library with a C API used to communicate with the session daemon.

  • Python 3 bindings of liblttngctl.

  • lttng, a command-line tool over liblttngctl.

  • lttngcrash, a command-line tool to recover and view LTTng 2 trace buffers in the event of a crash.

Required and optional dependencies

You need the following dependencies to build and run the LTTngtools components:

  • Linux kernel ≥ 4.4.0

  • Userspace RCU ≥ 0.14.0.

    Debian/Ubuntu package: liburcudev.

  • popt ≥ 1.13

    Debian/Ubuntu package: libpoptdev.

  • Libxml2 ≥ 2.7.6

    Debian/Ubuntu package: libxml2dev

The following dependencies are optional:

  • Babeltrace ≥ 2.1: default viewer of the lttng view command, make check and tests.

    Debian/Ubuntu package: babeltrace2 libbabeltrace2-dev

  • LTTngUST (same minor version as LTTngtools): LTTng user space tracing (applications and libraries).

    Debian/Ubuntu package: liblttngustdev

  • Python ≥ 3.5: make check and tests.

    Debian/Ubuntu package: python3

  • SWIG ≥ 2.0 and Python 3 development headers: Python bindings (enabled at build configuration time with the enablepythonbindings option).

    Debian/Ubuntu packages: swig2.0 and python3dev

  • modprobe and/or kmod ≥ 22: automatic LTTng kernel modules loading (kernel tracing).

  • Bash: make check.

  • man (manual pager): view lttng command manual pages with the help option or with the lttng help command.

    Note
    You can use the build configuration option enableembeddedhelp to embed the manual pages into the lttng, lttngsessiond, lttngrelayd, and lttngcrash programs so that you dont need man to view them.
  • libpfm ≥ 4.0: perf regression test suite.

    Debian/Ubuntu package: libpfm4-dev

  • xxd: make check and certain tests.

    Debian/Ubuntu package: xxd

  • lcov: make check-code-coverage

    Debian/Ubuntu package: lcov

LTTngtools supports both the LTTng Linux kernel tracer and LTTng user space tracer sharing the same minor version. While some minor releases do not change the tracer ABIs and could work, no testing is performed to ensure that cross-version compatibility is maintained.

You dont need to rebuild or modify applications instrumented with older versions of the LTTngUST project to make them work with the components of the latest LTTngtools release.

See the LTTng Documentation for more information on versioning.

Build from source

Dependencies

You need the following tools to build LTTngtools:

To build the LTTngtools manual pages:

  • AsciiDoc ≥ 8.4.5

    Note
    Previous versions could work, but were not tested.
  • xmlto ≥ 0.0.21

    Note
    Previous versions could work, but were not tested.

If you use GNU gold, which is not mandatory:

  • GNU gold ≥ 2.22

Note
With GNU gold, you might need to add -L/usr/local/lib to the LDFLAGS environment variable.

Build steps

  1. If you have the LTTngtools Git source, run:

    $ ./bootstrap

    This script creates the configure script.

  2. Configure the build:

    $ ./configure

    If you want the liblttngctl Python bindings, use the enablepythonbindings option. See also the PYTHON and PYTHON_CONFIG environment variables in ./configure help.

    If you dont want to build the manual pages, use the disablemanpages option.

    If you want to embed the manual pages into the lttng, lttngsessiond, lttngrelayd, and lttngcrash programs so that you dont need man to view them, use the enableembeddedhelp option.

    This build configuration script finds LTTngUST with pkgconfig: set the PKG_CONFIG_PATH environment variable accordingly if pkgconfig cannot find the lttngust package information.

    See ./configure help for the complete list of options.

  3. Build the project:

    $ make
  4. Install the project:

    $ sudo make install
    $ sudo ldconfig

Tests

To run all the tests:

$ make check

Usage

See the Tracing control section of the LTTng Documentation to learn how to use the LTTngtools components.

See also the LTTng manual pages (all section 1 and 8 pages).

As theres no official liblttngctl Python bindings yet, see doc/python-howto.txt to understand how to use them.

Supported versions

The LTTng project supports the last two released stable versions (e.g. stable-2.13 and stable-2.12).

Fixes are backported from the master branch to the last stable version unless those fixes would break the ABI or API. Those fixes may be backported to the second-last stable version, depending on complexity and ABI/API compatibility.

Security fixes are backported from the master branch to both of the last stable version and the second-last stable version.

New features are integrated into the master branch and not backported to the last stable branch.

Community

Mailing list

lttng-dev (lttng-dev@lists.lttng.org)

IRC channel

#lttng on the OFTC network

Mastodon

lttng

Bug tracker

LTTngtools bug tracker

GitHub project

lttng/lttngtools

Continuous integration

LTTngtoolss master build on LTTngs CI

Code review

lttngtools project on LTTng Review

Contributors guide

https://github.com/lttng/lttng-tools/blob/master/CONTRIBUTING.md