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

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 05:08:43 PST 2025


================
@@ -505,7 +515,11 @@ PerfScriptReader::convertPerfDataToTrace(ProfiledBinary *Binary, bool SkipPID,
   ScriptSampleArgs.push_back("script");
   ScriptSampleArgs.push_back("--show-mmap-events");
   ScriptSampleArgs.push_back("-F");
-  ScriptSampleArgs.push_back("ip,brstack");
+  if (MultiProcessProfile) {
+    ScriptSampleArgs.push_back("pid,ip,brstack");
+  } else {
+    ScriptSampleArgs.push_back("ip,brstack");
----------------
Heath123 wrote:

While enabling the flag when using a single PID doesn't cause any issues, I made the behaviour of interpreting the PID opt-in to preserve compatibility with existing perf script files.

Alternatives would be to drop support for perf script files without a PID, or auto-detect profiles containing a PID.

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


More information about the llvm-commits mailing list