BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v5 0/2] libbpf: introduce line_info and func_info getters
@ 2025-04-08 23:44 Mykyta Yatsenko
  2025-04-08 23:44 ` [PATCH bpf-next v5 1/2] libbpf: add getters for BTF.ext func and line info Mykyta Yatsenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mykyta Yatsenko @ 2025-04-08 23:44 UTC (permalink / raw)
  To: bpf, ast, andrii, daniel, kafai, kernel-team, eddyz87; +Cc: Mykyta Yatsenko

From: Mykyta Yatsenko <yatsenko@meta.com>

This patchset introduces new libbpf API getters that enable the retrieval
of .BTF.ext line and func info.
This change enables users to load bpf_program directly using bpf_prog_load,
bypassing the higher-level bpf_object__load API. Providing line and
function info is essential for BPF program verification in some cases.

v3 -> v5
 * Fix tests on s390x, nits.
 
v2 -> v3
 * Return ENOTSUPP if func or line info struct size differs from the one in
 uapi linux headers.
 * Add selftests.

v1 -> v2
 Move bpf_line_info_min and bpf_func_info_min from libbpf_internal.h to
 btf.h. Did not remove _min suffix, because there already are bpf_line_info
 and bpf_func_info structs in uapi/../bpf.h.

Mykyta Yatsenko (2):
  libbpf: add getters for BTF.ext func and line info
  selftests/bpf: add BTF.ext line/func info getter tests

 tools/lib/bpf/libbpf.c                        | 24 +++++++
 tools/lib/bpf/libbpf.h                        |  6 ++
 tools/lib/bpf/libbpf.map                      |  4 ++
 .../selftests/bpf/prog_tests/test_btf_ext.c   | 64 +++++++++++++++++++
 .../selftests/bpf/progs/test_btf_ext.c        | 22 +++++++
 5 files changed, 120 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/test_btf_ext.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_btf_ext.c

-- 
2.49.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-09 23:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 23:44 [PATCH bpf-next v5 0/2] libbpf: introduce line_info and func_info getters Mykyta Yatsenko
2025-04-08 23:44 ` [PATCH bpf-next v5 1/2] libbpf: add getters for BTF.ext func and line info Mykyta Yatsenko
2025-04-08 23:44 ` [PATCH bpf-next v5 2/2] selftests/bpf: add BTF.ext line/func info getter tests Mykyta Yatsenko
2025-04-09 23:40 ` [PATCH bpf-next v5 0/2] libbpf: introduce line_info and func_info getters patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox