Callgrind: how to check if a string is executed or not

Can callgrind be used to output the output as specified by gcov / lcov? I read their docs, can't find the exact option for callgrind_annotate

+2


a source to share


2 answers


This is not possible, but callgrind_annotate and kcachegrind must implement it. However, with kcachegrind you have a call count for each function / method.



The Calls column on the Cost / All Calls tab or the Counting tab on the Subscribers tab must be relevant.

+1


a source


Yes, you can. Using callgrind --collect-jumps = yes and the tools in the link below, you can get the same information as gcov. It's not as good as lcov, but the time savings can be well worth it.

http://benjamin-meyer.blogspot.com/2007/12/valgrind-callgrind-tools-part-3-code.html



Note that this works very well even with optimized binaries, so you save a ton of time in your build / test cycle by not recompiling with -coverage.

You can also combine multiple test runs before using the Benjamin script using cg_merge.

+1


a source







All Articles