diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-10-07 17:10:24 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-10-07 18:50:27 -0700 |
commit | 888d83b961f6057aa377065b60c5206fd8bff97c (patch) | |
tree | 52172b5918a4b75107c00ecc8d4a9cd9943e9553 /tools/perf/tests/attr.py | |
parent | 2b7d88c2b582c659a6567e851d96873d0209a501 (diff) | |
download | linux-888d83b961f6057aa377065b60c5206fd8bff97c.tar.gz linux-888d83b961f6057aa377065b60c5206fd8bff97c.tar.bz2 linux-888d83b961f6057aa377065b60c5206fd8bff97c.zip |
selftests/bpf: Validate libbpf's auto-sizing of LD/ST/STX instructions
Add selftests validating libbpf's auto-resizing of load/store instructions
when used with CO-RE relocations. An explicit and manual approach with using
bpf_core_read() is also demonstrated and tested. Separate BPF program is
supposed to fail due to using signed integers of sizes that differ from
kernel's sizes.
To reliably simulate 32-bit BTF (i.e., the one with sizeof(long) ==
sizeof(void *) == 4), selftest generates its own custom BTF and passes it as
a replacement for real kernel BTF. This allows to test 32/64-bitness mix on
all architectures.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201008001025.292064-5-andrii@kernel.org
Diffstat (limited to 'tools/perf/tests/attr.py')
0 files changed, 0 insertions, 0 deletions