Conversation
lmb
commented
Aug 6, 2024
| } | ||
|
|
||
| // MapFlags document which flags may be feature probed. | ||
| type MapFlags = sys.MapFlags |
Contributor
Author
There was a problem hiding this comment.
This is the breaking change the linter is complaining about. I don't think this should make a difference in practice.
Contributor
There was a problem hiding this comment.
Nope, should be fine since external callers never had access to sys.MapFlags anyway.
ti-mo
approved these changes
Aug 6, 2024
Contributor
ti-mo
left a comment
There was a problem hiding this comment.
One suggestion, looks fine otherwise!
bpf.h defines a bunch of constants as unnamed enums. This makes them tricky to pull out of vmlinux BTF, so instead we rely on the internal/unix shim. This causes a small maintenance burden whenever we need a new flag, but more importantly it makes some upcoming cross platform work harder. Pull the constant definitions out of vmlinux BTF instead of relying on package unix. Unfortunately a bunch of the flags are re-used. This is most noticeable for MapFlags, for which the enum in the kernel has become a bit of a grab bag. Instead of trying hard to wrap everything into a neat type we just generate untyped constants and get rid of MapFlags. Signed-off-by: Lorenz Bauer <[email protected]>
Some constants in bpf.h are defined using the C preprocessor and are therefore not available in BTF. Add them manually. Signed-off-by: Lorenz Bauer <[email protected]>
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.
internal/sys: generate constants from unnamed enums
internal/sys: add DEFINEd constants