diff options
| author | Menglong Dong <[email protected]> | 2023-03-06 06:48:31 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2023-03-06 17:38:04 +0000 |
| commit | f8b299bc6a0f8695d4005ecff29773c79a1d29af (patch) | |
| tree | 53a17be54b077eafeb7b1075c52e52002d058334 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
| parent | tools/resolve_btfids: Add /libsubcmd to .gitignore (diff) | |
| download | kernel-f8b299bc6a0f8695d4005ecff29773c79a1d29af.tar.gz kernel-f8b299bc6a0f8695d4005ecff29773c79a1d29af.zip | |
libbpf: Add support to set kprobe/uprobe attach mode
By default, libbpf will attach the kprobe/uprobe BPF program in the
latest mode that supported by kernel. In this patch, we add the support
to let users manually attach kprobe/uprobe in legacy or perf mode.
There are 3 mode that supported by the kernel to attach kprobe/uprobe:
LEGACY: create perf event in legacy way and don't use bpf_link
PERF: create perf event with perf_event_open() and don't use bpf_link
Signed-off-by: Menglong Dong <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Reviewed-by: Biao Jiang <[email protected]>
Link: create perf event with perf_event_open() and use bpf_link
Link: https://lore.kernel.org/bpf/[email protected]/
Link: https://lore.kernel.org/bpf/[email protected]
Users now can manually choose the mode with
bpf_program__attach_uprobe_opts()/bpf_program__attach_kprobe_opts().
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions
