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

bpftool: add support for split BTF to gen min_core_btf #129

Closed
wants to merge 1 commit into from

Commits on Jan 18, 2024

  1. bpftool: add support for split BTF to gen min_core_btf

    Enables a user to generate minimized kernel module BTF.
    
    If an eBPF program probes a function within a kernel module or uses
    types that come from a kernel module, split BTF is required. The split
    module BTF contains only the BTF types that are unique to the module.
    It will reference the base/vmlinux BTF types and always starts its type
    IDs at X+1 where X is the largest type ID in the base BTF.
    
    Minimization allows a user to ship only the types necessary to do
    relocations for the program(s) in the provided eBPF object file(s). A
    minimized module BTF will still not contain vmlinux BTF types, so you
    should always minimize the vmlinux file first, and then minimize the
    kernel module file.
    
    Example:
    
    bpftool gen min_core_btf vmlinux.btf vm-min.btf prog.bpf.o
    bpftool -B vm-min.btf gen min_core_btf mod.btf mod-min.btf prog.bpf.o
    
    Signed-off-by: Bryce Kahle <[email protected]>
    brycekahle committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    7ba210f View commit details
    Browse the repository at this point in the history