public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/100751] New: __gcov_dump and __gcov_reset usage
@ 2021-05-25  6:54 gejoed at rediffmail dot com
  2021-05-25  6:58 ` [Bug gcov-profile/100751] " gejoed at rediffmail dot com
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: gejoed at rediffmail dot com @ 2021-05-25  6:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100751

            Bug ID: 100751
           Summary: __gcov_dump and __gcov_reset usage
           Product: gcc
           Version: 8.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gejoed at rediffmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 50864
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50864&action=edit
sample-prog.i which is the preprocessed version of sample-prog.c

I did go through the online manual of gcc gcov  on __gcov_dump() and
__gcov_reset() :
https://gcc.gnu.org/onlinedocs/gcc/Gcov-and-Optimization.html#Gcov-and-Optimization

I tried out using the functions in a sample program (sample-prog.c) that is
attached here.

The steps followed were :

(1)  gcc -fprofile-arcs -ftest-coverage sample-prog.c 
(2)  ./a.out
(3)  gcov sample-prog.c

While running a.out, when I give character 'g', the __gcov_dump() must be
invoked.
What I could observe is that first time __gcov_dump() is invoked , the
sample-prog.gcda file gets created.
For the second time and then onwards, __gcov_dump() invocation (by giving 'g'
character during the a.out run) doesn't happen.
This is concluded by looking at the time stamp of sample-prog.gcda file in the
same folder. It was still having the same time stamp of first time invocation
of __gcov_dump().

Another thing is  that, __gcov_reset() also doesn't appear to work. I tried
giving the character 'r' during the run of the program but couldn't see the
counters getting reset to 0 in the sample-prog.gcov file. The previous values
of lines covered were there.

Let me know if my approach is correct or if I miss any information here.

I'm attaching the preprocessed file (sample-prog.i) and the logs of the gcc
step used for the preprocessed file.

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2021-06-01  5:25 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25  6:54 [Bug gcov-profile/100751] New: __gcov_dump and __gcov_reset usage gejoed at rediffmail dot com
2021-05-25  6:58 ` [Bug gcov-profile/100751] " gejoed at rediffmail dot com
2021-05-25  7:01 ` gejoed at rediffmail dot com
2021-05-25  7:56 ` marxin at gcc dot gnu.org
2021-05-25 10:57 ` gejoed at rediffmail dot com
2021-05-25 12:14 ` gejoed at rediffmail dot com
2021-05-25 12:52 ` marxin at gcc dot gnu.org
2021-05-25 12:53 ` marxin at gcc dot gnu.org
2021-05-25 18:40 ` gejoed at rediffmail dot com
2021-05-26  7:31 ` marxin at gcc dot gnu.org
2021-05-26  7:34 ` cvs-commit at gcc dot gnu.org
2021-05-26  7:34 ` marxin at gcc dot gnu.org
2021-05-26 15:13 ` gejoed at rediffmail dot com
2021-05-27 13:53 ` gejoed at rediffmail dot com
2021-05-27 13:57 ` marxin at gcc dot gnu.org
2021-05-27 13:58 ` marxin at gcc dot gnu.org
2021-05-28  5:49 ` gejoed at rediffmail dot com
2021-05-28  6:15 ` gejoed at rediffmail dot com
2021-05-28  6:18 ` gejoed at rediffmail dot com
2021-05-28  6:22 ` gejoed at rediffmail dot com
2021-05-28  7:30 ` marxin at gcc dot gnu.org
2021-05-28  9:57 ` gejoed at rediffmail dot com
2021-05-28 11:38 ` cvs-commit at gcc dot gnu.org
2021-05-28 11:41 ` marxin at gcc dot gnu.org
2021-06-01  5:25 ` gejoed at rediffmail dot com

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).