Lines Matching full:thread

13 #include "thread.h"
18 #include "thread-stack.h"
62 int db_export__thread(struct db_export *dbe, struct thread *thread, in db_export__thread() argument
63 struct machine *machine, struct thread *main_thread) in db_export__thread()
67 if (thread__db_id(thread)) in db_export__thread()
70 thread__set_db_id(thread, ++dbe->thread_last_db_id); in db_export__thread()
76 return dbe->export_thread(dbe, thread, main_thread_db_id, in db_export__thread()
83 struct thread *thread) in __db_export__comm() argument
88 return dbe->export_comm(dbe, comm, thread); in __db_export__comm()
94 struct thread *thread) in db_export__comm() argument
99 return __db_export__comm(dbe, comm, thread); in db_export__comm()
105 * program. Note that the main thread pid (or thread group id tgid) cannot be
109 struct thread *main_thread) in db_export__exec_comm()
121 * Record the main thread for this comm. Note that the main thread can in db_export__exec_comm()
123 * exec's. An "exec" comm however will only ever have 1 main thread. in db_export__exec_comm()
127 * db_export__comm_thread() is called here for the main thread, but it in db_export__exec_comm()
134 struct thread *thread) in db_export__comm_thread() argument
141 return dbe->export_comm_thread(dbe, db_id, comm, thread); in db_export__comm_thread()
211 struct thread *thread, in call_path_from_sample() argument
231 err = thread__resolve_callchain(thread, cursor, evsel, in call_path_from_sample()
257 al.maps = maps__get(thread__maps(thread)); in call_path_from_sample()
294 static int db_export__threads(struct db_export *dbe, struct thread *thread, in db_export__threads() argument
295 struct thread *main_thread, in db_export__threads()
304 * A thread has a reference to the main thread, so export the in db_export__threads()
305 * main thread first. in db_export__threads()
311 * Export comm before exporting the non-main thread because in db_export__threads()
323 if (thread != main_thread) { in db_export__threads()
325 * For a non-main thread, db_export__comm_thread() must be in db_export__threads()
326 * called only if thread has not previously been exported. in db_export__threads()
328 bool export_comm_thread = comm && !thread__db_id(thread); in db_export__threads()
330 err = db_export__thread(dbe, thread, machine, main_thread); in db_export__threads()
335 err = db_export__comm_thread(dbe, comm, thread); in db_export__threads()
341 curr_comm = thread__comm(thread); in db_export__threads()
343 return db_export__comm(dbe, curr_comm, thread); in db_export__threads()
352 struct thread *thread = al->thread; in db_export__sample() local
359 struct thread *main_thread; in db_export__sample()
373 main_thread = thread__main_thread(machine, thread); in db_export__sample()
375 err = db_export__threads(dbe, thread, main_thread, machine, &comm); in db_export__sample()
390 thread, sample, in db_export__sample()
404 err = thread_stack__process(thread, comm, sample, al, in db_export__sample()
532 struct thread *thread = machine__find_thread(machine, pid, tid); in db_export__pid_tid() local
533 struct thread *main_thread; in db_export__pid_tid()
536 if (!thread || !thread__comm_set(thread)) in db_export__pid_tid()
539 *is_idle = !thread__pid(thread) && !thread__tid(thread); in db_export__pid_tid()
541 main_thread = thread__main_thread(machine, thread); in db_export__pid_tid()
543 err = db_export__threads(dbe, thread, main_thread, machine, comm_ptr); in db_export__pid_tid()
545 *db_id = thread__db_id(thread); in db_export__pid_tid()
549 thread__put(thread); in db_export__pid_tid()