diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-07-01 16:58:58 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-07-05 22:37:30 +0200 |
commit | b26500274767bacbe571c75926fee2489f91ba28 (patch) | |
tree | cc359342cef07c33aab95447813899fe81e6d866 /tools/lib/bpf/libbpf.h | |
parent | 63f2f5ee856ba9db751123bc5519be099a3849a7 (diff) | |
download | blackbird-op-linux-b26500274767bacbe571c75926fee2489f91ba28.tar.gz blackbird-op-linux-b26500274767bacbe571c75926fee2489f91ba28.zip |
libbpf: add kprobe/uprobe attach API
Add ability to attach to kernel and user probes and retprobes.
Implementation depends on perf event support for kprobes/uprobes.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 1bf66c4a9330..bd767cc11967 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -171,6 +171,13 @@ LIBBPF_API int bpf_link__destroy(struct bpf_link *link); LIBBPF_API struct bpf_link * bpf_program__attach_perf_event(struct bpf_program *prog, int pfd); +LIBBPF_API struct bpf_link * +bpf_program__attach_kprobe(struct bpf_program *prog, bool retprobe, + const char *func_name); +LIBBPF_API struct bpf_link * +bpf_program__attach_uprobe(struct bpf_program *prog, bool retprobe, + pid_t pid, const char *binary_path, + size_t func_offset); struct bpf_insn; |