• Yonghong Song's avatar
    tools/bpf: add support to read .BTF.ext sections · 2993e051
    Yonghong Song authored
    The .BTF section is already available to encode types.
    These types can be used for map
    pretty print. The whole .BTF will be passed to the
    kernel as well for which kernel can verify and return
    to the user space for pretty print etc.
    
    The llvm patch at https://reviews.llvm.org/D53736
    will generate .BTF section and one more section .BTF.ext.
    The .BTF.ext section encodes function type
    information and line information. Note that
    this patch set only supports function type info.
    The functionality is implemented in libbpf.
    
    The .BTF section can be directly loaded into the
    kernel, and the .BTF.ext section cannot. The loader
    may need to do some relocation and merging,
    similar to merging multiple code sections, before
    loading into the kernel.
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    2993e051
bpf.c 15.3 KB