diff options
| author | Michal Koutný <mkoutny@suse.com> | 2025-06-17 15:36:53 +0200 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-06-17 08:13:01 -1000 |
| commit | 0925275a173d07786bfddf453f629f78d7fc4278 (patch) | |
| tree | fe5c2e77f3b49bd72600b13c3543a27417b93d26 /tools/testing/selftests/cgroup/lib/include | |
| parent | 38b9342ee62e9a1a868654ba6619de9da251bd57 (diff) | |
selftests: cgroup_util: Add helpers for testing named v1 hierarchies
Non-functional change, the control variable will be wired in a separate
commit.
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/testing/selftests/cgroup/lib/include')
| -rw-r--r-- | tools/testing/selftests/cgroup/lib/include/cgroup_util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h index adb2bc193183..c69cab66254b 100644 --- a/tools/testing/selftests/cgroup/lib/include/cgroup_util.h +++ b/tools/testing/selftests/cgroup/lib/include/cgroup_util.h @@ -13,6 +13,10 @@ #define TEST_UID 65534 /* usually nobody, any !root is fine */ +#define CG_THREADS_FILE (!cg_test_v1_named ? "cgroup.threads" : "tasks") +#define CG_NAMED_NAME "selftest" +#define CG_PATH_FORMAT (!cg_test_v1_named ? "0::%s" : (":name=" CG_NAMED_NAME ":%s")) + /* * Checks if two given values differ by less than err% of their sum. */ @@ -65,3 +69,4 @@ extern int dirfd_open_opath(const char *dir); extern int cg_prepare_for_wait(const char *cgroup); extern int memcg_prepare_for_wait(const char *cgroup); extern int cg_wait_for(int fd); +extern bool cg_test_v1_named; |
