Skip to content

btf: mmap vmlinux if possible #1812

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

btf: mmap vmlinux if possible #1812

wants to merge 2 commits into from

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Jun 24, 2025

See commit messages. Merge once 6.15 is released.

@lmb lmb force-pushed the btf-mmap-vmlinux branch from 382bd1a to a4390f4 Compare June 24, 2025 11:36
@lmb lmb force-pushed the btf-mmap-vmlinux branch from a4390f4 to 01cae9e Compare June 24, 2025 13:35
lmb added 2 commits June 26, 2025 11:57
Parsing BTF still relies on io.Reader(At) in places, which makes it
awkward to parse from a plain byte slice. Rework the internal
plumbing to use []byte.

This also deductes the endianness of a BTF blob from its header,
which allows us to get rid of guessBTFByteOrder.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
The kernel recently gained the ability to mmap vmlinux BTF, which
allows us to not allocate a couple megabytes of heap memory.

See torvalds/linux@a539e2a

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb force-pushed the btf-mmap-vmlinux branch from 01cae9e to c028138 Compare June 26, 2025 10:57
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