diff options
author | Hao Luo <haoluo@google.com> | 2020-09-30 02:50:46 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-10-03 00:59:25 +0300 |
commit | 2c2f6abeff1322a61f5ad7ce0ecccabf53e4fad5 (patch) | |
tree | 65be728aef8c734b3eedcf5ab6a86754866360f6 /tools/testing/selftests/bpf/trace_helpers.h | |
parent | d370bbe1214381f444cbd9cdf3b8647223abb536 (diff) | |
download | linux-2c2f6abeff1322a61f5ad7ce0ecccabf53e4fad5.tar.xz |
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
Diffstat (limited to 'tools/testing/selftests/bpf/trace_helpers.h')
-rw-r--r-- | tools/testing/selftests/bpf/trace_helpers.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/trace_helpers.h b/tools/testing/selftests/bpf/trace_helpers.h index 25ef597dd03f..f62fdef9e589 100644 --- a/tools/testing/selftests/bpf/trace_helpers.h +++ b/tools/testing/selftests/bpf/trace_helpers.h @@ -12,6 +12,10 @@ struct ksym { int load_kallsyms(void); struct ksym *ksym_search(long key); long ksym_get_addr(const char *name); + +/* open kallsyms and find addresses on the fly, faster than load + search. */ +int kallsyms_find(const char *sym, unsigned long long *addr); + void read_trace_pipe(void); #endif |