Tracing tools for ROS 2.
If LTTng is not found during build, or if the TRACETOOLS_DISABLED
option is enabled, then this package will not do anything.
To enable tracing:
- Install LTTng (
>=2.11.1
) with the Python bindings to control tracing and read traces:$ sudo apt-get update $ sudo apt-get install lttng-tools lttng-modules-dkms liblttng-ust-dev $ sudo apt-get install python3-babeltrace python3-lttng
- Build
$ colcon build
- Source and check that tracing is enabled:
$ source ./install/local_setup.bash $ ros2 run tracetools status
Alternatively, to build and disable tracing, use TRACETOOLS_DISABLED
:
$ colcon build --cmake-args " -DTRACETOOLS_DISABLED=ON"
The steps above will not lead to trace data being generated, and thus they will have no impact on execution. LTTng has to be configured for tracing. The packages in this repo provide two options.
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.
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 example.launch.py
See this example launch file for more information.
See the design document.
See tracetools_analysis
.