diff options
author | Yonghong Song <yhs@fb.com> | 2018-06-04 00:59:43 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-06-04 03:22:41 +0200 |
commit | f269099a7e7a0c6732c4a817d0e99e92216414d9 (patch) | |
tree | 74151563ca1a780f930b7537846123d165af5829 /tools/testing/selftests/bpf/cgroup_helpers.h | |
parent | tools/bpf: sync uapi bpf.h for bpf_get_current_cgroup_id() helper (diff) | |
download | linux-f269099a7e7a0c6732c4a817d0e99e92216414d9.tar.xz linux-f269099a7e7a0c6732c4a817d0e99e92216414d9.zip |
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>
Diffstat (limited to 'tools/testing/selftests/bpf/cgroup_helpers.h')
-rw-r--r-- | tools/testing/selftests/bpf/cgroup_helpers.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/cgroup_helpers.h b/tools/testing/selftests/bpf/cgroup_helpers.h index 06485e0002b3..20a4a5dcd469 100644 --- a/tools/testing/selftests/bpf/cgroup_helpers.h +++ b/tools/testing/selftests/bpf/cgroup_helpers.h @@ -13,5 +13,6 @@ int create_and_get_cgroup(char *path); int join_cgroup(char *path); int setup_cgroup_environment(void); void cleanup_cgroup_environment(void); +unsigned long long get_cgroup_id(char *path); #endif |