When using gcc with -fprofile-arcs and -ftest-coverage, when the resulting executable terminates, it tries to create .gcda output files in the same location as the .o files used to compile the executable. This is inconvenient when I'm running on a different machine than the one I built on -- is there any way to change this behaviour?
You can use gcov as a profiling tool to help discover where your optimization efforts will best affect your code. You can also use gcov along with the other profiling tool, gprof, to assess which parts of your code use the greatest amount of computing time. Profiling tools help you analyze your code's performance.
You can use the environment variable GCOV_PREFIX
. It's mentionned in the doc under a "cross-profiling" section, which itself is referred to in the documentation for -fprofile-arcs
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With