-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: Update BPF script for trampolines on newer kernels (5.10+)
Since Linux 5.10 and commit 3aac1ead5eb6 ("bpf: Move prog->aux->linked_prog and trampoline into bpf_link on attach"), the kernel "struct bpf_prog_aux" no longer has a "trampoline" attribute. Instead, it got a "dst_trampoline" attribute, but the latter cannot be used as a drop-in remplacement, because the reference from the tracing program to the target is removed after attaching (and this pointer is NULL). To retrieve the target program, we must instead loop on the existing links, find their parent "struct bpf_tracing_link" object, and get the target program from there. Let's adjust the script accordingly, but keep compatibility for older kernels too. Signed-off-by: Quentin Monnet <quentin@isovalent.com>
- Loading branch information
Showing
1 changed file
with
50 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters