How to use gperftools to analysis my ROS code

asked 2017-08-23 05:39:07 -0600

Josper gravatar image

I need to use profiling tool to analysis my ROS code.
I use below command to run my code with gperftools:

LD_PRELOAD=/usr/lib/libprofiler.so.0 CPUPROFILE=~/my_code.prof rosrun my_package myNode

Then I press ctrl+c to exit my program after some manipulation. But the output my_code.prof looks not correct, it will create several file end with a number.
It can't be parsed by the google-pprof command. I've just write a simple c++ program to test these steps like google-perftools tutorial said, they work fine.
Is there anyone can share me the experience of how to use google-perftools with ROS?
Or some good perfling tool cooperate well with ROS?
Thanks a lot.

edit retag flag offensive close merge delete