This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thread-safe profiling



On Mar 15, 2007, at 4:24 PM, Ian Lance Taylor wrote:


Jan Hubicka <hubicka@ucw.cz> writes:

Trying to imagine what random user would find more discourgrating - ie
longer train runs (still probably quite shorter than in ICC) or weird
looking mismatches and/or wrong resulting profile, I guess the former is
lesser evil and easier to analyze.

It seems to me that the alternative to thread-safe profiling should just be that some nodes are undercounted, when two threads try to update the count simultaneously. It shouldn't be wildly wrong, just slightly wrong.
The current code use 64 bits counters. Non atomic increment on 32 bits platform may produce weird result
(ie jumping from 0xfffffffe to 0).


Are 32 bits counters too short ?

Also, for coverage we are thinking about a 1 byte (atomic) flag. Setting it to 1 shouldn't be racy.

Tristan.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]