How to reduce .profraw file size

For functions, I believe this is only the mangled name, and for sources I believe this is the absolute path, based on my experimentation.

You can use -ffile-compilation-dir=. or -fcoverage-compilation-dir=. to reduce the sizes of source file absolute path (-ffile-compilation-dir= expands to -fcoverage-compilation-dir= and -fdebug-compilation-dir=)

That impact is completely linked to fwrite of the 2GB.

Here’s also binary profile correlation that reduce the .profraw file size by keeping some metadata in the original instrumented binary and retrieve them from the binary later when merging to indexed profile data: [RFC] Add binary profile correlation to not load profile metadata sections into memory at runtime

If you don’t care about the exact execution count, single byte counter would also help: [RFC] Single Byte Counters for Source-based Code Coverage

1 Like