Lines Matching refs:procp
64 struct proc* procp; in pid_lookup() local
68 for (procp = pidhash[pid_hashfn(pid)]; procp && procp->pid != pid; procp = procp->pidhash_next) in pid_lookup()
71 return procp; in pid_lookup()
210 static void proc_insert(struct proc* procp) { in proc_insert() argument
215 int hval = pid_hashfn(procp->pid); in proc_insert()
216 procp->pidhash_next = pidhash[hval]; in proc_insert()
217 pidhash[hval] = procp; in proc_insert()
226 struct proc* procp; in stats_remove_taskname() local
229 for (procp = pidhash[hval], prevp = NULL; procp && procp->pid != pid; in stats_remove_taskname()
230 procp = procp->pidhash_next) in stats_remove_taskname()
231 prevp = procp; in stats_remove_taskname()
233 if (!procp) in stats_remove_taskname()
237 pidhash[hval] = procp->pidhash_next; in stats_remove_taskname()
239 prevp->pidhash_next = procp->pidhash_next; in stats_remove_taskname()
241 free(procp); in stats_remove_taskname()
249 struct proc* procp = pid_lookup(pid); in stats_store_taskname() local
250 if (procp != NULL) { in stats_store_taskname()
251 if (strcmp(procp->taskname, taskname) == 0) { in stats_store_taskname()
256 procp = static_cast<struct proc*>(malloc(sizeof(struct proc))); in stats_store_taskname()
257 procp->pid = pid; in stats_store_taskname()
258 strncpy(procp->taskname, taskname, LINE_MAX - 1); in stats_store_taskname()
259 procp->taskname[LINE_MAX - 1] = '\0'; in stats_store_taskname()
260 proc_insert(procp); in stats_store_taskname()
268 struct proc* procp; in stats_purge_tasknames() local
272 procp = pidhash[i]; in stats_purge_tasknames()
273 while (procp) { in stats_purge_tasknames()
274 next = procp->pidhash_next; in stats_purge_tasknames()
275 free(procp); in stats_purge_tasknames()
276 procp = next; in stats_purge_tasknames()