Lines Matching defs:thread
13 #include "thread.h"
18 #include "thread-stack.h"
62 int db_export__thread(struct db_export *dbe, struct thread *thread,
63 struct machine *machine, struct thread *main_thread)
67 if (thread->db_id)
70 thread->db_id = ++dbe->thread_last_db_id;
76 return dbe->export_thread(dbe, thread, main_thread_db_id,
83 struct thread *thread)
88 return dbe->export_comm(dbe, comm, thread);
94 struct thread *thread)
99 return __db_export__comm(dbe, comm, thread);
105 * program. Note that the main thread pid (or thread group id tgid) cannot be
109 struct thread *main_thread)
121 * Record the main thread for this comm. Note that the main thread can
123 * exec's. An "exec" comm however will only ever have 1 main thread.
127 * db_export__comm_thread() is called here for the main thread, but it
134 struct thread *thread)
141 return dbe->export_comm_thread(dbe, db_id, comm, thread);
211 struct thread *thread,
229 err = thread__resolve_callchain(thread, &callchain_cursor, evsel,
254 al.maps = thread->maps;
290 static int db_export__threads(struct db_export *dbe, struct thread *thread,
291 struct thread *main_thread,
300 * A thread has a reference to the main thread, so export the
301 * main thread first.
307 * Export comm before exporting the non-main thread because
319 if (thread != main_thread) {
321 * For a non-main thread, db_export__comm_thread() must be
322 * called only if thread has not previously been exported.
324 bool export_comm_thread = comm && !thread->db_id;
326 err = db_export__thread(dbe, thread, machine, main_thread);
331 err = db_export__comm_thread(dbe, comm, thread);
337 curr_comm = thread__comm(thread);
339 return db_export__comm(dbe, curr_comm, thread);
348 struct thread *thread = al->thread;
355 struct thread *main_thread;
367 main_thread = thread__main_thread(al->maps->machine, thread);
369 err = db_export__threads(dbe, thread, main_thread, al->maps->machine, &comm);
384 thread, sample,
396 thread__resolve(thread, &addr_al, sample);
402 err = thread_stack__process(thread, comm, sample, al,
528 struct thread *thread = machine__find_thread(machine, pid, tid);
529 struct thread *main_thread;
532 if (!thread || !thread->comm_set)
535 *is_idle = !thread->pid_ && !thread->tid;
537 main_thread = thread__main_thread(machine, thread);
539 err = db_export__threads(dbe, thread, main_thread, machine, comm_ptr);
541 *db_id = thread->db_id;
545 thread__put(thread);