Skip to contentSkip to conversation

Add prog_kfunc feature probe

PATCH Superseded Tao Chen 1 participant 1 message Jan 23, 2025 BPF

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Tao Chen

author
#0 lore raw

v2 cover Add prog_kfunc feature probe

More and more kfunc functions are being added to the kernel. Different prog types have different restrictions when using kfunc. Therefore, prog_kfunc probe is added to check whether it is supported, and the use of this api will be added to bpftool later.

Change list:
- v1 -> v2:
- check unsupported prog type like probe_bpf_helper
- add off parameter for module btf
- chenk verifier info when kfunc id invalid

Revisions:
- v1
https://lore.kernel.org/bpf/[email protected]

Tao Chen (2):
libbpf: Add libbpf_probe_bpf_kfunc API selftests/bpf: Add libbpf_probe_bpf_kfunc API selftests

 tools/lib/bpf/libbpf.h                        | 17 ++++++-
 tools/lib/bpf/libbpf.map                      |  1 +
 tools/lib/bpf/libbpf_probes.c                 | 47 +++++++++++++++++++
 .../selftests/bpf/prog_tests/libbpf_probes.c  | 35 ++++++++++++++
 4 files changed, 99 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0