tracetools_analysis repository

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version humble
Last Updated 2022-05-07
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 3.0.0
tracetools_analysis 3.0.0

README

tracetools_analysis

pipeline status codecov

Analysis tools for ROS 2 tracing.

Trace analysis

After generating a trace (see ros2_tracing), 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 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/ 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, especially the Goals and requirements and Analysis 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.

CONTRIBUTING

No CONTRIBUTING.md found.

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version master
Last Updated 2023-01-31
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 3.0.0
tracetools_analysis 3.0.0

README

tracetools_analysis

codecov

Analysis tools for ros2_tracing.

Note: make sure to use the right branch, depending on the ROS 2 distro: use rolling for Rolling, humble for Humble, etc.

Trace analysis

After generating a trace (see ros2_tracing), 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 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/ 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, especially the Goals and requirements and Analysis 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.

CONTRIBUTING

No CONTRIBUTING.md found.

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version master
Last Updated 2023-01-31
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 3.0.0
tracetools_analysis 3.0.0

README

tracetools_analysis

codecov

Analysis tools for ros2_tracing.

Note: make sure to use the right branch, depending on the ROS 2 distro: use rolling for Rolling, humble for Humble, etc.

Trace analysis

After generating a trace (see ros2_tracing), 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 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/ 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, especially the Goals and requirements and Analysis 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.

CONTRIBUTING

No CONTRIBUTING.md found.

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version eloquent
Last Updated 2020-03-08
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 0.2.2
tracetools_analysis 0.2.2

README

tracetools_analysis

pipeline status

Analysis tools for ROS 2 tracing.

Setup

Install:

  • pandas
    $ sudo apt-get install python3-pandas

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 trace directory or converted trace file
events = loading.load_file('/path/to/trace/or/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 sections.

CONTRIBUTING

No CONTRIBUTING.md found.

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version dashing
Last Updated 2020-03-08
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 0.2.2
tracetools_analysis 0.2.2

README

tracetools_analysis

pipeline status

Analysis tools for ROS 2 tracing.

Setup

Install:

  • pandas
    $ sudo apt-get install python3-pandas

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 trace directory or converted trace file
events = loading.load_file('/path/to/trace/or/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 sections.

CONTRIBUTING

No CONTRIBUTING.md found.

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version galactic
Last Updated 2021-04-27
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 2.0.3
tracetools_analysis 2.0.3

README

tracetools_analysis

pipeline status codecov

Analysis tools for ROS 2 tracing.

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 trace directory or converted trace file
events = loading.load_file('/path/to/trace/or/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
# ...

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

$ pip3 install bokeh

Design

See the ros2_tracing design document, especially the Goals and requirements and Analysis 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.

CONTRIBUTING

No CONTRIBUTING.md found.

Repository Summary

Checkout URI https://gitlab.com/ros-tracing/tracetools_analysis.git
VCS Type git
VCS Version foxy
Last Updated 2021-04-02
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Packages

Name Version
ros2trace_analysis 1.0.3
tracetools_analysis 1.0.3

README

tracetools_analysis

pipeline status

Analysis tools for ROS 2 tracing.

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 trace directory or converted trace file
events = loading.load_file('/path/to/trace/or/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
# ...

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

$ pip3 install bokeh

Design

See the ros2_tracing design document, especially the Goals and requirements and Analysis 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.

CONTRIBUTING

No CONTRIBUTING.md found.