Lines Matching refs:path

63 bool CgroupGetControllerPath(const std::string& cgroup_name, std::string* path) {  in CgroupGetControllerPath()  argument
70 if (path) { in CgroupGetControllerPath()
71 *path = controller.path(); in CgroupGetControllerPath()
77 static bool CgroupGetMemcgAppsPath(std::string* path) { in CgroupGetMemcgAppsPath() argument
84 if (path) { in CgroupGetMemcgAppsPath()
85 *path = controller.path(); in CgroupGetMemcgAppsPath()
87 *path += "/apps"; in CgroupGetMemcgAppsPath()
94 bool CgroupGetControllerFromPath(const std::string& path, std::string* cgroup_name) { in CgroupGetControllerFromPath() argument
95 auto controller = CgroupMap::GetInstance().FindControllerByPath(path); in CgroupGetControllerFromPath()
108 bool CgroupGetAttributePath(const std::string& attr_name, std::string* path) { in CgroupGetAttributePath() argument
116 if (path) { in CgroupGetAttributePath()
117 *path = StringPrintf("%s/%s", attr->controller()->path(), attr->file_name().c_str()); in CgroupGetAttributePath()
123 bool CgroupGetAttributePathForTask(const std::string& attr_name, int tid, std::string* path) { in CgroupGetAttributePathForTask() argument
131 if (!attr->GetPathForTask(tid, path)) { in CgroupGetAttributePathForTask()
244 auto path = StringPrintf("%s/%s", uid_path.c_str(), dir->d_name); in RemoveUidProcessGroups() local
247 auto procs_file = StringPrintf("%s/%s", path.c_str(), in RemoveUidProcessGroups()
255 LOG(VERBOSE) << "Skipping non-empty group " << path; in RemoveUidProcessGroups()
260 LOG(VERBOSE) << "Removing " << path; in RemoveUidProcessGroups()
261 if (rmdir(path.c_str()) == -1) { in RemoveUidProcessGroups()
263 PLOG(WARNING) << "Failed to remove " << path; in RemoveUidProcessGroups()
274 std::string path, memcg_apps_path; in removeAllProcessGroupsInternal() local
276 if (CgroupGetControllerPath(CGROUPV2_CONTROLLER_NAME, &path)) { in removeAllProcessGroupsInternal()
277 cgroups.push_back(path); in removeAllProcessGroupsInternal()
279 if (CgroupGetMemcgAppsPath(&memcg_apps_path) && memcg_apps_path != path) { in removeAllProcessGroupsInternal()
298 auto path = StringPrintf("%s/%s", cgroup_root_path.c_str(), dir->d_name); in removeAllProcessGroupsInternal() local
299 if (!RemoveUidProcessGroups(path, empty_only)) { in removeAllProcessGroupsInternal()
300 LOG(VERBOSE) << "Skip removing " << path; in removeAllProcessGroupsInternal()
303 LOG(VERBOSE) << "Removing " << path; in removeAllProcessGroupsInternal()
304 if (rmdir(path.c_str()) == -1 && errno != EBUSY) { in removeAllProcessGroupsInternal()
305 PLOG(WARNING) << "Failed to remove " << path; in removeAllProcessGroupsInternal()
327 static bool MkdirAndChown(const std::string& path, mode_t mode, uid_t uid, gid_t gid) { in MkdirAndChown() argument
328 if (mkdir(path.c_str(), mode) == -1) { in MkdirAndChown()
336 auto dir = std::unique_ptr<DIR, decltype(&closedir)>(opendir(path.c_str()), closedir); in MkdirAndChown()
339 PLOG(ERROR) << "opendir failed for " << path; in MkdirAndChown()
349 std::string file_path = path + "/" + dir_entry->d_name; in MkdirAndChown()
365 rmdir(path.c_str()); in MkdirAndChown()
385 auto path = ConvertUidPidToPath(cgroup, uid, initialPid) + PROCESSGROUP_CGROUP_PROCS_FILE; in DoKillProcessGroupOnce() local
386 fd.reset(fopen(path.c_str(), "re")); in DoKillProcessGroupOnce()
632 std::string path; in SetProcessGroupValue() local
633 if (!CgroupGetAttributePathForTask(attr_name, tid, &path)) { in SetProcessGroupValue()
638 if (!WriteStringToFile(std::to_string(value), path)) { in SetProcessGroupValue()
639 PLOG(ERROR) << "Failed to write '" << value << "' to " << path; in SetProcessGroupValue()
657 bool getAttributePathForTask(const std::string& attr_name, int tid, std::string* path) { in getAttributePathForTask() argument
658 return CgroupGetAttributePathForTask(attr_name, tid, path); in getAttributePathForTask()