Lines Matching refs:pid
46 int pid; member
55 static struct proc* pid_lookup(int pid) { in pid_lookup() argument
60 for (procp = pidhash[pid_hashfn(pid)]; procp && procp->pid != pid; procp = procp->pidhash_next) in pid_lookup()
88 static int memory_stat_from_cgroup(struct memory_stat* mem_st, int pid, uid_t uid) { in memory_stat_from_cgroup() argument
92 snprintf(buf, sizeof(buf), MEMCG_PROCESS_MEMORY_STAT_PATH, uid, pid); in memory_stat_from_cgroup()
108 static int memory_stat_from_procfs(struct memory_stat* mem_st, int pid) { in memory_stat_from_procfs() argument
113 snprintf(path, sizeof(path), PROC_STAT_FILE_PATH, pid); in memory_stat_from_procfs()
143 struct memory_stat *stats_read_memory_stat(bool per_app_memcg, int pid, uid_t uid, in stats_read_memory_stat() argument
151 if (memory_stat_from_cgroup(&mem_st, pid, uid) == 0) { in stats_read_memory_stat()
155 if (memory_stat_from_procfs(&mem_st, pid) == 0) { in stats_read_memory_stat()
170 int hval = pid_hashfn(procp->pid); in proc_insert()
175 void stats_remove_taskname(int pid) { in stats_remove_taskname() argument
180 int hval = pid_hashfn(pid); in stats_remove_taskname()
184 for (procp = pidhash[hval], prevp = NULL; procp && procp->pid != pid; in stats_remove_taskname()
199 void stats_store_taskname(int pid, const char* taskname) { in stats_store_taskname() argument
204 struct proc* procp = pid_lookup(pid); in stats_store_taskname()
209 stats_remove_taskname(pid); in stats_store_taskname()
212 procp->pid = pid; in stats_store_taskname()
237 const char* stats_get_task_name(int pid) { in stats_get_task_name() argument
238 struct proc* proc = pid_lookup(pid); in stats_get_task_name()