public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/28441] Need atomic increment of gcov counters for MP programs
[not found] <bug-28441-4@http.gcc.gnu.org/bugzilla/>
@ 2012-07-21 23:26 ` steven at gcc dot gnu.org
0 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu.org @ 2012-07-21 23:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28441
Steven Bosscher <steven at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matz at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org,
| |steven at gcc dot gnu.org
--- Comment #15 from Steven Bosscher <steven at gcc dot gnu.org> 2012-07-21 23:25:38 UTC ---
Matz's patch http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00950.html was never
committed on the trunk. That's unfortunate, we're living more and more in a
multi-threaded world. Also, the atomic operations in GCC 4.8 should make this
easier to implement for all targets now (instead of only for i386).
Matz, could you have a look and see if you're interested in finishing that nice
piece of work of yours? Or if you're not interested, let that know, too, so
someone else can pick up the ball where you drop it! :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug gcov/profile/28441] New: Need atomic increment of gcov counters for MP programs
@ 2006-07-20 0:47 gnb at sgi dot com
2006-12-06 20:50 ` [Bug gcov-profile/28441] " gnb at melbourne dot sgi dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: gnb at sgi dot com @ 2006-07-20 0:47 UTC (permalink / raw)
To: gcc-bugs
The arc instrumentation code generated by -fprofile-arcs increments
gcov counters in a manner which is not guaranteed to be atomic. As
a result, if two or more cpus enter the same basic block at nearly
the same time they can leave an incorrect arc count, which makes it
impossible for gcov to solve that function's arc count graph later.
Within SGI, this is a significant limitation when doing kernel test
coverage studies, as we have code that needs to be exercised over
multiple processors. The same problem presumably affects people
trying to do coverage studies on multithreaded programs in userspace.
I've written a patch to solve this problem. It adds a new option,
-fprofile-multithread, which changes the tree profiler code to
use the recently-added __sync_add_and_fetch() builtin to update
the counters. I've tested it on ia64 and i386; it generates
the appropriate object code which runs and produces coverage
results.
Here's a diffstat:
common.opt | 4 +
doc/invoke.texi | 14 ++++-
testsuite/gcc.misc-tests/gcov-12.c | 28 ++++++++++
tree-profile.c | 75 +++++++++++++++++++++++++++++
4 files changed, 119 insertions(+), 2 deletions(-)
Reading the documention at gcc.gnu.org, this looks "legally significant"
so I'll need to have some paperwork done right? I assume a copyright
assignment form and an employer disclaimer are the correct documents.
Can someone start that process? Should I just attach the patch now?
--
Summary: Need atomic increment of gcov counters for MP programs
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: gcov/profile
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gnb at sgi dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28441
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-21 23:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-28441-4@http.gcc.gnu.org/bugzilla/>
2012-07-21 23:26 ` [Bug gcov-profile/28441] Need atomic increment of gcov counters for MP programs steven at gcc dot gnu.org
2006-07-20 0:47 [Bug gcov/profile/28441] New: " gnb at sgi dot com
2006-12-06 20:50 ` [Bug gcov-profile/28441] " gnb at melbourne dot sgi dot com
2007-01-10 1:25 ` gnb at melbourne dot sgi dot com
2007-03-14 23:03 ` hubicka at gcc dot gnu dot org
2008-08-22 18:18 ` pinskia at gcc dot gnu dot org
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).