summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/cgroup/cgroup_util.h
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2019-10-04 12:57:41 +0200
committerTejun Heo <tj@kernel.org>2019-10-07 07:11:54 -0700
commit58c9f75b86f76895b9dd44f21dc1e37d0f477cc7 (patch)
tree8bf68c62b3f6973e0ccc89da290522085855e11e /tools/testing/selftests/cgroup/cgroup_util.h
parent9a3284fad42f66bb43629c6716709ff791aaa457 (diff)
selftests: cgroup: Simplify task self migration
Simplify task migration by being oblivious about its PID during migration. This allows to easily migrate individual threads as well. This change brings no functional change and prepares grounds for thread granularity migrating tests. Signed-off-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/testing/selftests/cgroup/cgroup_util.h')
-rw-r--r--tools/testing/selftests/cgroup/cgroup_util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/cgroup/cgroup_util.h b/tools/testing/selftests/cgroup/cgroup_util.h
index c72f28046bfa..27ff21d82af1 100644
--- a/tools/testing/selftests/cgroup/cgroup_util.h
+++ b/tools/testing/selftests/cgroup/cgroup_util.h
@@ -1,4 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 */
+#include <stdbool.h>
#include <stdlib.h>
#define PAGE_SIZE 4096
@@ -35,6 +36,7 @@ extern int cg_run(const char *cgroup,
void *arg);
extern int cg_enter(const char *cgroup, int pid);
extern int cg_enter_current(const char *cgroup);
+extern int cg_enter_current_thread(const char *cgroup);
extern int cg_run_nowait(const char *cgroup,
int (*fn)(const char *cgroup, void *arg),
void *arg);
@@ -45,4 +47,4 @@ extern int is_swap_enabled(void);
extern int set_oom_adj_score(int pid, int score);
extern int cg_wait_for_proc_count(const char *cgroup, int count);
extern int cg_killall(const char *cgroup);
-extern char proc_read_text(int pid, const char *item, char *buf, size_t size);
+extern ssize_t proc_read_text(int pid, bool thread, const char *item, char *buf, size_t size);