[bpf-next,v4,0/3] libbpf: allow users to set kprobe/uprobe attach mode

Message ID 20230306064833.7932-1-imagedong@tencent.com
Headers
Series libbpf: allow users to set kprobe/uprobe attach mode |

Message

Menglong Dong March 6, 2023, 6:48 a.m. UTC
  From: Menglong Dong <imagedong@tencent.com>

By default, libbpf will attach the kprobe/uprobe BPF program in the
latest mode that supported by kernel. In this series, we add the support
to let users manually attach kprobe/uprobe in legacy/perf/link mode in
the 1th patch.

And in the 2th patch, we split the testing 'attach_probe' into multi
subtests, as Andrii suggested.

In the 3th patch, we add the testings for loading kprobe/uprobe in
different mode.

Changes since v3:
- rename eBPF to BPF in the doc
- use OPTS_GET() to get the value of 'force_ioctl_attach'
- error out on attach mode is not supported
- use test_attach_probe_manual__open_and_load() directly

Changes since v2:
- fix the typo in the 2th patch

Changes since v1:
- some small changes in the 1th patch, as Andrii suggested
- split 'attach_probe' into multi subtests

Menglong Dong (3):
  libbpf: add support to set kprobe/uprobe attach mode
  selftests/bpf: split test_attach_probe into multi subtests
  selftests/bpf: add test for legacy/perf kprobe/uprobe attach mode

 tools/lib/bpf/libbpf.c                        |  47 ++-
 tools/lib/bpf/libbpf.h                        |  31 +-
 .../selftests/bpf/prog_tests/attach_probe.c   | 291 ++++++++++++------
 .../bpf/progs/test_attach_kprobe_sleepable.c  |  23 ++
 .../selftests/bpf/progs/test_attach_probe.c   |  35 +--
 .../bpf/progs/test_attach_probe_manual.c      |  53 ++++
 6 files changed, 347 insertions(+), 133 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_attach_kprobe_sleepable.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_attach_probe_manual.c
  

Comments

patchwork-bot+netdevbpf@kernel.org March 6, 2023, 6 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Mon,  6 Mar 2023 14:48:30 +0800 you wrote:
> From: Menglong Dong <imagedong@tencent.com>
> 
> By default, libbpf will attach the kprobe/uprobe BPF program in the
> latest mode that supported by kernel. In this series, we add the support
> to let users manually attach kprobe/uprobe in legacy/perf/link mode in
> the 1th patch.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v4,1/3] libbpf: add support to set kprobe/uprobe attach mode
    (no matching commit)
  - [bpf-next,v4,2/3] selftests/bpf: split test_attach_probe into multi subtests
    https://git.kernel.org/bpf/bpf-next/c/7391ec6391e2
  - [bpf-next,v4,3/3] selftests/bpf: add test for legacy/perf kprobe/uprobe attach mode
    https://git.kernel.org/bpf/bpf-next/c/c7aec81b31e4

You are awesome, thank you!