]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
selftests/bpf: Add selftest for calling global functions from freplace
authorToke Høiland-Jørgensen <toke@redhat.com>
Mon, 6 Jun 2022 07:52:52 +0000 (09:52 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:53:37 +0000 (10:53 +0200)
commitea39227f34c93468335d2b945923c6c9ac79ad8f
tree4e15d4460049922a813577ff9866bf1f29b31b5d
parent3ef63a27b268d95494fa002f06ca54ce54d73208
selftests/bpf: Add selftest for calling global functions from freplace

BugLink: https://bugs.launchpad.net/bugs/1986715
commit 2cf7b7ffdae519b284f1406012b52e2282fa36bf upstream.

Add a selftest that calls a global function with a context object parameter
from an freplace function to check that the program context type is
correctly converted to the freplace target when fetching the context type
from the kernel BTF.

v2:
- Trim includes
- Get rid of global function
- Use __noinline

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20220606075253.28422-2-toke@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
[ backport: fix conflict because tests were not serialised ]
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
tools/testing/selftests/bpf/progs/freplace_global_func.c [new file with mode: 0644]