OSDN Git Service

tools/bpf: add a selftest for bpf_get_current_cgroup_id() helper
authorYonghong Song <yhs@fb.com>
Sun, 3 Jun 2018 22:59:43 +0000 (15:59 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 4 Jun 2018 01:22:41 +0000 (18:22 -0700)
commitf269099a7e7a0c6732c4a817d0e99e92216414d9
tree74151563ca1a780f930b7537846123d165af5829
parentc7ddbbaf1e73e2f4e95cfda7b1da1be7fd199a4d
tools/bpf: add a selftest for bpf_get_current_cgroup_id() helper

Syscall name_to_handle_at() can be used to get cgroup id
for a particular cgroup path in user space. The selftest
got cgroup id from both user and kernel, and compare to
ensure they are equal to each other.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/cgroup_helpers.c
tools/testing/selftests/bpf/cgroup_helpers.h
tools/testing/selftests/bpf/get_cgroup_id_kern.c [new file with mode: 0644]
tools/testing/selftests/bpf/get_cgroup_id_user.c [new file with mode: 0644]