Lines Matching defs:proc_entry
281 * Return: True if the proc_entry contains a comm file with comm_prefix*.
284 static int procfs_is_workload_pid(const char *comm_prefix, struct dirent *proc_entry)
290 if (proc_entry->d_type != DT_DIR)
293 if (*proc_entry->d_name == '.')
297 for (t_name = proc_entry->d_name; t_name; t_name++) {
305 snprintf(buffer, MAX_PATH, "/proc/%s/comm", proc_entry->d_name);
324 debug_msg("Found workload pid:%s comm:%s", proc_entry->d_name, buffer);
339 struct dirent *proc_entry;
356 while ((proc_entry = readdir(procfs))) {
358 retval = procfs_is_workload_pid(comm_prefix, proc_entry);
362 if (strtoi(proc_entry->d_name, &pid)) {
363 err_msg("'%s' is not a valid pid", proc_entry->d_name);
369 err_msg("Error setting sched attributes for pid:%s\n", proc_entry->d_name);
373 debug_msg("Set sched attributes for pid:%s\n", proc_entry->d_name);
888 struct dirent *proc_entry;
909 while ((proc_entry = readdir(procfs))) {
911 retval = procfs_is_workload_pid(comm_prefix, proc_entry);
915 retval = write(cg_fd, proc_entry->d_name, strlen(proc_entry->d_name));
918 proc_entry->d_name, strerror(errno));
922 debug_msg("Set cgroup attributes for pid:%s\n", proc_entry->d_name);