http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47618
--- Comment #12 from Steven Bosscher <steven at gcc dot gnu.org> 2012-07-25 08:24:49 UTC --- (In reply to comment #9) > I think a tool to merge would be a good partial solution. We will go with the tool solution. I'll take care of the tool before GCC 4.8, if that's OK with apinski. I think we shouldn't have a new tool, though. I'd prefer to teach the gcov program to do it instead. What would you prefer? > As far as I can see what would still be missing for user-friendly usage, is a > mechanism to guarantee that all pre-merged files are saved with different > names, so that different processes don't overwrite each others output files. Deeply berried in the GCC manuals is this section: http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Cross_002dprofiling.html With the right combination of GCOV_PREFIX_STRIP and GCOV_PREFIX, it should be possible to send the gcda files to unique directories per MPI rank. But I think that a more practical solution is necessary. (I also don't know how these environment variables interact with -profile-dir. I doubt anyone looked into this before now...) I like the %q (and %p) variables from Valgrind, and I don't think it's very hard to add support for them in libgcov. (http://valgrind.org/docs/manual/manual-core.html)