No description
Find a file
Christophe Bedard 608ae8517d Mention command for disabling tracing when building
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
2020-03-04 08:54:28 -08:00
doc Update analysis architecture diagram after moving ownership of DataModel 2020-01-01 00:21:30 -05:00
ros2trace Add mypy tests through ament_mypy 2020-03-01 15:55:16 -05:00
tracetools Use target_compile_definitions instead of add_definitions for version 2020-03-03 14:32:20 -08:00
tracetools_launch Add mypy tests through ament_mypy 2020-03-01 15:55:16 -05:00
tracetools_read Add mypy tests through ament_mypy 2020-03-01 15:55:16 -05:00
tracetools_test Add mypy tests through ament_mypy 2020-03-01 15:55:16 -05:00
tracetools_trace Handle empty __doc__ when checking lttng module version 2020-03-01 16:00:56 -05:00
.gitignore Resolve "Add option to compile out LTTng entirely" 2019-07-30 14:27:36 +00:00
.gitlab-ci.yml Use console_cohesion when building and testing 2020-02-29 20:19:56 -05:00
instrumented.repos Revert "Point instrumented rclcpp branch to service callback registration fix" 2020-02-26 16:05:41 -05:00
LICENSE Add license file 2019-06-18 08:53:46 +02:00
README.md Mention command for disabling tracing when building 2020-03-04 08:54:28 -08:00
tracing.repos Add new repo file with just the tracing stuff. 2019-12-05 07:41:39 +00:00

ros2_tracing

pipeline status

Tracing tools for ROS 2.

Building

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

See this example launch file for more information.

Design

See the design document.

Analysis

See tracetools_analysis.