ros2_tracing repository

Repository Summary

Checkout URI
VCS Type git
VCS Version master
Last Updated 2019-12-09


Name Version
ros2trace 0.2.12
tracetools 0.2.12
tracetools_launch 0.2.12
tracetools_read 0.2.12
tracetools_test 0.2.12
tracetools_trace 0.2.12



Tracing tools for ROS 2.


If the TRACETOOLS_DISABLED option is enabled during build or if LTTng is not found, then this package will not do anything.

To enable tracing:

  1. Install LTTng with the Python bindings to control tracing and read traces:
    $ sudo apt-add-repository ppa:lttng/stable-2.10
    $ sudo apt-get update
    $ sudo apt-get install lttng-tools lttng-modules-dkms liblttng-ust-dev
    $ sudo apt-get install python3-babeltrace python3-lttng

Note: the LTTng stable 2.10 PPA is used to get newer versions of the packages.
  1. Build
    $ colcon build

  1. Source and check that tracing is enabled:
    $ source ./install/local_setup.bash
    $ ros2 run tracetools status


The steps above will not lead to trace data being generated, and thus they will have no impact on execution. LTTng has to be enabled. The packages in this repo provide two options.

Trace command

The first option is to use the ros2 trace command.

$ ros2 trace

By default, it will enable all ROS tracepoints and a few kernel tracepoints. The trace will be written to ~/.ros/tracing/session-YYYYMMDDHHMMSS. Run the command with -h for more information.

Launch file trace action

Another option is to use the Trace action in a launch file along with your Node action(s). This way, tracing happens when launching the launch file.

$ ros2 launch tracetools_launch

See this example launch file for more information.


See the design document.