Re: [PATCH bpf-next] selftests/bpf: guess function end for test_get_branch_snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 22, 2021 at 4:48 PM Song Liu <songliubraving@xxxxxx> 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@xxxxxx>
> ---
>  .../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(-)
>

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux