Hello, expert, I have built Mongodb with PGO, that’s mainly add " -fprofile-generate" to building scripts, as for gcc, like “-fprofile-dir=xxx -fprofile-generate -DMONGO-GCOV” to the build with gcc; ‘-fprofile-generate -DMONGO_GCOV’ to the build with clang.
But boot up mongod built with gcc, it generated many gcda files, i supposed that it works for PGO, i didn’t do investigation further(like -fuse-profile), since gcc build is not my concern.
Then export LLVM_PROFILE_FILE=/opt/mongo/pgo, and boot up mongod built with clang, it only generate an empty file, even after mongodb exit with 'mongo --eval “use admin; db.shutdownServer();exit”. Make mongodb + PGO + clang + centos 8 work is my purpose.
Could any expert provide any clue on how to make PGO work with mongod, to generate normal PGO profile?
My environment:
OS: Centos Stream 8.5
MongoDB: r4.4.0
llvm-toolset-12
gcc-toolset-11