[compiler-rt] [clang] [llvm] [clang-tools-extra] [Profile] Allow profile merging with multiple correlate files. (PR #75957)

Zequan Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 11:39:18 PST 2024


================
@@ -118,18 +118,18 @@ cl::opt<std::string> ProfiledBinary(
     "profiled-binary", cl::init(""),
     cl::desc("Path to binary from which the profile was collected."),
     cl::sub(ShowSubcommand), cl::sub(MergeSubcommand));
-cl::opt<std::string> DebugInfoFilename(
-    "debug-info", cl::init(""),
+cl::list<std::string> DebugInfoFilenames(
+    "debug-info",
     cl::desc(
         "For show, read and extract profile metadata from debug info and show "
         "the functions it found. For merge, use the provided debug info to "
         "correlate the raw profile."),
     cl::sub(ShowSubcommand), cl::sub(MergeSubcommand));
-cl::opt<std::string>
-    BinaryFilename("binary-file", cl::init(""),
-                   cl::desc("For merge, use the provided unstripped bianry to "
-                            "correlate the raw profile."),
-                   cl::sub(MergeSubcommand));
+cl::list<std::string>
+    BinaryFilenames("binary-file",
+                    cl::desc("For merge, use the provided unstripped bianry to "
+                             "correlate the raw profile."),
+                    cl::sub(MergeSubcommand));
----------------
ZequanWu wrote:

This basically adds a map with keys being BuildID and values being correlators (constructed from the correlate files), and uses BuildID to match raw profiles and correlate files. 

For now, I'll try to enable binary correlation on our side by using customized scripts to see if it's easier to achieve this functionality.

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


More information about the cfe-commits mailing list