Lines Matching refs:threads
63 struct threads *threads = &machine->threads[i]; in machine__threads_init() local
64 threads->entries = RB_ROOT_CACHED; in machine__threads_init()
65 init_rwsem(&threads->lock); in machine__threads_init()
66 threads->nr = 0; in machine__threads_init()
67 INIT_LIST_HEAD(&threads->dead); in machine__threads_init()
68 threads->last_match = NULL; in machine__threads_init()
200 struct threads *threads = &machine->threads[i]; in machine__delete_threads() local
201 down_write(&threads->lock); in machine__delete_threads()
202 nd = rb_first_cached(&threads->entries); in machine__delete_threads()
209 up_write(&threads->lock); in machine__delete_threads()
229 struct threads *threads = &machine->threads[i]; in machine__exit() local
239 list_for_each_entry_safe(thread, n, &threads->dead, node) in machine__exit()
242 exit_rwsem(&threads->lock); in machine__exit()
461 __threads__get_last_match(struct threads *threads, struct machine *machine, in __threads__get_last_match() argument
466 th = threads->last_match; in __threads__get_last_match()
473 threads->last_match = NULL; in __threads__get_last_match()
480 threads__get_last_match(struct threads *threads, struct machine *machine, in threads__get_last_match() argument
486 th = __threads__get_last_match(threads, machine, pid, tid); in threads__get_last_match()
492 __threads__set_last_match(struct threads *threads, struct thread *th) in __threads__set_last_match() argument
494 threads->last_match = th; in __threads__set_last_match()
498 threads__set_last_match(struct threads *threads, struct thread *th) in threads__set_last_match() argument
501 __threads__set_last_match(threads, th); in threads__set_last_match()
509 struct threads *threads, in ____machine__findnew_thread() argument
513 struct rb_node **p = &threads->entries.rb_root.rb_node; in ____machine__findnew_thread()
518 th = threads__get_last_match(threads, machine, pid, tid); in ____machine__findnew_thread()
527 threads__set_last_match(threads, th); in ____machine__findnew_thread()
546 rb_insert_color_cached(&th->rb_node, &threads->entries, leftmost); in ____machine__findnew_thread()
556 rb_erase_cached(&th->rb_node, &threads->entries); in ____machine__findnew_thread()
565 threads__set_last_match(threads, th); in ____machine__findnew_thread()
566 ++threads->nr; in ____machine__findnew_thread()
580 struct threads *threads = machine__threads(machine, tid); in machine__findnew_thread() local
583 down_write(&threads->lock); in machine__findnew_thread()
585 up_write(&threads->lock); in machine__findnew_thread()
592 struct threads *threads = machine__threads(machine, tid); in machine__find_thread() local
595 down_read(&threads->lock); in machine__find_thread()
596 th = ____machine__findnew_thread(machine, threads, pid, tid, false); in machine__find_thread()
597 up_read(&threads->lock); in machine__find_thread()
985 struct threads *threads = &machine->threads[i]; in machine__fprintf() local
987 down_read(&threads->lock); in machine__fprintf()
989 ret = fprintf(fp, "Threads: %u\n", threads->nr); in machine__fprintf()
991 for (nd = rb_first_cached(&threads->entries); nd; in machine__fprintf()
998 up_read(&threads->lock); in machine__fprintf()
1882 struct threads *threads = machine__threads(machine, th->tid); in __machine__remove_thread() local
1884 if (threads->last_match == th) in __machine__remove_thread()
1885 threads__set_last_match(threads, NULL); in __machine__remove_thread()
1888 down_write(&threads->lock); in __machine__remove_thread()
1892 rb_erase_cached(&th->rb_node, &threads->entries); in __machine__remove_thread()
1894 --threads->nr; in __machine__remove_thread()
1900 list_add_tail(&th->node, &threads->dead); in __machine__remove_thread()
1910 up_write(&threads->lock); in __machine__remove_thread()
2988 struct threads *threads; in machine__for_each_thread() local
2995 threads = &machine->threads[i]; in machine__for_each_thread()
2996 for (nd = rb_first_cached(&threads->entries); nd; in machine__for_each_thread()
3004 list_for_each_entry(thread, &threads->dead, node) { in machine__for_each_thread()