Ask Your Question
0

compiling with code coverage in catkin

asked 2014-01-22 06:27:43 -0500

dsolomon gravatar image

updated 2014-01-28 17:04:56 -0500

ngrennan gravatar image

Does anyone use the "Coverage" option when compiling? I would like to get a profile of my executable, so I compile with 'catkin_make -DCMAKE_BUILD_TYPE=Coverage' and have confirmed that the code runs noticeably slower (although this may also be due to more optimization being disabled?). I do not know where to recover the code profile information from.

Running Groovy on Ubuntu 12.04.

edit retag flag offensive close merge delete

Comments

FYI - I ended up using valgrind to profile my code. To profile a single node, it may be easiest to run "valgrind --tool=callgrind ./<name_of_node_executable>" in the directory of your executable rather than using http://wiki.ros.org/roslaunch/Tutorials/Roslaunch%20Nodes%20in%20Valgrind%20or%20GDB

dsolomon gravatar imagedsolomon ( 2014-02-03 04:08:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-22 07:01:18 -0500

gvdhoorn gravatar image

updated 2014-01-22 07:20:02 -0500

I'm not directly familiar with the Coverage build type, but if it creates binaries instrumented with gcov (fi) then wouldn't the profiling data be generated upon executing the binary, and in the cwd? No.


Edit: also, is the Coverage build type still supported with catkin? I can only find references to it in rosbuild CMakeLists.txt.


Edit2: according to this stack overflow answer, the coverage information ends up in the directory where the object files are, so for CMake / catkin that would probably be in the build space of your workspace.

edit flag offensive delete link more

Comments

Thanks, that was a good link. I searched my package high and low for any coverage files, or links from executables to coverage files, and came up with nil. Passing Catkin the Coverage flag makes entire package recompile, but apparently not actually generate coverage info.

dsolomon gravatar imagedsolomon ( 2014-02-03 04:00:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-01-22 06:27:43 -0500

Seen: 1,050 times

Last updated: Jan 22 '14