selftests/bpf: Move is_jit_enabled() into testing_helpers
authorTiezhu Yang <yangtiezhu@loongson.cn>
Tue, 23 Jan 2024 09:03:50 +0000 (17:03 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 24 Jan 2024 04:26:17 +0000 (20:26 -0800)
commit15b4f88dcc0a751f790bfea5ef9dcc6385c62236
tree166a41af24d6304c34d61e2f797bbaf07f1765f8
parent8b593021319d4893a8fbeb7bd1f668657e68403c
selftests/bpf: Move is_jit_enabled() into testing_helpers

Currently, is_jit_enabled() is only used in test_progs, move it into
testing_helpers so that it can be used in test_verifier. While at it,
remove the second argument "0" of open() as Hou Tao suggested.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Hou Tao <houtao1@huawei.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20240123090351.2207-2-yangtiezhu@loongson.cn
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/testing_helpers.c
tools/testing/selftests/bpf/testing_helpers.h