diff options
author | Yonghong Song <yhs@fb.com> | 2018-11-19 15:29:20 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-11-20 10:54:39 -0800 |
commit | 999d82cbc04416cc7f2b5cb6daab947c16f0fd3a (patch) | |
tree | ee1c1b0b650b10534b39aa9b42b9ff3f2329c29e /tools/testing/selftests/bpf/test_btf_haskv.c | |
parent | tools/bpf: refactor to implement btf_get_from_id() in lib/bpf (diff) | |
download | linux-dev-999d82cbc04416cc7f2b5cb6daab947c16f0fd3a.tar.xz linux-dev-999d82cbc04416cc7f2b5cb6daab947c16f0fd3a.zip |
tools/bpf: enhance test_btf file testing to test func info
Change the bpf programs test_btf_haskv.c and test_btf_nokv.c to
have two sections, and enhance test_btf.c test_file feature
to test btf func_info returned by the kernel.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_btf_haskv.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_btf_haskv.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/test_btf_haskv.c b/tools/testing/selftests/bpf/test_btf_haskv.c index b21b876f475d..e5c79fe0ffdb 100644 --- a/tools/testing/selftests/bpf/test_btf_haskv.c +++ b/tools/testing/selftests/bpf/test_btf_haskv.c @@ -24,8 +24,8 @@ struct dummy_tracepoint_args { struct sock *sock; }; -SEC("dummy_tracepoint") -int _dummy_tracepoint(struct dummy_tracepoint_args *arg) +__attribute__((noinline)) +static int test_long_fname_2(struct dummy_tracepoint_args *arg) { struct ipv_counts *counts; int key = 0; @@ -42,4 +42,16 @@ int _dummy_tracepoint(struct dummy_tracepoint_args *arg) return 0; } +__attribute__((noinline)) +static int test_long_fname_1(struct dummy_tracepoint_args *arg) +{ + return test_long_fname_2(arg); +} + +SEC("dummy_tracepoint") +int _dummy_tracepoint(struct dummy_tracepoint_args *arg) +{ + return test_long_fname_1(arg); +} + char _license[] SEC("license") = "GPL"; |