# Ros2\_tracing demo and tutorial

**URL:** <https://discourse.openrobotics.org/t/ros2-tracing-demo-and-tutorial/22775>\
**Category:** ROS General\
**Tags:** tutorial, tracing, demo, ros2\_tracing\
**Created:** [October 21, 2021, 1:25pm UTC](https://discourse.openrobotics.org/t/ros2-tracing-demo-and-tutorial/22775 "2021-10-21T13:25:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![christophebedard](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/christophebedard/32/1514_2.png) [@christophebedard](https://discourse.openrobotics.org/u/christophebedard)\
**Post date:** [October 21, 2021, 1:25pm UTC](https://discourse.openrobotics.org/t/ros2-tracing-demo-and-tutorial/22775/1 "2021-10-21T13:25:49Z")

</div>

In my ROS World talk yesterday about [`ros2_tracing`](https://gitlab.com/ros-tracing/ros2_tracing), _Tracing ROS 2 with `ros2_tracing`_, I showed a demo and linked to a tutorial, so I thought I’d share here as well.

The demo is here: [GitHub - christophebedard/ros-world-2021-demo: Demo for ROS World 2021 talk: Tracing ROS 2 with ros2\_tracing](https://github.com/christophebedard/ros-world-2021-demo). A ping node and a pong node exchange sequences of ping\<–\>pong messages periodically using a timer. By tracing it using `ros2_tracing` and analyzing the trace data using [`tracetools_analysis`](https://gitlab.com/ros-tracing/tracetools_analysis) in a Jupyter notebook, we can plot timer & subscription callbacks, publications, and timer & subscriptions & publisher initializations over time:

 ![plot_overall](https://us1.discourse-cdn.com/flex022/uploads/ros/original/2X/f/fc3fbedf763a0146eb034e86fceb084fd84dd28f.png)

And this is only the beginning! In the future (🔜), using instrumentation from the middleware, we’ll be able to actually track messages across nodes and be able to compute higher-level metrics. If that sounds interesting to you, check out this recent thread: [Consideration of performance measurement methods - Projects - Open Robotics Discourse](http://discourse.ros.org/t/consideration-of-performance-measurement-methods/22453).

There’s also a tutorial in the Real-Time Working Group documentation guiding you through using `ros2_tracing` to trace and analyze a [performance\_test](https://gitlab.com/ApexAI/performance_test) experiment: [https://real-time-working-group.readthedocs.io/en/latest/Guides/ros2\_tracing\_trace\_and\_analyze.html](https://real-time-working-group.readthedocs.io/en/latest/Guides/ros2_tracing_trace_and_analyze.html). The tutorial assumes you’re running this on a real-time Linux kernel, but you can also run it just fine on a normal Ubuntu system using the provided alternative command.

As always, if you encounter any issues or have any feedback you’d like to share, please [open an issue](https://gitlab.com/ros-tracing/ros2_tracing/-/issues)!
