diff options
| author | Rong Xu <xur@google.com> | 2024-12-19 16:51:05 -0800 |
|---|---|---|
| committer | Rong Xu <xur@google.com> | 2024-12-19 16:51:05 -0800 |
| commit | 1d1b33407d7129f949a0d1e8b64c13cd490e3596 (patch) | |
| tree | 61b4d4bb37e1c377ab6ef75df4513a0d13d5a081 | |
| parent | ec9c45af6ee895999ade414cd7923f976438b35d (diff) | |
[bolt] Use a fixed name for the kernel imageusers/xur-llvm/spr/bolt
Use a fixed name for the kernel image to process kernel profiles,
regardless of the presence of a build ID or not.
This is to address the issue when the provided kernel image lacks a
matching build ID. This name, "[kernel.kallsyms]", is the default
for kernel DSOs in the Linux kernel source code
(see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/dso.c#n428).
While "[guest.kernel.kallsyms]" is the kernel DSO name for guest kernel,
support for VM profiles is currently limited. Therefore, we can
skip this name for now.
| -rw-r--r-- | bolt/lib/Profile/DataAggregator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp index e2b7038f42e6..3ee80db6f4e0 100644 --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -2097,6 +2097,8 @@ std::error_code DataAggregator::parseMMapEvents() { << "\" for profile matching\n"; NameToUse = BuildIDBinaryName; } + if (BC->IsLinuxKernel) + NameToUse = "[kernel.kallsyms]"; auto Range = GlobalMMapInfo.equal_range(NameToUse); for (MMapInfo &MMapInfo : llvm::make_second_range(make_range(Range))) { @@ -2145,7 +2147,7 @@ std::error_code DataAggregator::parseMMapEvents() { // Update mapping size. const uint64_t EndAddress = MMapInfo.MMapAddress + MMapInfo.Size; const uint64_t Size = EndAddress - BinaryMMapInfo[MMapInfo.PID].BaseAddress; - if (Size > BinaryMMapInfo[MMapInfo.PID].Size) + if (!BC->IsLinuxKernel && Size > BinaryMMapInfo[MMapInfo.PID].Size) BinaryMMapInfo[MMapInfo.PID].Size = Size; } |
