[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzYdfgZDh4pLkeFr_BbzhOgg26PX1fgUZgi04w-n4p11bw@mail.gmail.com>
Date: Mon, 25 Oct 2021 21:46:48 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Song Liu <songliubraving@...com>
Cc: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next] selftests/bpf: guess function end for test_get_branch_snapshot
On Fri, Oct 22, 2021 at 4:48 PM Song Liu <songliubraving@...com> wrote:
>
> Function in modules could appear in /proc/kallsyms in random order.
>
> ffffffffa02608a0 t bpf_testmod_loop_test
> ffffffffa02600c0 t __traceiter_bpf_testmod_test_writable_bare
> ffffffffa0263b60 d __tracepoint_bpf_testmod_test_write_bare
> ffffffffa02608c0 T bpf_testmod_test_read
> ffffffffa0260d08 t __SCT__tp_func_bpf_testmod_test_writable_bare
> ffffffffa0263300 d __SCK__tp_func_bpf_testmod_test_read
> ffffffffa0260680 T bpf_testmod_test_write
> ffffffffa0260860 t bpf_testmod_test_mod_kfunc
>
> Therefore, we cannot reliably use kallsyms_find_next() to find the end of
> a function. Replace it with a simple guess (start + 128). This is good
> enough for this test.
It's so annoying that sizes of all those symbols are known and
available in ELF, yet kallsyms don't expose them :( I've applied this
"fix", but it makes me very sad.
>
> Signed-off-by: Song Liu <songliubraving@...com>
> ---
> .../bpf/prog_tests/get_branch_snapshot.c | 7 ++--
> tools/testing/selftests/bpf/trace_helpers.c | 36 -------------------
> tools/testing/selftests/bpf/trace_helpers.h | 5 ---
> 3 files changed, 4 insertions(+), 44 deletions(-)
>
[...]
Powered by blists - more mailing lists