- C++ 51.8%
- C 32.6%
- Python 12.7%
- M4 1.6%
- Makefile 0.8%
- Other 0.5%
What the traces from the bug report have in common is that the clock-mapped timestamp exists in the event header but NOT in the packet context. The _mDefClkVal can be updated by any field with UIntFieldRole::DefClkTs role. Thus on the _handleSetPktInfoItemState() level, the _mBeginDefClkVal could be updated with a value coming from the event header. This caused a mismatch on the MsgIter::_handleItem(const PktInfoItem&) level, as the item.beginDefClkVal returned a non-null timestamp inherited from the event header, but _mStream.cls().packetsHaveBeginningClockSnapshot() evaluated to false, as it returns true iff *packet context* contains a field with role DefClkTs as per metadata-stream-parser.cpp:1901. The mismatch resulted in failing a (valid) library precondition: pre:message-packet-beginning-create-with-default-clock-snapshot:without-default-clock-snapshot in bt_message_packet_beginning_create_with_default_clock_snapshot(). This commit changes _mBeginDefClkVal to be updated only if the DefClkTs-role field class exists in the packet context, thus removing the mismatch. Resolves: P-1389 Change-Id: Ie389528fb71a8ee2833d940f053310b1b65e59f8 Signed-off-by: Adam Greloch <adam.greloch@phoenix-rtos.com> Reviewed-on: https://review.lttng.org/c/babeltrace/+/17313 CI-Build: Philippe Proulx <eeppeliteloop@gmail.com> Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com> Tested-by: jenkins <jenkins@lttng.org> |
||
|---|---|---|
| doc | ||
| include | ||
| LICENSES | ||
| m4 | ||
| src | ||
| tests | ||
| tools | ||
| version | ||
| zsh-completion | ||
| .clang-format | ||
| .clang-tidy | ||
| .editorconfig | ||
| .gitignore | ||
| .gitreview | ||
| .pre-commit-config.yaml | ||
| bootstrap | ||
| ChangeLog | ||
| CodingStyle.md | ||
| configure.ac | ||
| CONTRIBUTING.adoc | ||
| dev-requirements.txt | ||
| LICENSE | ||
| Makefile.am | ||
| pyproject.toml | ||
| README.adoc | ||
| setup.cfg | ||
| std-ext-lib.md | ||
The Babeltrace 2 project offers a library with a C API, Python 3 bindings, and a command-line tool (CLI) which makes it very easy for mere mortals to view, convert, transform, and analyze traces.
Babeltrace 2 is also the reference parser implementation of the Common Trace Format (CTF), a flexible trace format which various tracers and tools such as LTTng and barectf produce natively. The Babeltrace 2 library and its Python bindings can read and write CTF traces.
See the Babeltrace 2 official website, in
particular the
babeltrace2-intro(7)
manual page, to learn more about the project.
|
Note
|
Babeltrace 1 vs. Babeltrace 2
The Babeltrace project exists since 2010. In 2020, Babeltrace 2 was released. Babeltrace 2 is a complete rewrite of the library, Python bindings, and CLI. It’s plugin-based and offers much more features and potential than Babeltrace 1 while delivering comparable performance. Some Linux distributions still provide packages for the Babeltrace 1 project. Both projects can coexist on the same system as there are no conflicting files. This README documents the Babeltrace 2 project. |
Build Babeltrace 2.1 from source
Build-time requirements
To build Babeltrace 2.1, you need:
- Compiler
-
-
Any GCC-like compiler with C99 and GNU extension support.
Clang is one of those.
-
Any C++ compiler with C++17 support (for example, GCC ≥ 7.5 and Clang ≥ 5).
-
- Tools
-
-
If you build from a Git clone:
-
GNU Automake ≥ 1.13
-
GNU Autoconf ≥ 2.69
-
GNU Libtool ≥ 2.2
-
flex ≥ 2.5.35
-
GNU Bison ≥ 3.0
-
- Libraries
-
-
A C library (for example, GNU C Library, musl libc)
-
GLib ≥ 2.56 (Debian/Ubuntu:
libglib2.0-dev; Fedora:glib2-devel) -
{fmt} ≥ 10.1.1 (Debian/Ubuntu:
libfmt-dev; Fedora:fmt-devel)Use an in-tree {fmt} with
--enable-vendor-fmtif you can’t install it.
-
- If you need the
bt2Python bindings - If you need the LTTng debug information filter component class (
filter.lttng-utils.debug-info) -
-
elfutils ≥ 0.154 (Debian/Ubuntu:
libelf-devandlibdw-dev; Fedora:elfutils-develandelfutils-libelf-devel)
-
- If you need the Babeltrace 2 C API HTML documentation
-
-
Doxygen ≥ 1.8.6
-
- If you need the Babeltrace 2 manual pages
- If you need the
bt2Python bindings documentation -
-
Sphinx ≥ 1.3 for Python 3 (Debian/Ubuntu/Fedora:
python3-sphinx)
-
- If you need to build and run the tests
-
-
Python ≥ 3.5 (development libraries and
python3-config) (Debian/Ubuntu:python3-dev; Fedora:python3-devel) -
pytest ≥ 6.1.0 (Debian/Ubuntu/Fedora:
python3-pytest)Use an in-tree pytest with
--enable-vendor-pytestif you can’t install it. -
SWIG ≥ 3.0
-
Catch2 ≥ 3.7.1 (Debian/Ubuntu:
libcatch2-dev)Use an in-tree Catch2 v3 with
--enable-vendor-catch2if you can’t install it.
Disable test building with
--disable-testsat configuration time. -
Procedure
To build Babeltrace 2:
-
If you build from a Git clone, do:
$ ./bootstrap
This generates the
configurescript and other important files. -
$ ./configure
The following options can modify the build:
--disable-tests-
Do not build the tests at all.
In that case, the
checkMake target still works, but it doesn’t run any test and exits with status 0. --enable-api-doc-
Build the Babeltrace 2 C API HTML documentation.
--enable-built-in-plugins-
Statically link the official plugins into the
babeltrace2executable. --enable-built-in-python-plugin-support-
Statically link the Python plugin provider into libbabeltrace2.
--enable-debug-info-
Build the LTTng debug information filter component class (
filter.lttng-utils.debug-info). --enable-man-pages-
Build the Babeltrace 2 manual pages.
--enable-python-bindings-
Build the
bt2Python bindings.You can set the path to custom
python3andpython3-configprograms with thePYTHONandPYTHON_CONFIGenvironment variable. --enable-python-bindings-doc-
Build the
bt2Python bindings documentation. --enable-python-plugins-
Build support for Babeltrace 2 Python plugins.
--enable-vendor-pytest-
Use an in-tree pytest instead of an installed one.
The following environment variables can modify the build:
BABELTRACE_DEBUG_MODE-
Set to
1to enable the debug mode.The debug mode enables more run-time assertions to detect bugs while developing the Babeltrace 2 project.
BABELTRACE_DEV_MODE-
Set to
1to enable the developer mode.The Babeltrace 2 developer mode enables more precondition and postcondition assertions to detect C API usage errors.
BABELTRACE_MINIMAL_LOG_LEVEL-
Set the build-time, minimal logging level for all the modules of the project.
Set to
TRACE,DEBUG, orINFO. BABELTRACE_PLUGIN_PROVIDERS_DIR-
Installation directory of Babeltrace 2 plugin providers.
BABELTRACE_PLUGINS_DIR-
Installation directory of Babeltrace 2 official plugins.
Run
./configure --helpto list all the available options and environment variables. -
Build Babeltrace 2:
$ make
To install Babeltrace 2:
-
Run:
# make install
Build Babeltrace 2 for plugin or application development
If you’re developing a Babeltrace 2 plugin or an application which uses libbabeltrace2, we recommend to:
-
Build Babeltrace 2 from source in developer mode.
The Babeltrace 2 developer mode enables more precondition and postcondition assertions to detect C API usage errors.
The Babeltrace 2 C API documentation always lists the precondition and postconditions of functions.
Set
BABELTRACE_DEV_MODE=1when you configure the Babeltrace 2 build. -
Use TRACE as the minimal logging level at build time to have access to more logging, should you need it to debug your plugin or application.
Set
BABELTRACE_MINIMAL_LOG_LEVEL=TRACEwhen you configure the Babeltrace 2 build.
Babeltrace 2 development build configuration command line example:
$ BABELTRACE_DEV_MODE=1 BABELTRACE_MINIMAL_LOG_LEVEL=TRACE ./configure
Babeltrace 2 development build configuration with Python support example:
$ BABELTRACE_DEV_MODE=1 BABELTRACE_MINIMAL_LOG_LEVEL=TRACE ./configure \ --enable-python-bindings --enable-python-plugins
See the Babeltrace 2 C API documentation for more information.
Use Babeltrace 2.1
See the Babeltrace 2 website to learn how to use the different parts of the project.
If you’re new to Babeltrace 2, make sure to read the
babeltrace2-intro(7)
manual page to familiarize yourself with the project.
Run-time requirements
- Libraries
-
-
A C library (for example, GNU C Library or musl libc)
-
GLib ≥ 2.56 (Debian/Ubuntu:
libglib2.0-0; Fedora:glib2)
-
- If you need the
bt2Python bindings -
-
Python ≥ 3.5 (Debian/Ubuntu/Fedora:
python3)
-
- If you need the LTTng debug information filter component class (
filter.lttng-utils.debug-info) -
-
elfutils ≥ 0.154 (Debian/Ubuntu:
libelfandlibdw; Fedora:elfutils-libsandelfutils-libelf)
-
Community
Babeltrace was born to parse CTF traces produced by LTTng 2.0 and to pretty-print their events.
Even though Babeltrace 2 is independent from the LTTng project today, their communities remain very close, which is why they share some communication channels and services:
- Mailing list
- IRC channel
-
#lttngon the OFTC network - Bug tracker
- GitHub project
- Continuous integration
-
Babeltrace 2 jobs on the LTTng CI
- Code review
-
Babeltrace 2 project on LTTng Review (Gerrit)