[Bug gcov-profile/100751] __gcov_dump and __gcov_reset usage

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 25 12:52:55 GMT 2021


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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
> So, I understand that __gcov_dump could be used only after doing all the
> testing with the application ,i.e- towards the end to get the
> profile/coverage info. Am I right?

Yes, and you don't need to call it manually. Profile automatically saved when
an application exits.

> 
> Resetting run-time counters - does that mean it would not get reflected in
> .gcda files or the .c.gcov file contents created by gcov (assuming that the
> application a.out is still on run )?

Yes, __gcov_reset is supposed to be called at the beginning when an application
wants to start
profiling. Again, you don't need to call it manually.


More information about the Gcc-bugs mailing list