mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-28 12:19:07 +08:00
tools/libbpf: Add support for bpf map element iterator
Add map_fd to bpf_iter_attach_opts and flags to bpf_link_create_opts. Later on, bpftool or selftest will be able to create a bpf map element iterator by passing map_fd to the kernel during link creation time. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200723184117.590673-1-yhs@fb.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
b1720407ff
commit
5efd8395ef
@@ -264,8 +264,9 @@ LIBBPF_API struct bpf_link *bpf_map__attach_struct_ops(struct bpf_map *map);
|
||||
|
||||
struct bpf_iter_attach_opts {
|
||||
size_t sz; /* size of this struct for forward/backward compatibility */
|
||||
__u32 map_fd;
|
||||
};
|
||||
#define bpf_iter_attach_opts__last_field sz
|
||||
#define bpf_iter_attach_opts__last_field map_fd
|
||||
|
||||
LIBBPF_API struct bpf_link *
|
||||
bpf_program__attach_iter(struct bpf_program *prog,
|
||||
|
||||
Reference in New Issue
Block a user