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 | struct { | 461 | struct { |
| 462 | struct btf_func_model model; | 462 | struct btf_func_model model; |
| 463 | void *addr; | 463 | void *addr; |
| 464 | bool ftrace_managed; | ||
| 464 | } func; | 465 | } func; |
| 465 | /* list of BPF programs using this trampoline */ | 466 | /* list of BPF programs using this trampoline */ |
| 466 | struct hlist_head progs_hlist[BPF_TRAMP_MAX]; | 467 | struct hlist_head progs_hlist[BPF_TRAMP_MAX]; |