public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCOV is showing 0 percent code coverage
@ 2019-11-20 20:00 mandar munagekar
  0 siblings, 0 replies; only message in thread
From: mandar munagekar @ 2019-11-20 20:00 UTC (permalink / raw)
  To: gcc-help

Hi,

We are working on a code coverage tool which requires the gcov to show code
coverage. Right now, it is showing 0 percent for all the files in our
directory. We tried following approaches  -
1. We build the entire db2 source code on gcc8 with export COMPILER=gcc8.
We made sure that gcc8 is used and this runs fine
2. We include flags -fprofile-arcs -ftest-coverage to both compiler and
linker. We then compiled all source code. At this point there are .gcno
files (files needed for gcov) generated appropriately.
3. We run a db2 query for inserting million rows. Technically, it should
run some of the object files for our codes.  This created necessary .gcda
files which are needed by gcov.
4. We analyzed the intermediary files as well through gcov-dumps and see
that some counters are updated.
5. To find the final coverage, when we do gcov <filename>. It reports 0
coverage despite some activity seen in .gcda files.

We tried a lot of options like:
A. running gcc without various levels of optimization
B. changing permissions of source files and intermediary files
C. using gcov_flush with and without explicit signal handlers.
D. Trying with almost all of the suggestions listed in stackoverflow.
E. Matching the compiler gcc and gcov versions.

Are we missing something here? Does anybody faced same issue?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-20 20:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 20:00 GCOV is showing 0 percent code coverage mandar munagekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).