selftests/bpf: Ksyms_btf to test typed ksyms
authorHao Luo <haoluo@google.com>
Tue, 29 Sep 2020 23:50:46 +0000 (16:50 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 2 Oct 2020 21:59:25 +0000 (14:59 -0700)
commit2c2f6abeff1322a61f5ad7ce0ecccabf53e4fad5
tree65be728aef8c734b3eedcf5ab6a86754866360f6
parentd370bbe1214381f444cbd9cdf3b8647223abb536
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
tools/testing/selftests/bpf/prog_tests/ksyms.c
tools/testing/selftests/bpf/prog_tests/ksyms_btf.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_ksyms_btf.c [new file with mode: 0644]
tools/testing/selftests/bpf/trace_helpers.c
tools/testing/selftests/bpf/trace_helpers.h