Skip to content
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

btf: replace decl and type tags with placeholders on unsupported kernels #1615

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

ti-mo
Copy link
Collaborator

@ti-mo ti-mo commented Nov 19, 2024

Decl tags and type tags appeared in 5.16 and 5.17 respectively. This patch makes it possible to load BTF containing such tags on older kernels by replacing decl tags with integers and type tags with const qualifiers. This mirrors the logic in libbpf.

This is convenient if the user wants to load an ELF containing decl tags on global variables (available through CollectionSpec.Variables[].Tags) on older kernels.

Decl tags and type tags appeared in 5.16 and 5.17 respectively. This patch
makes it possible to load BTF containing such tags on older kernels by
replacing decl tags with integers and type tags with const qualifiers. This
mirrors the logic in libbpf.

This is convenient if the user wants to load an ELF containing decl tags on
global variables (available through CollectionSpec.Variables[].Tags) on older
kernels.

Signed-off-by: Timo Beckers <[email protected]>
@ti-mo ti-mo merged commit e2607b5 into cilium:main Nov 19, 2024
17 checks passed
@ti-mo ti-mo deleted the tb/probe-decl-type-tag branch November 19, 2024 13:10
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.

1 participant