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()
184 err = db_export__dso(dbe, dso, maps__machine(thread__maps(al->thread))); in db_ids_from_al()
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()
259 al.thread = thread__get(thread); in call_path_from_sample()
295 static int db_export__threads(struct db_export *dbe, struct thread *thread, in db_export__threads() argument
296 struct thread *main_thread, in db_export__threads()
305 * A thread has a reference to the main thread, so export the in db_export__threads()
306 * main thread first. in db_export__threads()
312 * Export comm before exporting the non-main thread because in db_export__threads()
324 if (thread != main_thread) { in db_export__threads()
326 * For a non-main thread, db_export__comm_thread() must be in db_export__threads()
327 * called only if thread has not previously been exported. in db_export__threads()
329 bool export_comm_thread = comm && !thread__db_id(thread); in db_export__threads()
331 err = db_export__thread(dbe, thread, machine, main_thread); in db_export__threads()
336 err = db_export__comm_thread(dbe, comm, thread); in db_export__threads()
342 curr_comm = thread__comm(thread); in db_export__threads()
344 return db_export__comm(dbe, curr_comm, thread); in db_export__threads()
353 struct thread *thread = al->thread; in db_export__sample() local
360 struct thread *main_thread; in db_export__sample()
365 if (thread__maps(thread)) in db_export__sample()
366 machine = maps__machine(thread__maps(thread)); in db_export__sample()
378 main_thread = thread__main_thread(machine, thread); in db_export__sample()
380 err = db_export__threads(dbe, thread, main_thread, machine, &comm); in db_export__sample()
395 thread, sample, in db_export__sample()
409 err = thread_stack__process(thread, comm, sample, al, in db_export__sample()
537 struct thread *thread = machine__find_thread(machine, pid, tid); in db_export__pid_tid() local
538 struct thread *main_thread; in db_export__pid_tid()
541 if (!thread || !thread__comm_set(thread)) in db_export__pid_tid()
544 *is_idle = !thread__pid(thread) && !thread__tid(thread); in db_export__pid_tid()
546 main_thread = thread__main_thread(machine, thread); in db_export__pid_tid()
548 err = db_export__threads(dbe, thread, main_thread, machine, comm_ptr); in db_export__pid_tid()
550 *db_id = thread__db_id(thread); in db_export__pid_tid()
554 thread__put(thread); in db_export__pid_tid()