[llvm] [llvm-profgen][SPGO] Support profiles with multiple concurrent processes (PR #169353)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 27 02:49:09 PST 2025


Heath123 wrote:

> Thanks, fixing this will be a nice improvement. It is a bit onerous for the user to have to enumerate all the relevant pids to be processed. I wonder if instead we can read the build id from the binary specified in the command line (`--binary`) and match it to the build ids collected by perf? This should get you all the pids (for that build id) so that the base address is computed correctly. What do you think?

Thanks for the comments.

Passing the PIDs of the relevant processes isn't actually required; if the PID filter is empty, profgen will accept all PIDs, and use the name of the binary for this:

https://github.com/llvm/llvm-project/blob/9e5043a551f63744342d31b3b0004c69aca3e7fb/llvm/tools/llvm-profgen/PerfReader.cpp#L1198-L1202

The PID filter is for if the user needs to ignore certain processes in the output which would otherwise pass this check.

https://github.com/llvm/llvm-project/pull/169353


More information about the llvm-commits mailing list