Lines Matching defs:pid
34 struct perf_thread_map *thread_map__new_by_pid(pid_t pid)
42 sprintf(name, "/proc/%d/task", pid);
96 pid_t pid = strtol(dirent->d_name, &end, 10);
101 snprintf(path, sizeof(path), "/proc/%d/task", pid);
104 pr_debug("scandir for %d returned empty, skipping\n", pid);
151 struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid)
153 if (pid != -1)
154 return thread_map__new_by_pid(pid);
166 pid_t pid, prev_pid = INT_MAX;
174 pid = strtol(pos->s, NULL, 10);
176 if (pid == INT_MIN || pid == INT_MAX)
179 if (pid == prev_pid)
182 sprintf(name, "/proc/%d/task", pid);
264 struct perf_thread_map *thread_map__new_str(const char *pid, const char *tid, bool all_threads)
266 if (pid)
267 return thread_map__new_by_pid_str(pid);
286 static int get_comm(char **comm, pid_t pid)
292 if (asprintf(&path, "%s/%d/comm", procfs__mountpoint(), pid) == -1)
312 pid_t pid = perf_thread_map__pid(map, i);
315 /* dummy pid comm initialization */
316 if (pid == -1) {
325 if (get_comm(&comm, pid))
326 pr_warning("Couldn't resolve comm name for pid %d\n", pid);
347 perf_thread_map__set_pid(threads, i, (pid_t) event->entries[i].pid);
365 bool thread_map__has(struct perf_thread_map *threads, pid_t pid)
370 if (threads->map[i].pid == pid)