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(thread))
70 thread__set_db_id(thread, ++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,
231 err = thread__resolve_callchain(thread, cursor, evsel,
257 al.maps = maps__get(thread__maps(thread));
294 static int db_export__threads(struct db_export *dbe, struct thread *thread,
295 struct thread *main_thread,
304 * A thread has a reference to the main thread, so export the
305 * main thread first.
311 * Export comm before exporting the non-main thread because
323 if (thread != main_thread) {
325 * For a non-main thread, db_export__comm_thread() must be
326 * called only if thread has not previously been exported.
328 bool export_comm_thread = comm && !thread__db_id(thread);
330 err = db_export__thread(dbe, thread, machine, main_thread);
335 err = db_export__comm_thread(dbe, comm, thread);
341 curr_comm = thread__comm(thread);
343 return db_export__comm(dbe, curr_comm, thread);
352 struct thread *thread = al->thread;
359 struct thread *main_thread;
373 main_thread = thread__main_thread(machine, thread);
375 err = db_export__threads(dbe, thread, main_thread, machine, &comm);
390 thread, sample,
404 err = thread_stack__process(thread, comm, sample, al,
532 struct thread *thread = machine__find_thread(machine, pid, tid);
533 struct thread *main_thread;
536 if (!thread || !thread__comm_set(thread))
539 *is_idle = !thread__pid(thread) && !thread__tid(thread);
541 main_thread = thread__main_thread(machine, thread);
543 err = db_export__threads(dbe, thread, main_thread, machine, comm_ptr);
545 *db_id = thread__db_id(thread);
549 thread__put(thread);