https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95348
--- Comment #11 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to qinzhao from comment #9) > (In reply to Martin Liška from comment #7) > > 1) You should not generate profile data for each process to a different > > folder, but rather merge it. > > not sure how to do this? can you provide more details on this approach? If you have an instrumented binary and you run it multiple times, then each exit of the application merges profile to existing .gcda files on a disk. The only exception is a cross-profiling: https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html where one can use GCOV_PREFIX environment variable to save .gcda files to a separate location. Do you use it? Or do you use any of -fprofile-dir options? > > > 2) I would like to know how long does one process run and what portion is > > spent in merging (and dumping) of a profile. > will try to get this info.