Lines Matching refs:thread
17 static void __machine__remove_thread(struct machine *machine, struct thread *th, bool lock);
52 struct thread *thread = machine__findnew_thread(machine, -1, in machine__init() local
56 if (thread == NULL) in machine__init()
60 thread__set_comm(thread, comm, 0); in machine__init()
61 thread__put(thread); in machine__init()
115 struct thread *t = rb_entry(nd, struct thread, rb_node); in machine__delete_threads()
313 struct thread *th, pid_t pid) in machine__update_thread_pid()
315 struct thread *leader; in machine__update_thread_pid()
358 static struct thread *____machine__findnew_thread(struct machine *machine, in ____machine__findnew_thread()
364 struct thread *th; in ____machine__findnew_thread()
383 th = rb_entry(parent, struct thread, rb_node); in ____machine__findnew_thread()
429 struct thread *__machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid) in __machine__findnew_thread()
434 struct thread *machine__findnew_thread(struct machine *machine, pid_t pid, in machine__findnew_thread()
437 struct thread *th; in machine__findnew_thread()
445 struct thread *machine__find_thread(struct machine *machine, pid_t pid, in machine__find_thread()
448 struct thread *th; in machine__find_thread()
456 struct thread *thread) in machine__thread_exec_comm() argument
459 return thread__exec_comm(thread); in machine__thread_exec_comm()
461 return thread__comm(thread); in machine__thread_exec_comm()
467 struct thread *thread = machine__findnew_thread(machine, in machine__process_comm_event() local
479 if (thread == NULL || in machine__process_comm_event()
480 __thread__set_comm(thread, event->comm.comm, sample->time, exec)) { in machine__process_comm_event()
485 thread__put(thread); in machine__process_comm_event()
652 struct thread *pos = rb_entry(nd, struct thread, rb_node); in machine__fprintf()
1262 struct thread *thread; in machine__process_mmap2_event() local
1278 thread = machine__findnew_thread(machine, event->mmap2.pid, in machine__process_mmap2_event()
1280 if (thread == NULL) in machine__process_mmap2_event()
1295 event->mmap2.filename, type, thread); in machine__process_mmap2_event()
1300 thread__insert_map(thread, map); in machine__process_mmap2_event()
1301 thread__put(thread); in machine__process_mmap2_event()
1306 thread__put(thread); in machine__process_mmap2_event()
1316 struct thread *thread; in machine__process_mmap_event() local
1332 thread = machine__findnew_thread(machine, event->mmap.pid, in machine__process_mmap_event()
1334 if (thread == NULL) in machine__process_mmap_event()
1346 type, thread); in machine__process_mmap_event()
1351 thread__insert_map(thread, map); in machine__process_mmap_event()
1352 thread__put(thread); in machine__process_mmap_event()
1357 thread__put(thread); in machine__process_mmap_event()
1363 static void __machine__remove_thread(struct machine *machine, struct thread *th, bool lock) in __machine__remove_thread()
1384 void machine__remove_thread(struct machine *machine, struct thread *th) in machine__remove_thread()
1392 struct thread *thread = machine__find_thread(machine, in machine__process_fork_event() local
1395 struct thread *parent = machine__findnew_thread(machine, in machine__process_fork_event()
1419 if (thread != NULL) { in machine__process_fork_event()
1420 machine__remove_thread(machine, thread); in machine__process_fork_event()
1421 thread__put(thread); in machine__process_fork_event()
1424 thread = machine__findnew_thread(machine, event->fork.pid, in machine__process_fork_event()
1427 if (thread == NULL || parent == NULL || in machine__process_fork_event()
1428 thread__fork(thread, parent, sample->time) < 0) { in machine__process_fork_event()
1432 thread__put(thread); in machine__process_fork_event()
1441 struct thread *thread = machine__find_thread(machine, in machine__process_exit_event() local
1448 if (thread != NULL) { in machine__process_exit_event()
1449 thread__exited(thread); in machine__process_exit_event()
1450 thread__put(thread); in machine__process_exit_event()
1498 static void ip__resolve_ams(struct thread *thread, in ip__resolve_ams() argument
1512 thread__find_cpumode_addr_location(thread, MAP__FUNCTION, ip, &al); in ip__resolve_ams()
1520 static void ip__resolve_data(struct thread *thread, in ip__resolve_data() argument
1527 thread__find_addr_location(thread, m, MAP__VARIABLE, addr, &al); in ip__resolve_data()
1534 thread__find_addr_location(thread, m, MAP__FUNCTION, addr, &al); in ip__resolve_data()
1551 ip__resolve_ams(al->thread, &mi->iaddr, sample->ip); in sample__resolve_mem()
1552 ip__resolve_data(al->thread, al->cpumode, &mi->daddr, sample->addr); in sample__resolve_mem()
1558 static int add_callchain_ip(struct thread *thread, in add_callchain_ip() argument
1569 thread__find_cpumode_addr_location(thread, MAP__FUNCTION, in add_callchain_ip()
1595 thread__find_addr_location(thread, *cpumode, MAP__FUNCTION, in add_callchain_ip()
1626 ip__resolve_ams(al->thread, &bi[i].to, bs->entries[i].to); in sample__resolve_bstack()
1627 ip__resolve_ams(al->thread, &bi[i].from, bs->entries[i].from); in sample__resolve_bstack()
1681 static int resolve_lbr_callchain_sample(struct thread *thread, in resolve_lbr_callchain_sample() argument
1736 err = add_callchain_ip(thread, parent, root_al, &cpumode, ip); in resolve_lbr_callchain_sample()
1746 static int thread__resolve_callchain_sample(struct thread *thread, in thread__resolve_callchain_sample() argument
1764 err = resolve_lbr_callchain_sample(thread, sample, parent, in thread__resolve_callchain_sample()
1775 skip_idx = arch_skip_callchain_idx(thread, chain); in thread__resolve_callchain_sample()
1821 err = add_callchain_ip(thread, parent, root_al, in thread__resolve_callchain_sample()
1824 err = add_callchain_ip(thread, parent, root_al, in thread__resolve_callchain_sample()
1854 err = add_callchain_ip(thread, parent, root_al, &cpumode, ip); in thread__resolve_callchain_sample()
1870 int thread__resolve_callchain(struct thread *thread, in thread__resolve_callchain() argument
1877 int ret = thread__resolve_callchain_sample(thread, evsel, in thread__resolve_callchain()
1894 thread, sample, max_stack); in thread__resolve_callchain()
1899 int (*fn)(struct thread *thread, void *p), in machine__for_each_thread() argument
1903 struct thread *thread; in machine__for_each_thread() local
1907 thread = rb_entry(nd, struct thread, rb_node); in machine__for_each_thread()
1908 rc = fn(thread, priv); in machine__for_each_thread()
1913 list_for_each_entry(thread, &machine->dead_threads, node) { in machine__for_each_thread()
1914 rc = fn(thread, priv); in machine__for_each_thread()
1922 int (*fn)(struct thread *thread, void *p), in machines__for_each_thread() argument
1966 struct thread *thread; in machine__set_current_tid() local
1989 thread = machine__findnew_thread(machine, pid, tid); in machine__set_current_tid()
1990 if (!thread) in machine__set_current_tid()
1993 thread->cpu = cpu; in machine__set_current_tid()
1994 thread__put(thread); in machine__set_current_tid()