-
Notifications
You must be signed in to change notification settings - Fork 17.4k
[llvm-profgen] Support [buildid:]0xaddr format in perfscript input #190863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aaupov
merged 16 commits into
main
from
users/aaupov/spr/llvm-profgen-support-buildid0xaddr-format-in-perfscript-input
May 2, 2026
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fc3c76d
[𝘀𝗽𝗿] changes to main this commit is based on
aaupov 0f44468
[𝘀𝗽𝗿] initial version
aaupov 5bc82b7
[𝘀𝗽𝗿] changes introduced through rebase
aaupov d17f2ee
drop 0x from call stack
aaupov 4ffebdc
[𝘀𝗽𝗿] changes introduced through rebase
aaupov 32e1148
refactor, address comments
aaupov cf17529
[𝘀𝗽𝗿] changes introduced through rebase
aaupov a99c726
fix test
aaupov a98cb95
reduce changes
aaupov 49c800e
[𝘀𝗽𝗿] changes introduced through rebase
aaupov 06a1ed4
move change from #191595
aaupov d5d7364
[𝘀𝗽𝗿] changes introduced through rebase
aaupov f21688e
drop IsPreAggregated
aaupov b251df3
warn on mismatching buildid
aaupov b6af213
[𝘀𝗽𝗿] changes introduced through rebase
aaupov d073a10
rebase
aaupov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
llvm/test/tools/llvm-profgen/Inputs/buildid-cs-noprobe.aggperfscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| 2 | ||
| aabb1122:4005dc | ||
| aabb1122:400634 | ||
| aabb1122:400684 | ||
| 7f68c5788793 | ||
| aabb1122:0x4005c8/aabb1122:0x4005dc aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005c8/aabb1122:0x4005dc | ||
| 2 | ||
| aabb1122:4005b0 | ||
| aabb1122:400684 | ||
| 7f68c5788793 | ||
| aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005c8/aabb1122:0x4005dc aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 |
9 changes: 9 additions & 0 deletions
9
llvm/test/tools/llvm-profgen/Inputs/buildid-cs-noprobe.perfscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| aabb1122:4005dc | ||
| aabb1122:400634 | ||
| aabb1122:400684 | ||
| 7f68c5788793 | ||
| aabb1122:0x4005c8/aabb1122:0x4005dc aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005c8/aabb1122:0x4005dc | ||
| aabb1122:4005b0 | ||
| aabb1122:400684 | ||
| 7f68c5788793 | ||
| aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005c8/aabb1122:0x4005dc aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 aabb1122:0x400645/aabb1122:0x4005ff aabb1122:0x400637/aabb1122:0x400645 aabb1122:0x4005e9/aabb1122:0x400634 aabb1122:0x4005d7/aabb1122:0x4005e5 aabb1122:0x40062f/aabb1122:0x4005b0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| ; REQUIRES: x86_64-linux | ||
| ; Test that [buildid:]0xaddr format is correctly parsed in hybrid perfscript | ||
| ; input. Both callstack frames and LBR entries may carry buildid prefixes. | ||
|
|
||
| ;; Test 1: Hybrid perfscript with buildid prefix on callstack frames and | ||
| ;; LBR entries, using --filter-build-id to match "aabb1122". | ||
| ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/buildid-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=0 --filter-build-id=aabb1122 | ||
| ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-HYBRID | ||
|
|
||
| ; CHECK-HYBRID: [foo] | ||
| ; CHECK-HYBRID-NEXT: 3 | ||
| ; CHECK-HYBRID-NEXT: 5ff-62f:6 | ||
| ; CHECK-HYBRID-NEXT: 634-637:6 | ||
| ; CHECK-HYBRID-NEXT: 645-645:6 | ||
| ; CHECK-HYBRID-NEXT: 3 | ||
| ; CHECK-HYBRID-NEXT: 62f->5b0:6 | ||
| ; CHECK-HYBRID-NEXT: 637->645:6 | ||
| ; CHECK-HYBRID-NEXT: 645->5ff:6 | ||
| ; CHECK-HYBRID-NEXT: [foo:3 @ bar] | ||
| ; CHECK-HYBRID-NEXT: 4 | ||
| ; CHECK-HYBRID-NEXT: 5b0-5c8:2 | ||
| ; CHECK-HYBRID-NEXT: 5b0-5d7:4 | ||
| ; CHECK-HYBRID-NEXT: 5dc-5e9:2 | ||
| ; CHECK-HYBRID-NEXT: 5e5-5e9:4 | ||
| ; CHECK-HYBRID-NEXT: 3 | ||
| ; CHECK-HYBRID-NEXT: 5c8->5dc:4 | ||
| ; CHECK-HYBRID-NEXT: 5d7->5e5:4 | ||
| ; CHECK-HYBRID-NEXT: 5e9->634:6 | ||
|
|
||
| ;; Test 2: Non-pre-aggregated perfscript with buildid prefix (no leading count). | ||
| ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/buildid-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t2 --skip-symbolization --profile-summary-cold-count=0 --filter-build-id=aabb1122 | ||
| ; RUN: FileCheck %s --input-file %t2 --check-prefix=CHECK-NOAGG | ||
|
|
||
| ; CHECK-NOAGG: [foo] | ||
| ; CHECK-NOAGG-NEXT: 3 | ||
| ; CHECK-NOAGG-NEXT: 5ff-62f:3 | ||
| ; CHECK-NOAGG-NEXT: 634-637:3 | ||
| ; CHECK-NOAGG-NEXT: 645-645:3 | ||
| ; CHECK-NOAGG-NEXT: 3 | ||
| ; CHECK-NOAGG-NEXT: 62f->5b0:3 | ||
| ; CHECK-NOAGG-NEXT: 637->645:3 | ||
| ; CHECK-NOAGG-NEXT: 645->5ff:3 | ||
| ; CHECK-NOAGG-NEXT: [foo:3 @ bar] | ||
| ; CHECK-NOAGG-NEXT: 4 | ||
| ; CHECK-NOAGG-NEXT: 5b0-5c8:1 | ||
| ; CHECK-NOAGG-NEXT: 5b0-5d7:2 | ||
| ; CHECK-NOAGG-NEXT: 5dc-5e9:1 | ||
| ; CHECK-NOAGG-NEXT: 5e5-5e9:2 | ||
| ; CHECK-NOAGG-NEXT: 3 | ||
| ; CHECK-NOAGG-NEXT: 5c8->5dc:2 | ||
| ; CHECK-NOAGG-NEXT: 5d7->5e5:2 | ||
| ; CHECK-NOAGG-NEXT: 5e9->634:3 | ||
|
|
||
| ;; Test 3: With non-matching filter, callstack frames are filtered out, | ||
| ;; resulting in no samples. | ||
| ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/buildid-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t3 --skip-symbolization --filter-build-id=ccdd3344 2>&1 | FileCheck %s --check-prefix=CHECK-NOMATCH | ||
| ; CHECK-NOMATCH: warning: No samples in perf script! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.