Merged
Conversation
LLVM has some utilities to print statistics about PGO data. Let's print a few views so we can better debug PGO instrumentation.
This is more reliable. See comment in added patch for context.
Contrary to popular belief, the system doesn't need to be "idle" to collect profiling data. See inline comment + https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp for the PGO implementation for the evidence.
ae6c130 to
587cde5
Compare
geofft
approved these changes
Mar 23, 2026
Comment on lines
+8
to
+9
| %p expands to the process ID. While unlikely, PID collisions can occur, | ||
| leading to loss of data. |
Collaborator
There was a problem hiding this comment.
Did you actually run into a collision? Especially in our CI runners we shouldn't have so many things running to trigger PID reuse, and it's easy to bump the max PID number (the kernel default is low for human friendliness but I think it can go up to at least 2^31). But no actual objection to this patch, especially if it's upstreamed at some point.
Collaborator
Author
There was a problem hiding this comment.
No. But I plan to enable PGO training against the full test harness in the near future and this will increase probability of a collision.
PID based naming alone isn't reliable and I wanted to change this out of principle.
Member
|
Can we create some issues for upstreaming per #886 |
This was referenced Mar 24, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See commit messages and inline comments for more details.
Some of these are good candidates for up-streaming. Although we make assumptions about availability of [modern] LLVM. So upstream patches may require configure work to sniff toolchain capabilities. It was vastly easier to implement the simple patches in PBS first.