Skip to content

Conversation

@secDre4mer
Copy link
Contributor

While the program name in the kernel is limited to 16 bytes (including a terminating zero byte), the BTF information may contain the full name.

bpftool uses this information to extract the full program name, if possible, see https://github.com/libbpf/bpftool/blob/b799c6f513400009d56cfc11b8e3a8fcbd2b7c14/src/common.c#L413

Adapt this logic to do the same.

This also exposed a bug where some information was missing due to strange (arguably buggy) kernel behaviour. Add a workaround for this as well.

@secDre4mer secDre4mer requested a review from a team as a code owner November 4, 2025 14:39
As described in the comment, querying both xlated_prog_insns
and other fields can cause some information to be missing.
Make a separate syscall for this field to avoid missing information.

Signed-off-by: Max Altgelt <[email protected]>
Analogous to bpftool's get_prog_full_name function, query
a program's full name (if possible) from the BTF info.

Signed-off-by: Max Altgelt <[email protected]>
Copy link
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thank you!

@dylandreimerink dylandreimerink merged commit 627c039 into cilium:main Nov 10, 2025
31 of 33 checks passed
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.

2 participants