public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v8 0/5] Add prog_kfunc feature probe
@ 2025-02-24 16:59 Tao Chen
  2025-02-24 16:59 ` [PATCH bpf-next v8 1/5] libbpf: Extract prog load type check from libbpf_probe_bpf_helper Tao Chen
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Tao Chen @ 2025-02-24 16:59 UTC (permalink / raw)
  To: ast, daniel, andrii, eddyz87, haoluo, jolsa, qmo
  Cc: bpf, linux-kernel, chen.dylane, Tao Chen

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 <eddyz87@gmail.com>
- v7
  https://lore.kernel.org/bpf/20250212153912.24116-1-chen.dylane@gmail.com/  

- v6 -> v7:
  - wrap err with libbpf_err
  - comments fix
  - handle btf_fd < 0 as vmlinux
  - patchset Reviewed-by: Jiri Olsa <jolsa@kernel.org>
- v6
  https://lore.kernel.org/bpf/20250211111859.6029-1-chen.dylane@gmail.com

- v5 -> v6:
  - remove fd_array_cnt
  - test case clean code
- v5
  https://lore.kernel.org/bpf/20250210055945.27192-1-chen.dylane@gmail.com

- v4 -> v5:
  - use fd_array on stack
  - declare the scope of use of btf_fd
- v4
  https://lore.kernel.org/bpf/20250206051557.27913-1-chen.dylane@gmail.com/

- 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/20250124144411.13468-1-chen.dylane@gmail.com

- v2 -> v3:
  - rename parameter off with btf_fd
  - extract the common part for libbpf_probe_bpf_{helper,kfunc}
- v2
  https://lore.kernel.org/bpf/20250123170555.291896-1-chen.dylane@gmail.com

- 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/20250122171359.232791-1-chen.dylane@gmail.com

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(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-02-26 16:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 16:59 [PATCH bpf-next v8 0/5] Add prog_kfunc feature probe Tao Chen
2025-02-24 16:59 ` [PATCH bpf-next v8 1/5] libbpf: Extract prog load type check from libbpf_probe_bpf_helper Tao Chen
2025-02-24 16:59 ` [PATCH bpf-next v8 2/5] libbpf: Init fd_array when prog probe load Tao Chen
2025-02-24 16:59 ` [PATCH bpf-next v8 3/5] libbpf: Add libbpf_probe_bpf_kfunc API Tao Chen
2025-02-25  1:15   ` Andrii Nakryiko
2025-02-25  5:47     ` Tao Chen
2025-02-25 17:01       ` Andrii Nakryiko
2025-02-24 16:59 ` [PATCH bpf-next v8 4/5] libbpf: Init kprobe prog expected_attach_type for kfunc probe Tao Chen
2025-02-25  1:15   ` Andrii Nakryiko
2025-02-25  5:44     ` Tao Chen
2025-02-25 17:04       ` Andrii Nakryiko
2025-02-26 11:12         ` Jiri Olsa
2025-02-26 16:10           ` Tao Chen
2025-02-24 16:59 ` [PATCH bpf-next v8 5/5] selftests/bpf: Add libbpf_probe_bpf_kfunc API selftests Tao Chen
2025-02-24 17:13 ` [PATCH bpf-next v8 0/5] Add prog_kfunc feature probe Tao Chen
2025-02-25  1:28   ` Eduard Zingerman

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