# LTTNg tracetools examples with ROS1

Greetings ,

I have been trying to make sense of using LTTNg along with some C++ ROS scripts . I stumbled upon the following ,

https://github.com/boschresearch/ros1_tracetools

If anyone has worked on tracing kindly share some insights .

Some basic PUB-SUB examples would be enough

For future reference , there are relevant articles i have come across .

1. https://christophebedard.com/ros-tracing-message-flow/
2. https://github.com/christophebedard/tracecompass_ros_testcases
3. https://lttng.org/blog/2018/03/21/lttng-scope-0.3-a-basic-tutorial/ , THIS IS WHAT REALLY HELPED ME TOWARD THE END

I made a screen recording of how the above example can be run , hope it is helpful to someone https://youtu.be/fRDO-b5A4CM

Relevant tools

I understand that , there is an official package on this for ROS2 . (as ROS2 is build with RT in mind)

Kindly share anything on this topic .

edit retag close merge delete

what are you looking for exactly? Are you looking for info on show to set it up + run it with LTTng?

( 2020-10-28 15:29:45 -0600 )edit

Hi @christophebedard thanks for responding , I guess you are the right person for this .

Anyhow what i would like is some info into how to run this with a simple Publisher/Subscriber .

My current understanding is we have to place ROS::TRACE commands is at critical break points . (Similar to how one would place ROS_INFO , for debug purpose )

( 2020-10-28 19:51:50 -0600 )edit

I did a lot of digging and didnt find any modifications with the C++ code with these examples you have provided . But everything seems to be happening from the script itself .

I guess this is where my confusion is .

https://github.com/christophebedard/t...

( 2020-10-28 19:56:36 -0600 )edit

Sort by » oldest newest most voted

To get it working, you need a few things:

• LTTng https://lttng.org/docs/
• a few repos, as listed in this file: https://github.com/christophebedard/t...
• modified ROS code that includes the tracing instrumentation: see the ros_comm and roscpp_core repos in the tracing.repos file
• tracetools, i.e. what actually calls LTTng; this is used/called by the modified ROS code (see tracing.repos file)
• some ROS user code, e.g. my examples/test cases repo

My current understanding is we have to place ROS::TRACE commands is at critical break points . (Similar to how one would place ROS_INFO , for debug purpose )

Not really. The instrumentation is only for ROS itself, e.g. to provide information about message publication and subscription. You do not need to modify your own code for this. You just need to use the modified/instrumented ROS code and trace it all.

And it is not a replacement for ROS_INFO. If that's what you want, you should consider other solutions.

But everything seems to be happening from the script itself . I guess this is where my confusion is .

As for actually tracing everything, your nodes/ROS is just an application that can be traced using LTTng. Therefore you should check out the LTTng documentation: https://lttng.org/docs/. The trace.sh script is just a simple script that uses LTTng commands (through another script) to enable the right tracepoints, start tracing, run a given application, and stop tracing + cleanup.

more

Awesome and a lot of Thanks Christopher

( 2020-11-01 19:49:28 -0600 )edit