tags:

views:

116

answers:

1

All the GNU gcov manual online at http://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html#Invoking-Gcov says about gcov -f option is:

-f --function-summaries Output summaries for each function in addition to the file level summary.

Does anyone have more information, and maybe a non-trivial .gcov output file, from using this option, in order to demonstrate exactly what these "summaries for each function" look like?

I will also try to try it out, but I thought if someone is regularly using this option they could tell me more.

+1  A: 

I don't think it puts different data in the .gcov file, just in the output of gcov itself. gcov -f prints the name of each function called, its % of lines executed, and number of lines in the function. gcov without -f just shows a summary for the whole file.

mcl
Thanks. From the URL above, when it says, as I've read many times $ gcc -fprofile-arcs -ftest-coverage tmp.c $ a.out $ gcov tmp.c 90.00% of 10 source lines executed in file tmp.c Creating tmp.c.gcov.I never paid much attention to that 90.00% ... line, but that's what you're saying would change to a more detailed result with the -f option. We'll try it.
talkaboutquality
If you want some really nice output similar to `gcov` look into `lcov` (http://ltp.sourceforge.net/coverage/lcov.php) -- it produces nice HTML reports that will actually show some bar charts about coverage as well as highlighted source code.
mcl
Yes thanks we use lcov already. It was just the console output of gcov that I had ignored.
talkaboutquality