Skip to content

ddelago/Orocos-and-ROS-Performance-Analysis-using-LTTng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orocos and ROS Performance Analysis using LTTng

Introduction

This repository will explain the steps to tracing Orocos components using LTTng and visualizing those traces using Trace Compass.

Be sure to have the following installed:

Also follow these guides to better understand all tools involved:

Tracing Procedure

The following are the steps from creating an Orocos component, tracing that component, and visualizing those traces in Trace Compass. The steps are included in the compile_component.sh and trace.sh scripts which will compile and begin tracing your component. They have been included in the example HelloWorld component.

  1. Create and compile Orocos component with debug flags:
# Creating a component is not included in compile_component.sh
$ orocreate-pkg HelloWorld component
$ mkdir build; cd build

# Compiler flags can be added to CMakeLists instead of in terminal: set(DCMAKE_CXX_FLAGS "-g -finstrument-functions ${CMAKE_CXX_FLAGS}")
$ cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../../install -DCMAKE_CXX_FLAGS="-g -finstrument-functions"
$ make install
$ cd ..
$ export RTT_COMPONENT_PATH=$(pwd)/../install/lib/orocos:$RTT_COMPONENT_PATH
  1. Start LTTng tracing:
# Save traces in /out/ directory
$ lttng create demo_session -o ./out

# Enable all userspace traces
$ lttng enable-event -u -a
$ lttng add-context -u -t vpid -t vtid -t procname -t ip
$ lttng start

# start.ops is the components deployment script
$ LD_PRELOAD=liblttng-ust-cyg-profile.so:liblttng-ust-dl.so deployer -s start.ops
$ lttng stop
$ lttng destroy
  1. Save Traces:
# Save traces to text file
$ babeltrace ./out/ > trace_data.txt

Trace Compass

  1. Open Trace Compass and create a new Tracing project

  2. Import the location of the traces

  3. Read the Trace Compass User guide on the available views for your trace. Examples:

    Flame Graph:

    Call Stack:

Alternative Applications: ROS

Along with Orocos components, ROS nodes also work very well with LTTng tracing and visualization. To do so just compile the workspace with "-g -finstrument-functions" flags and create a directory to store your traces.

# Insert in CMakeLists 
$ set(DCMAKE_CXX_FLAGS "-g -finstrument-functions ${CMAKE_CXX_FLAGS}")

# Or in terminal to apply to all packages in workspace
$ catkin_make --cmake-args -DCMAKE_CXX_FLAGS="-g -finstrument-functions"

ROS node call stack example:

About

Performance Analysis using LTTng on Orocos and ROS frameworks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published