Skip to content

Conversation

@vadorovsky
Copy link
Contributor

@vadorovsky vadorovsky commented Oct 13, 2025

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 vadorovsky force-pushed the btf-ptr-name branch 3 times, most recently from a06db8c to bdcfba5 Compare October 16, 2025 17:27
@vadorovsky
Copy link
Contributor Author

@eddyz87 @tamird

Copy link
Contributor

@eddyz87 eddyz87 left a 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.

@vadorovsky vadorovsky force-pushed the btf-ptr-name branch 2 times, most recently from 08b5044 to 5454bb8 Compare October 20, 2025 20:00
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
Copy link
Contributor Author

@eddyz87 @yonghong-song Can we get it merged? 🙂

@yonghong-song yonghong-song merged commit 7ae7a5a into llvm:main Oct 22, 2025
10 checks passed
@vadorovsky vadorovsky deleted the btf-ptr-name branch October 22, 2025 14:36
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants