mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-27 03:39:06 +08:00
libbpf: Add support for freplace attachment in bpf_link_create
This adds support for supplying a target btf ID for the bpf_link_create() operation, and adds a new bpf_program__attach_freplace() high-level API for attaching freplace functions with a target. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/160138355387.48470.18026176785351166890.stgit@toke.dk
This commit is contained in:
committed by
Andrii Nakryiko
parent
5e359219aa
commit
e40af4de0c
@@ -174,8 +174,9 @@ struct bpf_link_create_opts {
|
||||
__u32 flags;
|
||||
union bpf_iter_link_info *iter_info;
|
||||
__u32 iter_info_len;
|
||||
__u32 target_btf_id;
|
||||
};
|
||||
#define bpf_link_create_opts__last_field iter_info_len
|
||||
#define bpf_link_create_opts__last_field target_btf_id
|
||||
|
||||
LIBBPF_API int bpf_link_create(int prog_fd, int target_fd,
|
||||
enum bpf_attach_type attach_type,
|
||||
|
||||
Reference in New Issue
Block a user