Skip to content

LINK_CREATE support for fentry/tp_btf/lsm attachments

Andrii Nakryiko bpf 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: allow attach TRACING programs through LINK_CREATE commandkernel/bpf/syscall.c+56 -541 replyApplied
2/3libbpf: teach bpf_link_create() to fallback to bpf_raw_tracepoint_open()tools/lib/bpf/bpf.c tools/lib/bpf/libbpf.c+34 -31 replyApplied
3/3selftests/bpf: switch fexit_stress to bpf_link_create() APItools/testing/selftests/bpf/prog_tests/fexit_stress.c+1 -11 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchKuifeng Lee
1/3R-b
2/3R-b
3/3R-b

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

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] LINK_CREATE support for fentry/tp_btf/lsm attachments

Wire up ability to attach bpf_link-based fentry/fexit/fmod_ret, tp_btf (BTF-aware raw tracepoints), and LSM programs through universal LINK_CREATE command, in addition to current BPF_RAW_TRACEPOINT_OPEN.

Teach libbpf to handle this LINK_CREATE/BPF_RAW_TRACEPOINT_OPEN split on older kernels transparently in universal low-level bpf_link_create() API for users convenience.

Patch #3 converts fexit_stress selftest to bpf_link_create().

libbpf CI will be testing this fallback logic on older kernels.

Cc Kui-Feng Lee <[email protected]>

Andrii Nakryiko (3):
bpf: allow attach TRACING programs through LINK_CREATE command
libbpf: teach bpf_link_create() to fallback to
bpf_raw_tracepoint_open()
selftests/bpf: switch fexit_stress to bpf_link_create() API

 kernel/bpf/syscall.c                          | 110 +++++++++---------
 tools/lib/bpf/bpf.c                           |  34 +++++-
 tools/lib/bpf/libbpf.c                        |   3 +-
 .../selftests/bpf/prog_tests/fexit_stress.c   |   2 +-
 4 files changed, 91 insertions(+), 58 deletions(-)
Signature · 1 line
2.30.2