Skip to content

Add prog_kfunc feature probe

Tao Chen bpf lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest posting 2/25 patches 10 repliesIn review
  2. v8 posting 1/24 patches 2 repliesSuperseded

Patches in v8 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5libbpf: Extract prog load type check from libbpf_probe_bpf_helpertools/lib/bpf/libbpf_probes.c+19 -120 replies
2/5libbpf: Init fd_array when prog probe loadtools/lib/bpf/libbpf_probes.c+4 -30 replies
3/5libbpf: Add libbpf_probe_bpf_kfunc APItools/lib/bpf/libbpf.h tools/lib/bpf/libbpf.map tools/lib/bpf/libbpf_probes.c+70 -13 replies
4/5libbpf: Init kprobe prog expected_attach_type for kfunc probetools/lib/bpf/libbpf_probes.c+1 -05 replies
5/5selftests/bpf: Add libbpf_probe_bpf_kfunc API selfteststools/testing/selftests/bpf/prog_tests/libbpf_probes.c+111 -00 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchJiri OlsaEduard Zingerman
1/5R-b R-b
2/5R-b R-b
3/5R-b R-b
4/5
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH bpf-next v8 0/5] 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:
- v7 -> v8:
- fix "kfuncs require device-bound" verifier info
- init expected_attach_type for kprobe prog type
- patchset Reviewed-by: Eduard Zingerman <[email protected]>
- v7
https://lore.kernel.org/bpf/[email protected]/

- v6 -> v7:
- wrap err with libbpf_err
- comments fix
- handle btf_fd < 0 as vmlinux
- patchset Reviewed-by: Jiri Olsa <[email protected]>
- v6
https://lore.kernel.org/bpf/[email protected]

- v5 -> v6:
- remove fd_array_cnt
- test case clean code
- v5
https://lore.kernel.org/bpf/[email protected]

- v4 -> v5:
- use fd_array on stack
- declare the scope of use of btf_fd
- v4
https://lore.kernel.org/bpf/[email protected]/

- v3 -> v4:
- add fd_array init for kfunc in mod btf
- add test case for kfunc in mod btf
- refactor common part as prog load type check for

    libbpf_probe_bpf_{helper,kfunc}

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

- v2 -> v3:
- rename parameter off with btf_fd
- extract the common part for libbpf_probe_bpf_{helper,kfunc}
- v2
https://lore.kernel.org/bpf/[email protected]

- v1 -> v2:
- check unsupported prog type like probe_bpf_helper
- add off parameter for module btf
- check verifier info when kfunc id invalid
- v1
https://lore.kernel.org/bpf/[email protected]

Tao Chen (5):
libbpf: Extract prog load type check from libbpf_probe_bpf_helper
libbpf: Init fd_array when prog probe load
libbpf: Add libbpf_probe_bpf_kfunc API
libbpf: Init kprobe prog expected_attach_type for kfunc probe selftests/bpf: Add libbpf_probe_bpf_kfunc API selftests

 tools/lib/bpf/libbpf.h                        |  19 ++-
 tools/lib/bpf/libbpf.map                      |   1 +
 tools/lib/bpf/libbpf_probes.c                 |  90 +++++++++++---
 .../selftests/bpf/prog_tests/libbpf_probes.c  | 111 ++++++++++++++++++
 4 files changed, 205 insertions(+), 16 deletions(-)
Signature · 1 line
2.43.0