public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: menglong8.dong@gmail.com
To: andrii.nakryiko@gmail.com, alan.maguire@oracle.com
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, song@kernel.org, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com,
	haoluo@google.com, jolsa@kernel.org, benbjiang@tencent.com,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	Menglong Dong <imagedong@tencent.com>
Subject: [PATCH bpf-next v4 0/3] libbpf: allow users to set kprobe/uprobe attach mode
Date: Mon,  6 Mar 2023 14:48:30 +0800	[thread overview]
Message-ID: <20230306064833.7932-1-imagedong@tencent.com> (raw)

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

-- 
2.39.0


             reply	other threads:[~2023-03-06  6:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  6:48 menglong8.dong [this message]
2023-03-06  6:48 ` [PATCH bpf-next v4 1/3] libbpf: add support to set kprobe/uprobe attach mode menglong8.dong
2023-03-06 17:59   ` Andrii Nakryiko
2023-03-06  6:48 ` [PATCH bpf-next v4 2/3] selftests/bpf: split test_attach_probe into multi subtests menglong8.dong
2023-03-06  6:48 ` [PATCH bpf-next v4 3/3] selftests/bpf: add test for legacy/perf kprobe/uprobe attach mode menglong8.dong
2023-03-06 18:00 ` [PATCH bpf-next v4 0/3] libbpf: allow users to set " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230306064833.7932-1-imagedong@tencent.com \
    --to=menglong8.dong@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=benbjiang@tencent.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=imagedong@tencent.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox