OSDN Git Service

bpf: Add bpf_prog iterator
authorAlexei Starovoitov <ast@kernel.org>
Thu, 2 Jul 2020 01:10:18 +0000 (18:10 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:16:32 +0000 (20:16 -0700)
commita228a64fc1e4428e2b96dc68e9ad3c447095c9e7
tree60f1dbabaaabc43cd02535c1ff0bbe6aeba481a5
parent3f9969f2c040ba2ba635b6b5a7051f404bcc634d
bpf: Add bpf_prog iterator

It's mostly a copy paste of commit 6086d29def80 ("bpf: Add bpf_map iterator")
that is use to implement bpf_seq_file opreations to traverse all bpf programs.

v1->v2: Tweak to use build time btf_id

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
kernel/bpf/Makefile
kernel/bpf/prog_iter.c [new file with mode: 0644]
kernel/bpf/syscall.c