-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[BPF] Do not emit names for PTR, CONST, VOLATILE and RESTRICT BTF types #163174
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
Conversation
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
a06db8c to
bdcfba5
Compare
Contributor
Author
tamird
approved these changes
Oct 16, 2025
bdcfba5 to
f07ca1c
Compare
eddyz87
approved these changes
Oct 17, 2025
Contributor
eddyz87
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes in BTF generated for kernel selftests, the change lgtm.
08b5044 to
5454bb8
Compare
We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
5454bb8 to
21da7b8
Compare
Contributor
Author
|
@eddyz87 @yonghong-song Can we get it merged? 🙂 |
vadorovsky
added a commit
to aya-rs/llvm-project
that referenced
this pull request
Oct 24, 2025
…es (llvm#163174) We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
vadorovsky
added a commit
to vadorovsky/llvm-project
that referenced
this pull request
Oct 26, 2025
…es (llvm#163174) We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
dvbuka
pushed a commit
to dvbuka/llvm-project
that referenced
this pull request
Oct 27, 2025
…es (llvm#163174) We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
c-rhodes
pushed a commit
to vadorovsky/llvm-project
that referenced
this pull request
Oct 28, 2025
…es (llvm#163174) We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
Lukacma
pushed a commit
to Lukacma/llvm-project
that referenced
this pull request
Oct 29, 2025
…es (llvm#163174) We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
aokblast
pushed a commit
to aokblast/llvm-project
that referenced
this pull request
Oct 30, 2025
…es (llvm#163174) We currently raise a warning in `print_btf.py` when any of these types have a name. Linux kernel doesn't allow names in these types either.[0] However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission. [0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586
vadorovsky
added a commit
to vadorovsky/aya
that referenced
this pull request
Nov 5, 2025
It was never necessary in the first place. There is no place in the kernel that enforces BTF map structs themselves to be anonymous. Only pointer types (that are members of BTF maps) have to be anonymous, but that's currently handled by LLVM[0]. BTF maps work just fine without it. [0] llvm/llvm-project#163174
vadorovsky
added a commit
to vadorovsky/aya
that referenced
this pull request
Nov 9, 2025
It was never necessary in the first place. There is no place in the kernel that enforces BTF map structs themselves to be anonymous. Only pointer types (that are members of BTF maps) have to be anonymous, but that's currently handled by LLVM[0]. BTF maps work just fine without it. [0] llvm/llvm-project#163174
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.
We currently raise a warning in
print_btf.pywhen any of these types have a name. Linux kernel doesn't allow names in these types either.[0]However, there is nothing stopping frontends from giving names to these types. To make sure that they are always anonymous, explicitly skip the name emission.
[0] https://elixir.bootlin.com/linux/v6.17.1/source/kernel/bpf/btf.c#L2586