Commit Graph

3 Commits

Author SHA1 Message Date
Jerome Marchand abc2f7585a selftests: bpf: Replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE
JIRA: https://issues.redhat.com/browse/RHEL-63880

commit 23457b37ec3f9bb373d43cca61db371303726a1e
Author: Feng Yang <yangfeng@kylinos.cn>
Date:   Tue Sep 3 15:25:59 2024 +0800

    selftests: bpf: Replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE

    The ARRAY_SIZE macro is more compact and more formal in linux source.

    Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20240903072559.292607-1-yangfeng59949@163.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2025-01-21 11:27:02 +01:00
Artem Savkov a20c395a3d selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not available
Bugzilla: https://bugzilla.redhat.com/2221599

Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git

commit 971f7c32147f2d0953a815a109b22b8ed45949d4
Author: Artem Savkov <asavkov@redhat.com>
Date:   Thu Sep 14 14:49:28 2023 +0200

    selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not available

    This test relies on bpf_testmod, so skip it if the module is not available.

    Fixes: aa3d65de4b900 ("bpf/selftests: Test fentry attachment to shadowed functions")
    Signed-off-by: Artem Savkov <asavkov@redhat.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20230914124928.340701-1-asavkov@redhat.com

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2023-09-22 09:12:38 +02:00
Artem Savkov 7a5e1fbc36 bpf/selftests: Test fentry attachment to shadowed functions
Bugzilla: https://bugzilla.redhat.com/2221599

commit aa3d65de4b9004d799f97700751a86d3ebd7d5f9
Author: Viktor Malik <vmalik@redhat.com>
Date:   Fri Mar 10 08:41:00 2023 +0100

    bpf/selftests: Test fentry attachment to shadowed functions
    
    Adds a new test that tries to attach a program to fentry of two
    functions of the same name, one located in vmlinux and the other in
    bpf_testmod.
    
    To avoid conflicts with existing tests, a new function
    "bpf_fentry_shadow_test" was created both in vmlinux and in bpf_testmod.
    
    The previous commit fixed a bug which caused this test to fail. The
    verifier would always use the vmlinux function's address as the target
    trampoline address, hence trying to create two trampolines for a single
    address, which is forbidden.
    
    The test (similarly to other fentry/fexit tests) is not working on arm64
    at the moment.
    
    Signed-off-by: Viktor Malik <vmalik@redhat.com>
    Acked-by: Jiri Olsa <jolsa@kernel.org>
    Link: https://lore.kernel.org/r/5fe2f364190b6f79b085066ed7c5989c5bc475fa.1678432753.git.vmalik@redhat.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2023-09-22 09:12:17 +02:00