OSDN Git Service

selftests/bpf: Add dump type data tests to btf dump tests
authorAlan Maguire <alan.maguire@oracle.com>
Thu, 15 Jul 2021 15:15:26 +0000 (16:15 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 16 Jul 2021 20:50:36 +0000 (13:50 -0700)
commit70a9241fbce5398965bf05a595ee892845ae31e9
treef43063e9281444c97fa38e67379dbfed404ba5d1
parent17283337ff86a1956940bc6bfb3f7dafe82304f3
selftests/bpf: Add dump type data tests to btf dump tests

Test various type data dumping operations by comparing expected
format with the dumped string; an snprintf-style printf function
is used to record the string dumped.  Also verify overflow handling
where the data passed does not cover the full size of a type,
such as would occur if a tracer has a portion of the 8k
"struct task_struct".

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1626362126-27775-4-git-send-email-alan.maguire@oracle.com
tools/testing/selftests/bpf/prog_tests/btf_dump.c