selftests/bpf: add a ksym iter subtest
authorAlan Maguire <alan.maguire@oracle.com>
Tue, 12 Jul 2022 12:31:45 +0000 (13:31 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 12 Jul 2022 22:27:19 +0000 (15:27 -0700)
commita9d2fae89fa8eb638203d8a4da435c647c12dfa3
tree79fc7639a8674e20b98c011f5205979189544eb3
parent647cafa22349026a8435030e9157074ab7fe5710
selftests/bpf: add a ksym iter subtest

add subtest verifying BPF ksym iter behaviour.  The BPF ksym
iter program shows an example of dumping a format different to
/proc/kallsyms.  It adds KIND and MAX_SIZE fields which represent the
kind of symbol (core kernel, module, ftrace, bpf, or kprobe) and
the maximum size the symbol can be.  The latter is calculated from
the difference between current symbol value and the next symbol
value.

The key benefit for this iterator will likely be supporting in-kernel
data-gathering rather than dumping symbol details to userspace and
parsing the results.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/1657629105-7812-3-git-send-email-alan.maguire@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_iter.c
tools/testing/selftests/bpf/progs/bpf_iter.h
tools/testing/selftests/bpf/progs/bpf_iter_ksym.c [new file with mode: 0644]