BABELTRACE2-INTRO(7)          Babeltrace manual         BABELTRACE2-INTRO(7)

NAME         top

       babeltrace2-intro - Introduction to Babeltrace

DESCRIPTION         top

       This man page is an introduction to the Babeltrace project.

       The WHAT IS BABELTRACE? section lists the parts of the project and
       shows the major changes from Babeltrace 1 to Babeltrace 2 while the
       BABELTRACE CONCEPTS section defines the core concepts of Babeltrace.

       The TRACE PROCESSING GRAPH REPRESENTATION section shows how some
       concepts are visually represented in other Babeltrace man pages.


       Babeltrace is an open-source software project of which the purpose is
       to process or convert traces (see

       The Babeltrace project includes the following parts:

       Babeltrace library (libbabeltrace2)
           A shared library with a C API.

           With libbabeltrace2, you can programmatically create plugins and
           component classes, build and run processing graphs, and more (see
           the BABELTRACE CONCEPTS section for more details about those
           concepts). All the other Babeltrace parts rely on this library.

       babeltrace2 command
           A command-line interface which uses libbabeltrace2 to load
           plugins, create a trace processing graph, create components, and
           run the graph.

           You can also use babeltrace2 to list the available plugins or to
           query an object from a component class.

           See babeltrace2(1).

       Babeltrace Python bindings
           A Python 3 package which offers a Pythonic interface of

           You can perform the same operations which are available in
           libbabeltrace2 with the Python bindings, but in a really easier
           way and with less code.

       Babeltrace project’s plugins
           The Babeltrace plugins shipped with the project.

           Those plugins are not special, in that they only rely on
           libbabeltrace2 and you don’t need them to use libbabeltrace2,
           babeltrace2(1), or the Python bindings.

           The Babeltrace project’s plugins are:

               Common Trace Format input/output, including the LTTng live

               See babeltrace2-plugin-ctf(7).

               Graph utilities specific to LTTng (see <>)

               See babeltrace2-plugin-lttng-utils(7).

               Text input/output.

               See babeltrace2-plugin-text(7).

               Graph utilities (muxer, trimmer, counter, dummy sink).

               See babeltrace2-plugin-utils(7).

       Python plugin provider
           A shared library which libbabeltrace2 tries to load to add
           support for Babeltrace plugins written in Python.

           The package you use to write a Python Babeltrace plugin is the
           one provided by the Python bindings.

   Changes since Babeltrace 1
       This man page is an introduction to Babeltrace 2, a rewrite of
       Babeltrace 1 with a focus on extensibility and flexibility.

       Babeltrace 1 exists since 2010. The major improvements brought by
       Babeltrace 2 are:

       ·   Full plugin support: any user can distribute a Babeltrace plugin
           and, as long as libbabeltrace2 finds it, any application linked
           to libbabeltrace2 can load it and use it.

           Plugins are not just input and output formats: they provide
           source, filter, and sink component classes so that you can
           connect specialized, reusable components together in a graph to
           create a customized trace conversion or analysis device.

       ·   In order to support user components, all the objects of
           libbabeltrace2 have a reference count. The possible reference
           cycles are handled internally so that the library’s API is clean
           and predictable. The two reference counting functions, bt_get()
           and bt_put(), are all you need to manage the lifetime of any
           Babeltrace object.

       ·   All the parts of the Babeltrace project run on the major
           operating systems, including Windows and macOS.


       This section defines the main concepts of the Babeltrace project.
       These concepts translate into types and functions in libbabeltrace2
       and its Python bindings, but also as command-line actions and options
       in the babeltrace2 command. The other Babeltrace man pages assume
       that you are familiar with the following definitions.

       Some Babeltrace concepts are interdependent: it is normal to jump
       from one definition to another to understand the big picture.

       Component class
           A reusable class from which you can instantiate one or more
           component instances.

           There are three types of component classes used to instantiate
           the three types of components (source, filter, and sink).

           A component class provides methods, one of which is an
           initialization method, or constructor, to create a component. You
           pass initialization parameters to this method to customize the
           created component. For example, the initialization method of the
           src.ctf.fs component class accepts a mandatory path parameter
           which is the file system path to the trace(s). It also accepts an
           optional clock-class-offset-ns parameter which is an offset, in
           nanoseconds, to add to all the clock classes found in the
           traces’s metadata.

           A node within a trace processing graph.

           There are three types of components:

           Source component
               An input component which produces notifications.

               Examples: CTF files input, log file input, LTTng-live input,
               random event generator.

           Filter component
               An intermediate component which can discard the notifications
               it receives, transform them, augment them, sort them, or
               create new ones.

               Examples: filter which removes notifications based on an
               expression, filter which adds debugging information to
               selected events, notification multiplexer, trace trimmer.

           Sink component
               An output component which consumes notifications and usually
               writes them to one or more formatted files.

               Examples: log file output, CTF files output, text output on
               the console.

           Components are connected together within a trace processing graph
           through their ports. Source components have output ports, sink
           components have input ports, and filter components have both.

           A component is the instance of a component class. The terms
           component and component instance are equivalent.

           Within a trace processing graph, each component has a unique
           name. This is not the name of its component class, but an
           instance name. If human is a component class name, than John
           could be a component name.

           A connection point, on a component, from which are sent or to
           which are received notifications when the trace processing graph
           is running.

           An output port is where notifications are sent. An input port is
           where notifications are received. Source components have output
           ports, sink components have input ports, and filter components
           have both.

           An output port can only be connected to a single input port at a
           given time.

           A filter or sink component receiving notifications from its input
           ports is said to consume notifications.

           The link between an output port and input port is a connection.

           A component can dynamically add and remove ports while a graph is
           running. For example, a filter.utils.muxer component always makes
           sure that it has at least one available input port.

           The link between an output port and an input port through which
           notifications flow when a trace processing graph is running.

           An atomic element sent from an output port to an input port.

           A source component produces notifications, while a sink component
           consumes them. A filter component can both consume and produce

           The main types of notifications are:

               A trace event record within a packet.

           Packet beginning
               The beginning of a packet within a stream.

               A packet is a container of events.

           Packet end
               The end of a packet within a stream.

           Stream beginning
               The beginning of a stream.

               A stream is a container of packets.

               Usually, a given source component’s output port sends packet
               and event notifications which belong to a single stream.

           Stream end
               The end of a stream.

           Discarded events
               A count of discarded events within a given time interval for
               a given stream.

           Discarded packets
               A count of discarded packets within a given time interval for
               a given stream.

       Trace processing graph
           A filter graph (see <>)
           where nodes are components and notifications flow from output
           ports to input ports.

           You can build a trace processing graph with libbabeltrace2, with
           the Babeltrace Python bindings, or with the babeltrace2-run(1)
           and babeltrace2-convert(1) commands.

           When you run a trace processing graph, the sink components
           consume notifications from their input ports, making all the
           graph’s components work one notification at a time to perform the
           trace conversion or analysis.

           A container of component classes as a shared library.

           Each component class within a plugin has a type (source, filter,
           or sink) and a name. The type and name pair is unique within a
           given plugin.

           libbabeltrace2 can load a plugin (.so or .dll file) at run time:
           the result is a plugin object in which you can find a specific
           component class and instantiate it within a trace processing
           graph as a component.

           The babeltrace2 command uses the TYPE.PLUGIN.COMPCLS format to
           identify a specific component class within a specific plugin.
           TYPE is either source, filter, or sink.

           You can list the available Babeltrace plugins with the
           babeltrace2-list-plugins(1) command.

           An operation with which you can get a named object from a
           component class, possibly with the help of query parameters.

           The plain text metadata stream of a CTF trace and the available
           LTTng live sessions of a given LTTng relay daemon are examples of

           You can use the babeltrace2-query(1) command to query a component
           class’s object.


       In the Babeltrace man pages, a component is represented with a box.
       The box has the component class type, plugin name, and component
       class name at the top. Just below, between square brackets, is its
       component instance name within the trace processing graph. Each port
       is represented with an @ symbol on the edge of the component box with
       its name inside the box. Output ports are on the right edge while
       input ports are on the left edge.

       For example, here’s a source component box:

           | src.ctf.fs |
           |  [my-src]  |
           |            |
           |    stream0 @
           |    stream1 @
           |    stream2 @

       This one is an instance of the src.ctf.fs component class named my-
       src. It has three output ports named stream0, stream1, and stream2.

       A trace processing graph is represented with multiple component boxes
       connected together. The connections are arrows from output ports to
       input ports.

       For example, here’s a simple conversion graph:

           +------------+    +-----------------+    +------------------+
           | src.ctf.fs |    | flt.utils.muxer |    | sink.text.pretty |
           |    [ctf]   |    |     [muxer]     |    |      [text]      |
           |            |    |                 |    |                  |
           |    stream0 @--->@ in0         out @--->@ in               |
           |    stream1 @--->@ in1             |    +------------------+
           |    stream2 @--->@ in2             |
           +------------+    @ in3             |

       Note that input port in3 of component muxer is not currently
       connected in this example.

       Sometimes, we symbolically represent other resources which are
       consumed from or produced by components. In this case, arrows are
       used, but they do not go to or from port symbols (@). For example, in
       the graph above, the ctf component consumes a CTF trace and the text
       component prints to the console, so here’s a more complete diagram:

              CTF trace
           |  +------------+    +-----------------+    +------------------+
           |  | src.ctf.fs |    | flt.utils.muxer |    | sink.text.pretty |
           '->|    [ctf]   |    |     [muxer]     |    |      [text]      |
              |            |    |                 |    |                  |
              |    stream0 @--->@ in0         out @--->@ in               |
              |    stream1 @--->@ in1             |    +--+---------------+
              |    stream2 @--->@ in2             |          |
              +------------+    @ in3             |          '---> Console

       Here’s another example of a more complex graph which splits a
       specific stream using some criteria:

           +------------+    +-----------------+    +------------------+
           | src.ctf.fs |    | flt.utils.muxer |    | sink.text.pretty |
           |  [ctf-in]  |    |     [muxer]     |    |      [text]      |
           |            |    |                 |    |                  |
           |    stream0 @--->@ in0         out @--->@ in               |
           |    stream1 @--->@ in1             |    +------------------+
           |    stream2 @-.  @ in2             |
           +------------+ |  +-----------------+      +-------------+
                          |                           | sink.ctf.fs |
                          |                           |  [ctf-out0] |
                          |  +-------------------+    |             |
                          |  | flt.some.splitter | .->@ in          |
                          |  |     [splitter]    | |  +-------------+
                          |  |                   | |
                          '->@ in              A @-'  +-------------+
                             |                 B @-.  | sink.ctf.fs |
                             +-------------------+ |  |  [ctf-out1] |
                                                   |  |             |
                                                   '->@ in          |

BUGS         top

       If you encounter any issue or usability problem, please report it on
       the Babeltrace bug tracker (see

RESOURCES         top

       The Babeltrace project shares some communication channels with the
       LTTng project (see <>).

       ·   Babeltrace website (see <>)

       ·   Git repository (see

       ·   EfficiOS GitHub organization (see <>)

       ·   Continuous integration (see

       ·   Mailing list (see <>) for support and

       ·   IRC channel (see <irc://>): #lttng on

AUTHORS         top

       The Babeltrace project is the result of efforts by many regular
       developers and occasional contributors.

       The current project maintainer is Jérémie Galarneau

COPYRIGHT         top

       This man page is part of the Babeltrace project.

       Babeltrace is distributed under the MIT license (see

SEE ALSO         top


COLOPHON         top

       This page is part of the babeltrace (trace read and write libraries
       and a trace converter) project.  Information about the project can be
       found at ⟨⟩.  If you have a bug
       report for this manual page, send it to
       This page was obtained from the project's upstream Git repository
       ⟨git://⟩ on 2019-07-28.  (At that
       time, the date of the most recent commit that was found in the repos‐
       itory was 2019-07-26.)  If you discover any rendering problems in
       this HTML version of the page, or you believe there is a better or
       more up-to-date source for the page, or you have corrections or
       improvements to the information in this COLOPHON (which is not part
       of the original manual page), send a mail to

Babeltrace 2.0.0-pre6          5 October 2017           BABELTRACE2-INTRO(7)

Pages that refer to this page: babeltrace2(1)babeltrace2-convert(1)babeltrace2-help(1)babeltrace2-list-plugins(1)babeltrace2-log(1)babeltrace2-query(1)babeltrace2-run(1)babeltrace2-filter.lttng-utils.debug-info(7)babeltrace2-filter.utils.muxer(7)babeltrace2-filter.utils.trimmer(7)babeltrace2-plugin-ctf(7)babeltrace2-plugin-lttng-utils(7)babeltrace2-plugin-text(7)babeltrace2-plugin-utils(7)babeltrace2-sink.ctf.fs(7)babeltrace2-sink.text.pretty(7)babeltrace2-sink.utils.counter(7)babeltrace2-sink.utils.dummy(7)babeltrace2-source.ctf.fs(7)babeltrace2-source.ctf.lttng-live(7)babeltrace2-source.text.dmesg(7)