Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from FE PGO to IR PGO #3

Open
zamazan4ik opened this issue Dec 5, 2023 · 2 comments
Open

Migration from FE PGO to IR PGO #3

zamazan4ik opened this issue Dec 5, 2023 · 2 comments

Comments

@zamazan4ik
Copy link
Owner

zamazan4ik commented Dec 5, 2023

According to the llvm/llvm-project#45668 now IR PGO (-fprofile-generate/-fprofile-use flags in Clang) is the recommended way to do PGO in applications. All current investments in the PGO area in LLVM now are done in the IR PGO.

We need to perform some kind of migration for open-source projects from old, FrontEnd PGO (-fprofile-instr-generate/-fprofile-instr-use flags in Clang) to IR PGO.

The current list is the following:

We need to check more projects and add them here.

@michaelrun
Copy link

I'm using mongodb v4.4.0, adding -profile-generate to cflags, cxxflags and linkflags, after mongo is started, a empty profile raw data file is generate, but it is always empty, even I use "use admin; db.shutdownServer()" to stop mongodb, the profile raw data file is still empty, could you give some hits why this happens?

@zamazan4ik
Copy link
Owner Author

I cannot surely say what is the reason for such behavior with mongod. Instead, I can suggest you patch mongod a bit and implement manual dumping of PGO profiles to a file like it's done in other databases like YugabyteDB: https://github.com/yugabyte/yugabyte-db/blob/master/src/yb/common/llvm_profile_dumper.cc . I am almost sure that it should resolve your problems with empty profiles.

Regarding the root cause of the problem. Probably, mongod has some specific code around the application exit, and that's why an automatic save approach at the exit doesn't work well in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants