Lines Matching defs:cgroup

561  * get_self_cgroup - get the current thread cgroup path
563 * Parse /proc/$$/cgroup file to get the thread's cgroup. As an example of line to parse:
576 snprintf(path, MAX_PATH, "/proc/%d/cgroup", getpid());
624 * set_comm_cgroup - Set cgroup to pid_t pid
626 * If cgroup argument is not NULL, the threads will move to the given cgroup.
627 * Otherwise, the cgroup of the calling, i.e., rtla, thread will be used.
629 * Supports cgroup v2.
633 int set_pid_cgroup(pid_t pid, const char *cgroup)
635 char cgroup_path[MAX_PATH - strlen("/cgroup.procs")];
647 if (!cgroup) {
651 err_msg("Did not find self cgroup\n");
656 sizeof(cgroup_path) - strlen(cgroup_path), "%s/", cgroup);
659 snprintf(cgroup_procs, MAX_PATH, "%s/cgroup.procs", cgroup_path);
661 debug_msg("Using cgroup path at: %s\n", cgroup_procs);
671 err_msg("Error setting cgroup attributes for pid:%s - %s\n",
674 debug_msg("Set cgroup attributes for pid:%s\n", pid_str);
682 * set_comm_cgroup - Set cgroup to threads starting with char *comm_prefix
684 * If cgroup argument is not NULL, the threads will move to the given cgroup.
685 * Otherwise, the cgroup of the calling, i.e., rtla, thread will be used.
687 * Supports cgroup v2.
691 int set_comm_cgroup(const char *comm_prefix, const char *cgroup)
693 char cgroup_path[MAX_PATH - strlen("/cgroup.procs")];
712 if (!cgroup) {
716 err_msg("Did not find self cgroup\n");
721 sizeof(cgroup_path) - strlen(cgroup_path), "%s/", cgroup);
724 snprintf(cgroup_procs, MAX_PATH, "%s/cgroup.procs", cgroup_path);
726 debug_msg("Using cgroup path at: %s\n", cgroup_procs);
746 err_msg("Error setting cgroup attributes for pid:%s - %s\n",
751 debug_msg("Set cgroup attributes for pid:%s\n", proc_entry->d_name);