selftests/bpf: Refactor out some functions in ns_current_pid_tgid test
authorYonghong Song <yonghong.song@linux.dev>
Fri, 15 Mar 2024 18:49:04 +0000 (11:49 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 19 Mar 2024 21:26:58 +0000 (14:26 -0700)
commit4d4bd29e363c467752536f874a2cba10a5923c59
treebd42079c998c577d894c1bd3fcdf27e6396dd2c5
parent84239a24d10174fcfc7d6760cb120435a6ff69af
selftests/bpf: Refactor out some functions in ns_current_pid_tgid test

Refactor some functions in both user space code and bpf program
as these functions are used by later cgroup/sk_msg tests.
Another change is to mark tp program optional loading as later
patches will use optional loading as well since they have quite
different attachment and testing logic.

There is no functionality change.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240315184904.2976123-1-yonghong.song@linux.dev
tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c