selftests/bpf: Add missing trampoline program type to trampoline_count test
authorYuntao Wang <ytcoode@gmail.com>
Thu, 19 May 2022 15:06:10 +0000 (23:06 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 20 May 2022 23:12:14 +0000 (16:12 -0700)
commitb23316aabffa835ecc516cb81daeef5b9155e8a5
tree725acecb7560873d925c36bb5f3ebcbfde7f32de
parent96af42c50adb6cee517c355bfd50060ef27bfa87
selftests/bpf: Add missing trampoline program type to trampoline_count test

Currently the trampoline_count test doesn't include any fmod_ret bpf
programs, fix it to make the test cover all possible trampoline program
types.

Since fmod_ret bpf programs can't be attached to __set_task_comm function,
as it's neither whitelisted for error injection nor a security hook, change
it to bpf_modify_return_test.

This patch also does some other cleanups such as removing duplicate code,
dropping inconsistent comments, etc.

Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220519150610.601313-1-ytcoode@gmail.com
include/linux/bpf.h
tools/testing/selftests/bpf/prog_tests/trampoline_count.c
tools/testing/selftests/bpf/progs/test_trampoline_count.c