[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-06-08 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #12 from Martin Liška  ---
(In reply to calixte from comment #11)
> Why did you remove __gcov_flush ?

It is not a supported __gcov_* library call:
https://gcc.gnu.org/onlinedocs/gcc/Gcov-and-Optimization.html

You should rather call __gcov_dump and __gcov_reset functions.

> FYI, we use it in Firefox to dump counters on SIGUSR1:
> https://searchfox.org/mozilla-central/source/tools/code-coverage/
> CodeCoverageHandler.cpp#49

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-06-03 Thread cdenizet at mozilla dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #11 from calixte  ---
Why did you remove __gcov_flush ?
FYI, we use it in Firefox to dump counters on SIGUSR1:
https://searchfox.org/mozilla-central/source/tools/code-coverage/CodeCoverageHandler.cpp#49

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-05-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #9 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:811b7636cb8c10f1a550a76242b5666c7ae36da2

commit r11-85-g811b7636cb8c10f1a550a76242b5666c7ae36da2
Author: Martin Liska 
Date:   Tue May 5 16:15:47 2020 +0200

Remove __gcov_flush.

PR gcov-profile/93623
* tree-cfg.c (stmt_can_terminate_bb_p): Update comment to reflect
reality.
PR gcov-profile/93623
* Makefile.in: Remove __gcov_flush.
* gcov.h (__gcov_flush): Remove.
* libgcov-interface.c (__gcov_flush): Remove.
(init_mx): Use renamed mutex.
(__gcov_lock): Likewise.
(__gcov_unlock): Likewise.
(__gcov_fork): Likewise.
(__gcov_flush): Remove.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-05-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:c0532db47d092430f8e8f497b2dc53343527bb13

commit r11-84-gc0532db47d092430f8e8f497b2dc53343527bb13
Author: Martin Liska 
Date:   Tue May 5 16:15:46 2020 +0200

Use __gcov_dump and __gcov_reset in execv and fork context.

PR gcov-profile/93623
* libgcov-interface.c (__gcov_fork): Do not flush
and reset only in child process.
(__gcov_execl): Dump counters only and reset them
only if exec* fails.
(__gcov_execlp): Likewise.
(__gcov_execle): Likewise.
(__gcov_execv): Likewise.
(__gcov_execvp): Likewise.
(__gcov_execve): Likewise.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-05-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:d39f7dc8d558ca31a661b02d08ff090ce65e6652

commit r11-83-gd39f7dc8d558ca31a661b02d08ff090ce65e6652
Author: Martin Liska 
Date:   Tue May 5 16:15:45 2020 +0200

Do locking for __gcov_dump and __gcov_reset as well.

PR gcov-profile/93623
* Makefile.in: Add _gcov_lock_unlock to LIBGCOV_INTERFACE.
* libgcov-interface.c (ALIAS_void_fn): Remove.
(__gcov_lock): New.
(__gcov_unlock): New.
(__gcov_flush): Use __gcov_lock and __gcov_unlock.
(__gcov_reset): Likewise.
(__gcov_dump): Likewise.
* libgcov.h (__gcov_lock): New declaration.
(__gcov_unlock): Likewise.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-05-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

Martin Liška  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #10 from Martin Liška  ---
Fixed on master.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-21 Thread cdenizet at mozilla dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #6 from calixte  ---
(In reply to Alexander Monakov from comment #5)
> (In reply to calixte from comment #2)
> > I think the reset is useless in the case of exec** functions since the
> > counters are lost when an exec** is called. So it can probably be removed
> > too.
> 
> exec can fail; resetting only after an (unsuccessful) exec may be ok, but
> eliding the reset entirely does not seem so.

+1

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-21 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #5 from Alexander Monakov  ---
(In reply to calixte from comment #2)
> I think the reset is useless in the case of exec** functions since the
> counters are lost when an exec** is called. So it can probably be removed
> too.

exec can fail; resetting only after an (unsuccessful) exec may be ok, but
eliding the reset entirely does not seem so.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #4 from Martin Liška  ---
Both comments are valid to me!

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-21 Thread cdenizet at mozilla dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #3 from calixte  ---
And about fork, no need to lock when resetting in the child process since we've
only one thread.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-21 Thread cdenizet at mozilla dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

--- Comment #2 from calixte  ---
I think the reset is useless in the case of exec** functions since the counters
are lost when an exec** is called. So it can probably be removed too.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

Martin Liška  changed:

   What|Removed |Added

Version|unknown |10.0
   Target Milestone|--- |11.0

--- Comment #1 from Martin Liška  ---
I like the suggested idea. I'm going to change it in next stage1.

[Bug gcov-profile/93623] No need to dump gcdas when forking

2020-02-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93623

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-02-10
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1