No description
Find a file
2019-12-31 20:18:28 -05:00
ros2trace_analysis Register packages in the ament index 2019-12-27 13:59:32 -05:00
tracetools_analysis Add test for direct EventHandler.process() call 2019-12-31 20:18:28 -05:00
.gitlab-ci.yml Add ros2trace_analysis command and process/convert verbs 2019-10-13 14:39:21 -07:00
LICENSE Add license 2019-06-24 16:44:03 +02:00
README.md Split utils file into multiple files inside a submodule 2019-11-17 13:37:20 -08:00

tracetools_analysis

Analysis tools for ROS 2 tracing.

Setup

To display results, install:

Trace analysis

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

Commands

Since CTF traces (the output format of the LTTng tracer) are very slow to read, we first convert them into a single file which can be read much faster.

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

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

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

Jupyter

The last command will process and output the raw data models, but to actually display results, process and analyze using a Jupyter Notebook.

$ jupyter notebook

Then navigate to the analysis/ directory, and select one of the provided notebooks, or create your own!

For example:

from tracetools_analysis import loading
from tracetools_analysis import processor
from tracetools_analysis import utils

# Load converted trace file
events = loading.load_file('/path/to/converted/file')

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

processor.Processor(ros2_handler, cpu_handler).process(events)

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

callback_durations = ros2_util.get_callback_durations()
time_per_thread = cpu_util.get_time_per_thread()
# ...

# Display, e.g. with bokeh or matplotlib
# ...

Design

See the ros2_tracing design document, especially the Goals and requirements and Analysis architecture sections.