Skip to content

libbpf: add legacy uprobe support

Andrii Nakryiko bpf 2 versions – Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyApplied
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- drop 'legacy = true' debug left-over and explain legacy check (Alexei).

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4libbpf: fix memory leak in legacy kprobe attach logictools/lib/bpf/libbpf.c+7 -30 replies
2/4selftests/bpf: adopt attach_probe selftest to work on old kernelstools/testing/selftests/bpf/prog_tests/attach_probe.c+20 -40 replies
3/4libbpf: refactor and simplify legacy kprobe codetools/lib/bpf/libbpf.c tools/lib/bpf/libbpf.h+88 -730 replies
4/4libbpf: add legacy uprobe attaching supporttools/lib/bpf/libbpf.c+122 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/4] libbpf: add legacy uprobe support

Implement libbpf support for attaching uprobes/uretprobes using legacy tracefs interfaces. This is a logical complement to recently landed legacy kprobe support ([0]). This patch refactors existing legacy kprobe code to be more uniform with uprobe code as well, making the logic easier to compare and follow.

This patch set also fixes two bugs recently found by Coverity in legacy kprobe handling code, and thus subsumes previously submitted two patches ([1]):
original patch #1 is kept as is, while original patch #2 was dropped because patch #3 of the current series refactors and fixes affected code.

[0] https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
[1] https://patchwork.kernel.org/project/netdevbpf/list/?series=549977&state=*

v1->v2:
- drop 'legacy = true' debug left-over and explain legacy check (Alexei).

Andrii Nakryiko (4):
libbpf: fix memory leak in legacy kprobe attach logic selftests/bpf: adopt attach_probe selftest to work on old kernels
libbpf: refactor and simplify legacy kprobe code
libbpf: add legacy uprobe attaching support

 tools/lib/bpf/libbpf.c                        | 297 +++++++++++++-----
 tools/lib/bpf/libbpf.h                        |   2 +-
 .../selftests/bpf/prog_tests/attach_probe.c   |  24 +-
 3 files changed, 236 insertions(+), 87 deletions(-)
Signature · 1 line
2.30.2