]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf2c09d34d36bf1b7a030dbe9df6f4df3076964a2
tree79fc7639a8674e20b98c011f5205979189544eb3
parent4fc818c05944bfe626a902f6d3f7ad8e9c256150
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]