Lines Matching refs:tid
134 static void dump_fault_addr(log_t* log, pid_t tid, int sig)
139 if(ptrace(PTRACE_GETSIGINFO, tid, 0, &si)){
152 static void dump_thread_info(log_t* log, pid_t pid, pid_t tid, bool at_fault) {
158 snprintf(path, sizeof(path), "/proc/%d/comm", tid);
180 _LOG(log, false, "pid: %d, tid: %d, name: %s >>> %s <<<\n", pid, tid,
184 _LOG(log, true, "pid: %d, tid: %d, name: %s\n", pid, tid,
190 log_t* log, pid_t tid __attribute((unused)), bool at_fault,
205 static void dump_stack_segment(const ptrace_context_t* context, log_t* log, pid_t tid,
209 if (!try_get_word_ptrace(tid, *sp, &stack_content)) {
253 static void dump_stack(const ptrace_context_t* context, log_t* log, pid_t tid, bool at_fault,
275 dump_stack_segment(context, log, tid, only_in_tombstone, &sp, STACK_WORDS, -1);
289 dump_stack_segment(context, log, tid, only_in_tombstone, &sp, STACK_WORDS, i);
300 dump_stack_segment(context, log, tid, only_in_tombstone, &sp, words, i);
305 static void dump_backtrace_and_stack(const ptrace_context_t* context, log_t* log, pid_t tid,
308 ssize_t frames = unwind_backtrace_ptrace(tid, context, backtrace, 0, STACK_DEPTH);
310 dump_backtrace(context, log, tid, at_fault, backtrace, frames);
311 dump_stack(context, log, tid, at_fault, backtrace, frames);
315 static void dump_nearby_maps(const ptrace_context_t* context, log_t* log, pid_t tid) {
318 if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si)) {
320 tid, strerror(errno));
380 static void dump_thread(const ptrace_context_t* context, log_t* log, pid_t tid, bool at_fault,
382 wait_for_stop(tid, total_sleep_time_usec);
384 dump_registers(context, log, tid, at_fault);
385 dump_backtrace_and_stack(context, log, tid, at_fault);
387 dump_memory_and_code(context, log, tid, at_fault);
388 dump_nearby_maps(context, log, tid);
394 log_t* log, pid_t pid, pid_t tid, int* total_sleep_time_usec) {
417 if (*end || new_tid == tid) {
541 timeBuf, entry->nsec / 1000000, entry->pid, entry->tid,
547 timeBuf, entry->nsec / 1000000, entry->pid, entry->tid,
587 static bool dump_crash(log_t* log, pid_t pid, pid_t tid, int signal,
598 dump_thread_info(log, pid, tid, true);
600 dump_fault_addr(log, tid, signal);
603 ptrace_context_t* context = load_ptrace_context(tid);
604 dump_thread(context, log, tid, true, total_sleep_time_usec);
612 detach_failed = dump_sibling_thread_report(context, log, pid, tid, total_sleep_time_usec);
679 char* engrave_tombstone(pid_t pid, pid_t tid, int signal,
695 *detach_failed = dump_crash(&log, pid, tid, signal, dump_sibling_threads,