Make BPF trampoline attach its generated assembly code to kernel functions via register_ftrace_direct() API. It helps ftrace-based tracers co-exist with BPF trampoline on the same kernel function. It also switches attaching logic from arch specific text_poke to generic ftrace that is available on many architectures. text_poke is still necessary for bpf-to-bpf attach and for bpf_tail_call optimization.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -461,6 +461,7 @@ struct bpf_trampoline { · 460 unmodified lines | ||
| 461 | 461 | struct { |
| 462 | 462 | struct btf_func_model model; |
| 463 | 463 | void *addr; |
| 464 | + bool ftrace_managed; | |
| 464 | 465 | } func; |
| 465 | 466 | /* list of BPF programs using this trampoline */ |
| 466 | 467 | struct hlist_head progs_hlist[BPF_TRAMP_MAX]; |