Lines Matching refs:proc
3 * Parsing of /proc/#pid
30 * @param proc process to add map to
35 * and add the info to the process @proc. Returns %1
43 static int opd_add_ascii_map(struct opd_proc * proc, char const * line,
75 image = opd_get_image(cp, image_name, 0, proc->tid, proc->tgid);
79 opd_add_mapping(proc, image, start, offset, end);
87 * @param proc process to work on
89 * Read the /proc/<pid>/maps file and add all
90 * mapping information found to the process @proc.
92 static void opd_get_ascii_maps(struct opd_proc * proc)
95 char mapsfile[20] = "/proc/";
101 snprintf(mapsfile + 6, 6, "%hu", proc->tid);
117 verbprintf(vmisc, "image name %s for pid %u %u\n", image_name, proc->tid, proc->tgid);
124 opd_add_ascii_map(proc, line, image_name);
129 * is always true at exec time but not for /proc/pid so restore
132 list_for_each(pos, &proc->maps) {
135 if (pos != proc->maps.next) {
136 fprintf(stderr, "swap map for image %s from %s to %s\n", image_name, proc->name, map->image->name);
137 free((char *)proc->name);
138 proc->name = xstrdup(map->image->name);
144 if (list_empty(&proc->maps)) {
145 /* we always need a valid proc->maps[0], we artificially give
148 * thread when adding vmlinux and module maps to proc->maps[]
150 /* FIXME: use the first field of /proc/pid/status as proc name
151 * for now we use /proc/%pid/exe as name */
153 image_name, 0, proc->tid, proc->tgid);
155 opd_add_mapping(proc, image, 0, 0, 0);
167 char status_file[30] = "/proc/";
203 struct opd_proc * proc;
206 if (!(dir = opendir("/proc"))) {
207 perror("oprofiled: /proc directory could not be opened. ");
215 proc = opd_get_proc(pid, tgid);
216 if (!proc)
217 proc = opd_new_proc(pid, tgid);
218 opd_get_ascii_maps(proc);