public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: mandar munagekar <mandarmunagekar@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: GCOV is showing 0 percent code coverage
Date: Wed, 20 Nov 2019 20:00:00 -0000	[thread overview]
Message-ID: <CAGOsLaWjZ+3hDj5adwPx7Sb12C+P_Sd+8GbGfaEiUQfysRAaEA@mail.gmail.com> (raw)

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?

                 reply	other threads:[~2019-11-20 20:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGOsLaWjZ+3hDj5adwPx7Sb12C+P_Sd+8GbGfaEiUQfysRAaEA@mail.gmail.com \
    --to=mandarmunagekar@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).