From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E9032385701F; Tue, 25 May 2021 06:54:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9032385701F From: "gejoed at rediffmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/100751] New: __gcov_dump and __gcov_reset usage Date: Tue, 25 May 2021 06:54:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 8.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gejoed at rediffmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 06:54:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100751 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=3D50864&action=3Dedit 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-Opti= mization 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=20 (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 invocati= on 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 valu= es 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.=