• Home
  • Raw
  • Download

Lines Matching refs:log

71 static void dump_header_info(log_t* log) {  in dump_header_info()  argument
75 _LOG(log, logtype::HEADER, "Build fingerprint: '%s'\n", fingerprint.c_str()); in dump_header_info()
76 _LOG(log, logtype::HEADER, "Revision: '%s'\n", revision.c_str()); in dump_header_info()
77 _LOG(log, logtype::HEADER, "ABI: '%s'\n", ABI_STRING); in dump_header_info()
80 static void dump_timestamp(log_t* log, time_t time) { in dump_timestamp() argument
86 _LOG(log, logtype::HEADER, "Timestamp: %s\n", buf); in dump_timestamp()
89 static void dump_probable_cause(log_t* log, const siginfo_t* si, unwindstack::Maps* maps) { in dump_probable_cause() argument
115 if (!cause.empty()) _LOG(log, logtype::HEADER, "Cause: %s\n", cause.c_str()); in dump_probable_cause()
118 static void dump_signal_info(log_t* log, const ThreadInfo& thread_info, in dump_signal_info() argument
139 _LOG(log, logtype::HEADER, "signal %d (%s), code %d (%s%s), fault addr %s\n", in dump_signal_info()
144 static void dump_thread_info(log_t* log, const ThreadInfo& thread_info) { in dump_thread_info() argument
149 log->should_retrieve_logcat = false; in dump_thread_info()
152 _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", thread_info.pid, in dump_thread_info()
154 _LOG(log, logtype::HEADER, "uid: %d\n", thread_info.uid); in dump_thread_info()
157 static void dump_stack_segment(log_t* log, unwindstack::Maps* maps, unwindstack::Memory* memory, in dump_stack_segment() argument
190 _LOG(log, logtype::STACK, "%s\n", line.c_str()); in dump_stack_segment()
196 static void dump_stack(log_t* log, const std::vector<unwindstack::FrameData>& frames, in dump_stack() argument
215 dump_stack_segment(log, maps, memory, &sp, STACK_WORDS, -1); in dump_stack()
227 _LOG(log, logtype::STACK, delimiter); in dump_stack()
248 dump_stack_segment(log, maps, memory, &sp, words, i); in dump_stack()
252 dump_stack_segment(log, maps, memory, &sp, STACK_WORDS, i); in dump_stack()
269 static void dump_abort_message(log_t* log, unwindstack::Memory* process_memory, uint64_t address) { in dump_abort_message() argument
276 _LOG(log, logtype::HEADER, "Failed to read abort message header: %s\n", strerror(errno)); in dump_abort_message()
282 _LOG(log, logtype::HEADER, "Abort message header malformed: claimed length = %zd\n", length); in dump_abort_message()
291 _LOG(log, logtype::HEADER, "Failed to read abort message: %s\n", strerror(errno)); in dump_abort_message()
295 _LOG(log, logtype::HEADER, "Abort message: '%s'\n", &msg[0]); in dump_abort_message()
298 static void dump_all_maps(log_t* log, unwindstack::Unwinder* unwinder, uint64_t addr) { in dump_all_maps() argument
302 _LOG(log, logtype::MAPS, in dump_all_maps()
308 _LOG(log, logtype::MAPS, "\n--->Fault address falls at %s before any mapped regions\n", in dump_all_maps()
312 _LOG(log, logtype::MAPS, " (fault address prefixed with --->)\n"); in dump_all_maps()
315 _LOG(log, logtype::MAPS, "\n"); in dump_all_maps()
325 _LOG(log, logtype::MAPS, "--->Fault address falls at %s between mapped regions\n", in dump_all_maps()
367 _LOG(log, logtype::MAPS, "%s\n", line.c_str()); in dump_all_maps()
370 _LOG(log, logtype::MAPS, "--->Fault address falls at %s after any mapped regions\n", in dump_all_maps()
375 static void print_register_row(log_t* log, in print_register_row() argument
384 _LOG(log, logtype::REGISTERS, " %s\n", output.c_str()); in print_register_row()
387 void dump_registers(log_t* log, unwindstack::Regs* regs) { in dump_registers() argument
403 regs->IterateRegisters([log, &current_row, &special_row](const char* name, uint64_t value) { in dump_registers()
414 print_register_row(log, current_row); in dump_registers()
420 print_register_row(log, current_row); in dump_registers()
423 print_register_row(log, special_row); in dump_registers()
426 void dump_memory_and_code(log_t* log, unwindstack::Maps* maps, unwindstack::Memory* memory, in dump_memory_and_code() argument
428 regs->IterateRegisters([log, maps, memory](const char* reg_name, uint64_t reg_value) { in dump_memory_and_code()
436 dump_memory(log, memory, reg_value, label); in dump_memory_and_code()
440 static bool dump_thread(log_t* log, unwindstack::Unwinder* unwinder, const ThreadInfo& thread_info, in dump_thread() argument
442 log->current_tid = thread_info.tid; in dump_thread()
444 _LOG(log, logtype::THREAD, "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n"); in dump_thread()
446 dump_thread_info(log, thread_info); in dump_thread()
449 dump_signal_info(log, thread_info, unwinder->GetProcessMemory().get()); in dump_thread()
450 dump_probable_cause(log, thread_info.siginfo, unwinder->GetMaps()); in dump_thread()
454 dump_abort_message(log, unwinder->GetProcessMemory().get(), abort_msg_address); in dump_thread()
457 dump_registers(log, thread_info.registers.get()); in dump_thread()
464 _LOG(log, logtype::THREAD, "Failed to unwind"); in dump_thread()
466 _LOG(log, logtype::BACKTRACE, "\nbacktrace:\n"); in dump_thread()
467 log_backtrace(log, unwinder, " "); in dump_thread()
469 _LOG(log, logtype::STACK, "\nstack:\n"); in dump_thread()
470 dump_stack(log, unwinder->frames(), unwinder->GetMaps(), unwinder->GetProcessMemory().get()); in dump_thread()
475 dump_memory_and_code(log, maps, unwinder->GetProcessMemory().get(), in dump_thread()
483 dump_all_maps(log, unwinder, addr); in dump_thread()
487 log->current_tid = log->crashed_tid; in dump_thread()
497 static void dump_log_file(log_t* log, pid_t pid, const char* filename, unsigned int tail) { in dump_log_file() argument
501 if (!log->should_retrieve_logcat) { in dump_log_file()
539 _LOG(log, logtype::LOGS, "--------- %slog %s\n", in dump_log_file()
563 _LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8.*s: %s\n", timeBuf, in dump_log_file()
596 _LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8s: %s\n", timeBuf, in dump_log_file()
607 static void dump_logs(log_t* log, pid_t pid, unsigned int tail) { in dump_logs() argument
613 dump_log_file(log, pid, "system", tail); in dump_logs()
614 dump_log_file(log, pid, "main", tail); in dump_logs()
623 log_t log; in engrave_tombstone_ucontext() local
624 log.current_tid = tid; in engrave_tombstone_ucontext()
625 log.crashed_tid = tid; in engrave_tombstone_ucontext()
626 log.tfd = tombstone_fd; in engrave_tombstone_ucontext()
627 log.amfd_data = nullptr; in engrave_tombstone_ucontext()
665 log_t log; in engrave_tombstone() local
666 log.current_tid = target_thread; in engrave_tombstone()
667 log.crashed_tid = target_thread; in engrave_tombstone()
668 log.tfd = output_fd.get(); in engrave_tombstone()
669 log.amfd_data = amfd_data; in engrave_tombstone()
671 _LOG(&log, logtype::HEADER, "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n"); in engrave_tombstone()
672 dump_header_info(&log); in engrave_tombstone()
673 dump_timestamp(&log, time(nullptr)); in engrave_tombstone()
679 dump_thread(&log, unwinder, it->second, abort_msg_address, true); in engrave_tombstone()
682 dump_logs(&log, it->second.pid, 50); in engrave_tombstone()
690 dump_thread(&log, unwinder, thread_info, 0, false); in engrave_tombstone()
694 _LOG(&log, logtype::OPEN_FILES, "\nopen files:\n"); in engrave_tombstone()
695 dump_open_files_list(&log, *open_files, " "); in engrave_tombstone()
699 dump_logs(&log, it->second.pid, 0); in engrave_tombstone()