Lines Matching refs:pid
33 struct perf_thread_map *thread_map__new_by_pid(pid_t pid) in thread_map__new_by_pid() argument
41 sprintf(name, "/proc/%d/task", pid); in thread_map__new_by_pid()
95 pid_t pid = strtol(dirent->d_name, &end, 10); in __thread_map__new_all_cpus() local
109 snprintf(path, sizeof(path), "/proc/%d/task", pid); in __thread_map__new_all_cpus()
170 struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid) in thread_map__new() argument
172 if (pid != -1) in thread_map__new()
173 return thread_map__new_by_pid(pid); in thread_map__new()
188 pid_t pid, prev_pid = INT_MAX; in thread_map__new_by_pid_str() local
198 pid = strtol(pos->s, &end_ptr, 10); in thread_map__new_by_pid_str()
200 if (pid == INT_MIN || pid == INT_MAX || in thread_map__new_by_pid_str()
204 if (pid == prev_pid) in thread_map__new_by_pid_str()
207 sprintf(name, "/proc/%d/task", pid); in thread_map__new_by_pid_str()
292 struct perf_thread_map *thread_map__new_str(const char *pid, const char *tid, in thread_map__new_str() argument
295 if (pid) in thread_map__new_str()
296 return thread_map__new_by_pid_str(pid); in thread_map__new_str()
318 static int get_comm(char **comm, pid_t pid) in get_comm() argument
324 if (asprintf(&path, "%s/%d/comm", procfs__mountpoint(), pid) == -1) in get_comm()
344 pid_t pid = perf_thread_map__pid(map, i); in comm_init() local
348 if (pid == -1) { in comm_init()
357 if (get_comm(&comm, pid)) in comm_init()
358 pr_warning("Couldn't resolve comm name for pid %d\n", pid); in comm_init()
379 perf_thread_map__set_pid(threads, i, (pid_t) event->entries[i].pid); in thread_map__copy_event()
397 bool thread_map__has(struct perf_thread_map *threads, pid_t pid) in thread_map__has() argument
402 if (threads->map[i].pid == pid) in thread_map__has()