diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-21 05:02:17 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-21 05:02:17 +0300 |
commit | 6b2edf27fe26c73cd67b6bf5ffb23dce882e1455 (patch) | |
tree | 8d489d55fc5ab4d662abd6fa8fa47a0cc46af4af /tools/testing/selftests/cgroup/cgroup_util.c | |
parent | 7140ad3898dd119d993aff76a8752570c4f23871 (diff) | |
parent | 01675e9503c4e20c5ce9aebdfe6a9cf2ae4991e0 (diff) | |
download | linux-6b2edf27fe26c73cd67b6bf5ffb23dce882e1455.tar.xz |
Merge tag 'linux-kselftest-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull Kselftest update from Shuah Khan:
- add cgroup core selftests
- fix compile warnings in android ion test
- fix to bugs in exclude and skip paths in vDSO test
- remove obsolete config options
- add missing .gitignore file
* tag 'linux-kselftest-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests/ftrace: Fix kprobe string testcase to not probe notrace function
selftests: mount: remove no longer needed config option
selftests: cgroup: add gitignore file
Add cgroup core selftests
selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run
selftests: vDSO - fix to exclude x86 test on non-x86 platforms
selftests/android: initialize heap_type to avoid compiling warning
Diffstat (limited to 'tools/testing/selftests/cgroup/cgroup_util.c')
-rw-r--r-- | tools/testing/selftests/cgroup/cgroup_util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c index 1e9e3c470561..1c5d2b2a583b 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.c +++ b/tools/testing/selftests/cgroup/cgroup_util.c @@ -229,6 +229,14 @@ retry: return ret; } +int cg_enter_current(const char *cgroup) +{ + char pidbuf[64]; + + snprintf(pidbuf, sizeof(pidbuf), "%d", getpid()); + return cg_write(cgroup, "cgroup.procs", pidbuf); +} + int cg_run(const char *cgroup, int (*fn)(const char *cgroup, void *arg), void *arg) |