Lines Matching refs:proc

70 	struct opd_proc * proc;
73 proc = xmalloc(sizeof(struct opd_proc));
74 list_init(&proc->maps);
75 proc->name = NULL;
76 proc->tid = tid;
77 proc->tgid = tgid;
78 proc->dead = 0;
79 proc->accessed = 0;
80 list_add(&proc->next, &opd_procs[proc_hash(tid)]);
81 return proc;
87 struct opd_proc * proc;
94 proc = list_entry(pos, struct opd_proc, next);
95 if (tid == proc->tid && tgid == proc->tgid) {
97 list_del(&proc->next);
98 list_add(&proc->next, &opd_procs[hash]);
99 return proc;
157 * opd_lookup_maps - lookup a proc mappings for a sample
158 * @param proc proc to lookup
161 * iterate through the proc maps searching the mapping which owns sample
164 static int opd_lookup_maps(struct opd_proc * proc,
169 proc->accessed = 1;
172 list_for_each(pos, &proc->maps) {
192 struct opd_proc * proc;
205 if (!(proc = opd_get_proc(sample->pid, sample->tgid))) {
208 * a proc so on we fall back to put sample in vmlinux
215 verbprintf(vmisc, "No proc info for tgid %.6d pid %.6d.\n",
222 if (opd_lookup_maps(proc, sample))
226 opd_add_kernel_map(proc, sample->eip);
227 if (opd_lookup_maps(proc, sample))
241 struct opd_proc * proc;
261 proc = opd_new_proc(note->addr, note->len);
270 opd_add_mapping(proc, map->image, map->start,
279 opd_add_mapping(proc, image, map->start, map->offset,
288 struct opd_proc * proc;
305 proc = opd_get_proc(tid, tgid);
306 if (proc) {
307 opd_kill_maps(proc);
308 /* proc->name will be set when the next mapping occurs */
309 free((char *)proc->name);
310 proc->name = NULL;
319 struct opd_proc * proc;
323 proc = opd_get_proc(note->pid, note->tgid);
324 if (proc) {
325 proc->dead = 1;
326 proc->accessed = 1;
328 verbprintf(vmisc, "unknown proc %u just exited.\n", note->pid);
336 * @param proc_cb callback to apply onto each existing proc struct
339 * allowed to freeze the proc struct itself.
349 struct opd_proc * proc =
351 proc_cb(proc);
359 * @param proc process to delete
361 * Remove the process proc from the process list and free
364 static void opd_delete_proc(struct opd_proc * proc)
367 list_del(&proc->next);
368 opd_kill_maps(proc);
369 if (proc->name)
370 free((char *)proc->name);
371 free(proc);
383 * @param proc proc to age
385 * age dead proc in such way if a proc doesn't receive any samples
388 static void opd_age_proc(struct opd_proc * proc)
391 if (proc->dead) {
392 proc->dead += proc->accessed;
393 proc->accessed = 0;
394 if (--proc->dead == 0)
395 opd_delete_proc(proc);
408 * @param proc proc where mappings must be updated.
412 * sample in proc struct.
414 static void opd_remove_kernel_mapping(struct opd_proc * proc)
418 list_for_each_safe(pos, pos2, &proc->maps) {