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