bpf: Add LINK_DETACH for perf links#11291
bpf: Add LINK_DETACH for perf links#11291kernel-patches-daemon-bpf[bot] wants to merge 3 commits intobpf-next_basefrom
Conversation
|
Upstream branch: 05c9b2e |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 4000532898 via email |
c7dcbca to
69a44ca
Compare
|
Upstream branch: 4faa189 |
4466bbb to
665984b
Compare
69a44ca to
f264dc7
Compare
|
Upstream branch: 748f9c6 |
665984b to
df33f14
Compare
f264dc7 to
59120bd
Compare
|
Upstream branch: 6dd780f |
df33f14 to
25875e9
Compare
59120bd to
94aca0b
Compare
|
Upstream branch: 099bded |
25875e9 to
96ba546
Compare
94aca0b to
980a66f
Compare
|
Upstream branch: bd2e02e |
96ba546 to
19a12c9
Compare
980a66f to
026b5c1
Compare
|
Upstream branch: bd2e02e |
19a12c9 to
5b595c9
Compare
026b5c1 to
b72a510
Compare
|
Upstream branch: 0c55d48 |
5b595c9 to
3e44c7d
Compare
b72a510 to
ebefa82
Compare
|
Upstream branch: e95e85b |
Add bpf_perf_link_detach() to allow detaching a BPF program from its perf event via BPF_LINK_DETACH while keeping the link file descriptor alive. This mirrors the existing behavior for xdp and cgroup links and enables temporarily disabling uprobes or other perf event-based programs that are attached via bpf_perf_links without closing the link. bpf_perf_link_release() is made idempotent using xchg() so that closing the link fd after an explicit LINK_DETACH does not call perf_event_free_bpf_prog() a second time. bpf_perf_link_fill_link_info() and bpf_perf_link_show_fdinfo() gain NULL guards so that querying an already-detached link returns an empty result rather than dereferencing a stale pointer. Signed-off-by: Florian Lehner <dev@der-flo.net>
Add serial_test_perf_link_detach() to verify that the new LINK_DETACH support for BPF perf links works correctly. The test creates a link to a BPF program for a software perf event, confirms the program is executed, calls bpf_link__detach() to exercise the BPF_LINK_DETACH syscall path, and then verifies the program is no longer invoked after detach. Signed-off-by: Florian Lehner <dev@der-flo.net>
3e44c7d to
9541385
Compare
ebefa82 to
4b0d910
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1061570 expired. Closing PR. |
Pull request for series with
subject: bpf: Add LINK_DETACH for perf links
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1061570