No description
Find a file
Christophe Bedard dea844e1d3 Update tracetools' quality level to 1
Backport of e2664fcae9977af37fcb6da79f29699f44fb6a3d from !213

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
2020-11-02 16:43:00 -05:00
doc Update analysis architecture diagram after moving ownership of DataModel 2020-01-01 00:21:30 -05:00
ros2trace Update repo URL 2020-10-14 09:14:59 -04:00
tracetools Update tracetools' quality level to 1 2020-11-02 16:43:00 -05:00
tracetools_launch Update repo URL 2020-10-14 09:14:59 -04:00
tracetools_read Update repo URL 2020-10-14 09:14:59 -04:00
tracetools_test Increased code coverage > 94% 2020-11-02 16:04:36 -05:00
tracetools_trace Update repo URL 2020-10-14 09:14:59 -04:00
.gitignore Resolve "Add option to compile out LTTng entirely" 2019-07-30 14:27:36 +00:00
.gitlab-ci.yml Use --verbose option with colcon test-result 2020-11-02 16:43:00 -05:00
codecov.yml Fix paths for codecov 2020-11-02 16:43:00 -05:00
CONTRIBUTING.md Add CONTRIBUTING.md and mention DCO 2020-04-26 18:39:08 -04:00
instrumented.repos Use foxy branches for rcl and rclcpp 2020-06-15 08:45:10 -04:00
LICENSE Add license file 2019-06-18 08:53:46 +02:00
LTTng_QUALITY_DECLARATION.md Add quality declaration for LTTng and update tracetools' QD 2020-11-02 15:53:45 -05:00
pytest.ini Add pytest.ini file to suppress pytest warnings. 2020-06-24 10:06:41 -04:00
README.md Update tracetools' quality level to 1 2020-11-02 16:43:00 -05:00
tracing.repos Update repo URL 2020-10-14 09:14:59 -04:00

ros2_tracing

pipeline status codecov

Tracing tools for ROS 2.

Building

As of Foxy, these instructions also apply to an installation from the Debian packages; it will not work out-of-the-box. Also, note that tracing using ros2_tracing is not supported on non-Linux systems.

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:

  1. 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
    
  2. Build (at least up to rcl & rclcpp):
    $ colcon build
    
  3. Source and check that tracing is enabled:
    $ source ./install/local_setup.bash
    $ ros2 run tracetools status
    

Disabling tracing

Alternatively, to build and disable tracing, use TRACETOOLS_DISABLED:

$ colcon build --cmake-args " -DTRACETOOLS_DISABLED=ON"

Tracing

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.

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 example.launch.py

See this example launch file for more information.

Design

See the design document.

Packages

ros2trace

Package containing a ros2cli extension to enable tracing.

tracetools

Library to support instrumenting ROS packages, including core packages.

This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.

See the API documentation.

tracetools_launch

Package containing tools to enable tracing through launch files.

tracetools_read

Package containing tools to read traces.

tracetools_test

Package containing system tests for tracetools and the tools to support them.

tracetools_trace

Package containing tools to enable tracing.

Analysis

See tracetools_analysis.