History

bpf: Make BPF trampoline use register_ftrace_direct() API

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.

Alexei Starovoitov committed 6 years ago

Commit b91e0141 parent 5b79bcd2 files · +59 −6Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/bpf.h+1−0
@@ -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];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t