Thread-safety of a profiled binary (and GCOV runtime library)

Nathan Sidwell nathan@acm.org
Mon Jul 25 12:35:00 GMT 2016


On 07/25/16 08:28, Martin Liška wrote:

> I'm also surprised about it :) Let's start without invention of a new flag, I'll work on that.

As using atomic add doesn't result in a change to the libgcov interface or 
structures, that's probably the best first approach.  (It also probably gets the 
90% case).  thanks!


> I like the idea sketched by Richard, utilizing TLS and merging counters, which fundamentally the same as merging with existing gcov file.
> However, I would put this lower priority than the former problem.

Richard's suggestion is interesting, and as it solves both problems it may be 
worth a quick experiment?  Perhaps the memory cost isn't so overwhelming? 
After all, it'd be roughly the same per-thread cost as the current gcov counters 
are for the single threaded app they're designed for.

nathan



More information about the Gcc mailing list