cgroup_path
cgroup_path(iocg_to_blkg(iocg)->blkcg->css.cgroup, \
cgroup_path(cgrp, trace_cgroup_path, \
cgroup_path(cgrp, pathname, PATH_MAX - sizeof(u64));
cgroup_path(tg->css.cgroup, path, plen);
.cgroup_path = sch->cgrp_path,
cgroup_path(cgrp, buf, PATH_MAX);
.cgroup_path = sch->cgrp_path,
char *cgroup_path;
char *cgroup_path;
cgroup_path(memcg->css.cgroup, memcg_path_buf, PATH_MAX);
cgroup_path(memcg->css.cgroup, m->private, PATH_MAX);
i, args->cgroup_path);
i, args->cgroup_path);
char cgroup_path[PATH_MAX + 1];
format_cgroup_path(cgroup_path, relative_path);
return __enable_controllers(cgroup_path, controllers);
static int __write_cgroup_file(const char *cgroup_path, const char *file,
snprintf(file_path, sizeof(file_path), "%s/%s", cgroup_path, file);
char cgroup_path[PATH_MAX - 24];
format_cgroup_path(cgroup_path, relative_path);
return __write_cgroup_file(cgroup_path, file, buf);
char cgroup_path[PATH_MAX - 24];
format_parent_cgroup_path(cgroup_path, relative_path);
return __write_cgroup_file(cgroup_path, file, buf);
static int join_cgroup_from_top(const char *cgroup_path)
"%s/cgroup.procs", cgroup_path);
char cgroup_path[PATH_MAX + 1];
format_cgroup_path(cgroup_path, relative_path);
return join_cgroup_from_top(cgroup_path);
char cgroup_path[PATH_MAX + 1];
format_parent_cgroup_path(cgroup_path, relative_path);
return join_cgroup_from_top(cgroup_path);
char cgroup_path[PATH_MAX + 1];
format_cgroup_path(cgroup_path, relative_path);
return setxattr(cgroup_path, name, value, strlen(value) + 1, 0);
char cgroup_path[PATH_MAX + 1];
format_cgroup_path(cgroup_path, relative_path);
if (rmdir(cgroup_path))
log_err("rmdiring cgroup %s .. %s", relative_path, cgroup_path);
char cgroup_path[PATH_MAX + 1];
format_cgroup_path_pid(cgroup_path, relative_path, pid);
if (rmdir(cgroup_path))
log_err("rmdiring cgroup %s .. %s", relative_path, cgroup_path);
char cgroup_path[PATH_MAX + 1];
format_cgroup_path(cgroup_path, relative_path);
if (mkdir(cgroup_path, 0777) && errno != EEXIST) {
log_err("mkdiring cgroup %s .. %s", relative_path, cgroup_path);
fd = open(cgroup_path, O_RDONLY);
static int __enable_controllers(const char *cgroup_path, const char *controllers)
cgroup_path);
snprintf(path, sizeof(path), "%s/cgroup.subtree_control", cgroup_path);
static bool connect_send(const char *cgroup_path)
if (join_cgroup(cgroup_path))
char cgroup_path[MAX_PATH - strlen("/cgroup.procs")];
retval = find_mount("cgroup2", cgroup_path, sizeof(cgroup_path));
cg_path_len = strlen(cgroup_path);
retval = get_self_cgroup(&cgroup_path[cg_path_len],
sizeof(cgroup_path) - cg_path_len);
snprintf(&cgroup_path[cg_path_len],
sizeof(cgroup_path) - cg_path_len, "%s/", cgroup);
snprintf(cgroup_procs, MAX_PATH, "%s/cgroup.procs", cgroup_path);