Yonghong Song
cdfd9cc3ba
selftests/bpf: Replace CHECK with ASSERT macros for ksyms test
...
Replace CHECK with ASSERT macros for ksyms tests.
This test failed earlier with clang lto kernel, but the
issue is gone with latest code base. But replacing
CHECK with ASSERT still improves code as ASSERT is
preferred in selftests.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev >
Link: https://lore.kernel.org/r/20240326041448.1197812-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2024-03-28 18:31:41 -07:00
Hao Luo
2c2f6abeff
selftests/bpf: Ksyms_btf to test typed ksyms
...
Selftests for typed ksyms. Tests two types of ksyms: one is a struct,
the other is a plain int. This tests two paths in the kernel. Struct
ksyms will be converted into PTR_TO_BTF_ID by the verifier while int
typed ksyms will be converted into PTR_TO_MEM.
Signed-off-by: Hao Luo <haoluo@google.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: Andrii Nakryiko <andriin@fb.com >
Link: https://lore.kernel.org/bpf/20200929235049.2533242-4-haoluo@google.com
2020-10-02 14:59:25 -07:00
Ilya Leoshkevich
90a1deda75
selftests/bpf: Fix test_ksyms on non-SMP kernels
...
On non-SMP kernels __per_cpu_start is not 0, so look it up in kallsyms.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: Andrii Nakryiko <andriin@fb.com >
Link: https://lore.kernel.org/bpf/20200910171336.3161995-1-iii@linux.ibm.com
2020-09-10 19:53:58 -07:00
Andrii Nakryiko
b7ddfab20a
selftests/bpf: Add __ksym extern selftest
...
Validate libbpf is able to handle weak and strong kernel symbol externs in BPF
code correctly.
Signed-off-by: Andrii Nakryiko <andriin@fb.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Reviewed-by: Hao Luo <haoluo@google.com >
Link: https://lore.kernel.org/bpf/20200619231703.738941-4-andriin@fb.com
2020-06-22 17:01:48 -07:00