Skip to content

Software

tracetools_analysis

By ros-tracing, from github.com/ros-tracing/tracetools_analysis (opens in a new tab)

  • Middleware
  • Tool
  • Apache-2.0

Python analysis tools for traces produced by ros2_tracing, turning LTTng trace data into pandas DataFrames and data models for ROS 2 analysis.

  • Stale. No commit in 12 months: the newest is from 14 Nov 2025.

Facts

GitHub stars
30read on 22 Nov 2026
Last update
14 Nov 2025Newest commit on rolling
Maintenance
Staleno commit in 12 months
Difficulty
Advanced

Checked on GitHub on 22 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit caa8c05 (opens in a new tab), on 16 Oct 2026.

Commercial use
Yes

At a glance

What it is
  • Provides a ros2 trace-analysis command that processes a trace directory into lightly processed pandas DataFrames for quick inspection.
  • Converts slow-to-read CTF traces into a single faster-to-load file that can be reused across many analyses.
  • Offers a Python API with handlers and data model utilities to extract callback durations and CPU time per thread.
  • Is intended for interactive analysis in Jupyter Notebooks, with example notebooks provided in the analysis directory.
  • Includes a ros2cli extension package and a tracetools_analysis package with analysis tools and API documentation.
  • Requires choosing the branch that matches the ROS 2 distribution in use.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Stale, last commit on 14 Nov 2025.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit caa8c05

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by ros-tracing, at commit caa8c05, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

tracetools_analysis

(opens in a new tab)

Analysis tools for ros2_tracing (opens in a new tab).

Note: make sure to use the right branch, depending on the ROS 2 distro: use rolling for Rolling, humble for Humble, etc. (opens in a new tab)

Trace analysis

After generating a trace (see ros2_tracing (opens in a new tab)), we can analyze it to extract useful execution data.

Commands

Then we can process a trace to create a data model which could be queried for analysis.

$ ros2 trace-analysis process /path/to/trace/directory

Note that this simply outputs lightly-processed ROS 2 trace data which is split into a number of pandas DataFrames. This can be used to quickly check the trace data. For real data processing/trace analysis, see Analysis.

Since CTF traces (the output format of the LTTng (opens in a new tab) tracer) are very slow to read, the trace is first converted into a single file which can be read much faster and can be re-used to run many analyses. This is done automatically, but if the trace changed after the file was generated, it can be re-generated using the --force-conversion option. Run with --help to see all options.

Analysis

The command above will process and output raw data models. We need to actually analyze the data and display some results. We recommend doing this in a Jupyter Notebook, but you can do this in a normal Python file.

$ jupyter notebook

Navigate to the analysis/ (opens in a new tab) directory, and select one of the provided notebooks, or create your own!

For example:

from tracetools_analysis.loading import load_file
from tracetools_analysis.processor import Processor
from tracetools_analysis.processor.cpu_time import CpuTimeHandler
from tracetools_analysis.processor.ros2 import Ros2Handler
from tracetools_analysis.utils.cpu_time import CpuTimeDataModelUtil
from tracetools_analysis.utils.ros2 import Ros2DataModelUtil

# Load trace directory or converted trace file
events = load_file('/path/to/trace/or/converted/file')

# Process
ros2_handler = Ros2Handler()
cpu_handler = CpuTimeHandler()

Processor(ros2_handler, cpu_handler).process(events)

# Use data model utils to extract information
ros2_util = Ros2DataModelUtil(ros2_handler.data)
cpu_util = CpuTimeDataModelUtil(cpu_handler.data)

callback_symbols = ros2_util.get_callback_symbols()
callback_object, callback_symbol = list(callback_symbols.items())[0]
callback_durations = ros2_util.get_callback_durations(callback_object)
time_per_thread = cpu_util.get_time_per_thread()
# ...

# Display, e.g., with bokeh, matplotlib, print, etc.
print(callback_symbol)
print(callback_durations)

print(time_per_thread)
# ...

Note: bokeh has to be installed manually, e.g., with pip:

$ pip3 install bokeh
Design

See the ros2_tracing design document (opens in a new tab), especially the Goals and requirements (opens in a new tab) and Analysis (opens in a new tab) sections.

Packages
ros2trace_analysis

Package containing a ros2cli extension to perform trace analysis.

tracetools_analysis

Package containing tools for analyzing trace data.

See the API documentation (opens in a new tab).

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.