Lines Matching refs:th

294 				       struct thread *th, pid_t pid)  in machine__update_thread_pid()  argument
298 if (pid == th->pid_ || pid == -1 || th->pid_ != -1) in machine__update_thread_pid()
301 th->pid_ = pid; in machine__update_thread_pid()
303 if (th->pid_ == th->tid) in machine__update_thread_pid()
306 leader = machine__findnew_thread(machine, th->pid_, th->pid_); in machine__update_thread_pid()
316 if (th->mg == leader->mg) in machine__update_thread_pid()
319 if (th->mg) { in machine__update_thread_pid()
325 if (!map_groups__empty(th->mg)) in machine__update_thread_pid()
327 th->pid_, th->tid); in machine__update_thread_pid()
328 map_groups__delete(th->mg); in machine__update_thread_pid()
331 th->mg = map_groups__get(leader->mg); in machine__update_thread_pid()
336 pr_err("Failed to join map groups for %d:%d\n", th->pid_, th->tid); in machine__update_thread_pid()
345 struct thread *th; in __machine__findnew_thread() local
352 th = machine->last_match; in __machine__findnew_thread()
353 if (th != NULL) { in __machine__findnew_thread()
354 if (th->tid == tid) { in __machine__findnew_thread()
355 machine__update_thread_pid(machine, th, pid); in __machine__findnew_thread()
356 return th; in __machine__findnew_thread()
364 th = rb_entry(parent, struct thread, rb_node); in __machine__findnew_thread()
366 if (th->tid == tid) { in __machine__findnew_thread()
367 machine->last_match = thread__get(th); in __machine__findnew_thread()
368 machine__update_thread_pid(machine, th, pid); in __machine__findnew_thread()
369 return th; in __machine__findnew_thread()
372 if (tid < th->tid) in __machine__findnew_thread()
381 th = thread__new(pid, tid); in __machine__findnew_thread()
382 if (th != NULL) { in __machine__findnew_thread()
383 rb_link_node(&th->rb_node, parent, p); in __machine__findnew_thread()
384 rb_insert_color(&th->rb_node, &machine->threads); in __machine__findnew_thread()
394 if (thread__init_map_groups(th, machine)) { in __machine__findnew_thread()
395 rb_erase(&th->rb_node, &machine->threads); in __machine__findnew_thread()
396 thread__delete(th); in __machine__findnew_thread()
402 thread__get(th); in __machine__findnew_thread()
403 machine->last_match = thread__get(th); in __machine__findnew_thread()
406 return th; in __machine__findnew_thread()
1257 void machine__remove_thread(struct machine *machine, struct thread *th) in machine__remove_thread() argument
1259 if (machine->last_match == th) in machine__remove_thread()
1262 rb_erase(&th->rb_node, &machine->threads); in machine__remove_thread()
1268 list_add_tail(&th->node, &machine->dead_threads); in machine__remove_thread()
1269 thread__put(th); in machine__remove_thread()