]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libbpf: Add getters for BTF.ext func and line info
authorMykyta Yatsenko <yatsenko@meta.com>
Tue, 8 Apr 2025 23:44:16 +0000 (00:44 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 9 Apr 2025 23:16:56 +0000 (16:16 -0700)
commit243d720e2e5320f7ed09034361aa20b74d8eeb03
treeaf219acf4121501ce66ccac1db065432966bb0ce
parent37b1b3ed20c39f8df78d00d1912e67efd3de4f93
libbpf: Add getters for BTF.ext func and line info

Introducing new libbpf API getters for BTF.ext func and line info,
namely:
  bpf_program__func_info
  bpf_program__func_info_cnt
  bpf_program__line_info
  bpf_program__line_info_cnt

This change enables scenarios, when user needs to load bpf_program
directly using `bpf_prog_load`, instead of higher-level
`bpf_object__load`. Line and func info are required for checking BTF
info in verifier; verification may fail without these fields if, for
example, program calls `bpf_obj_new`.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250408234417.452565-2-mykyta.yatsenko5@gmail.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map