selftests/bpf: Add variable-length data concatenation pattern test
authorAndrii Nakryiko <andriin@fb.com>
Tue, 23 Jun 2020 03:22:22 +0000 (20:22 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 23 Jun 2020 22:04:36 +0000 (00:04 +0200)
commit5e85c6bb8e74bd9daa4f5815da373d4ac2cb1a35
treec2dc5eb0f9c839e5bab5ff241e834749d4807dc5
parentbdb7b79b4ce864a724250e1d35948c46f135de36
selftests/bpf: Add variable-length data concatenation pattern test

Add selftest that validates variable-length data reading and concatentation
with one big shared data array. This is a common pattern in production use for
monitoring and tracing applications, that potentially can read a lot of data,
but overall read much less. Such pattern allows to determine precisely what
amount of data needs to be sent over perfbuf/ringbuf and maximize efficiency.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200623032224.4020118-2-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/varlen.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_varlen.c [new file with mode: 0644]