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);
110 snprintf(path, sizeof(path), "/proc/%d/task", pid);
171 struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid)
173 if (pid != -1)
174 return thread_map__new_by_pid(pid);
189 pid_t pid, prev_pid = INT_MAX;
199 pid = strtol(pos->s, &end_ptr, 10);
201 if (pid == INT_MIN || pid == INT_MAX ||
205 if (pid == prev_pid)
208 sprintf(name, "/proc/%d/task", pid);
293 struct perf_thread_map *thread_map__new_str(const char *pid, const char *tid,
296 if (pid)
297 return thread_map__new_by_pid_str(pid);
319 static int get_comm(char **comm, pid_t pid)
325 if (asprintf(&path, "%s/%d/comm", procfs__mountpoint(), pid) == -1)
345 pid_t pid = perf_thread_map__pid(map, i);
348 /* dummy pid comm initialization */
349 if (pid == -1) {
358 if (get_comm(&comm, pid))
359 pr_warning("Couldn't resolve comm name for pid %d\n", pid);
380 perf_thread_map__set_pid(threads, i, (pid_t) event->entries[i].pid);
398 bool thread_map__has(struct perf_thread_map *threads, pid_t pid)
403 if (threads->map[i].pid == pid)