[llvm] [llvm-profgen] Add support for Linux kenrel profile (PR #92831)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 09:38:02 PDT 2024


================
@@ -56,6 +56,10 @@ static cl::list<std::string> DisassembleFunctions(
     cl::desc("List of functions to print disassembly for. Accept demangled "
              "names only. Only work with show-disassembly-only"));
 
+static cl::opt<bool>
+    KernelBinary("kernel",
----------------
xur-llvm wrote:

I think this interface is easier than parsing the binary name. Usually the kernel image name is vmlinux.*. But there is a chance that an user image uses the same name. Or someone changes the kernel image name to whatever. I want users to confirm this is kernel perf data file by using the option.

If the user passes a wrong binary image, most like they won't get a profile because of the symbol and address mismatch.

Compared to AutoFDO's create_llvm_prof, llvm-profgen does not check the buildid. But that's separated issue. This patch is just the basic version that provides the kernel perf support.

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


More information about the llvm-commits mailing list