Lines Matching refs:log
72 static void dump_header_info(log_t* log) { in dump_header_info() argument
76 _LOG(log, logtype::HEADER, "Build fingerprint: '%s'\n", fingerprint.c_str()); in dump_header_info()
77 _LOG(log, logtype::HEADER, "Revision: '%s'\n", revision.c_str()); in dump_header_info()
78 _LOG(log, logtype::HEADER, "ABI: '%s'\n", ABI_STRING); in dump_header_info()
81 static void dump_timestamp(log_t* log, time_t time) { in dump_timestamp() argument
87 _LOG(log, logtype::HEADER, "Timestamp: %s\n", buf); in dump_timestamp()
121 static void dump_probable_cause(log_t* log, const siginfo_t* si, unwindstack::Maps* maps, in dump_probable_cause() argument
153 if (!cause.empty()) _LOG(log, logtype::HEADER, "Cause: %s\n", cause.c_str()); in dump_probable_cause()
156 static void dump_signal_info(log_t* log, const ThreadInfo& thread_info, in dump_signal_info() argument
177 _LOG(log, logtype::HEADER, "signal %d (%s), code %d (%s%s), fault addr %s\n", in dump_signal_info()
182 static void dump_thread_info(log_t* log, const ThreadInfo& thread_info) { in dump_thread_info() argument
187 log->should_retrieve_logcat = false; in dump_thread_info()
190 _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", thread_info.pid, in dump_thread_info()
192 _LOG(log, logtype::HEADER, "uid: %d\n", thread_info.uid); in dump_thread_info()
207 static void dump_abort_message(log_t* log, unwindstack::Memory* process_memory, uint64_t address) { in dump_abort_message() argument
214 _LOG(log, logtype::HEADER, "Failed to read abort message header: %s\n", strerror(errno)); in dump_abort_message()
220 _LOG(log, logtype::HEADER, "Abort message header malformed: claimed length = %zd\n", length); in dump_abort_message()
229 _LOG(log, logtype::HEADER, "Failed to read abort message: %s\n", strerror(errno)); in dump_abort_message()
233 _LOG(log, logtype::HEADER, "Abort message: '%s'\n", &msg[0]); in dump_abort_message()
236 static void dump_all_maps(log_t* log, unwindstack::Unwinder* unwinder, uint64_t addr) { in dump_all_maps() argument
240 _LOG(log, logtype::MAPS, in dump_all_maps()
246 _LOG(log, logtype::MAPS, "\n--->Fault address falls at %s before any mapped regions\n", in dump_all_maps()
250 _LOG(log, logtype::MAPS, " (fault address prefixed with --->)\n"); in dump_all_maps()
253 _LOG(log, logtype::MAPS, "\n"); in dump_all_maps()
263 _LOG(log, logtype::MAPS, "--->Fault address falls at %s between mapped regions\n", in dump_all_maps()
305 _LOG(log, logtype::MAPS, "%s\n", line.c_str()); in dump_all_maps()
308 _LOG(log, logtype::MAPS, "--->Fault address falls at %s after any mapped regions\n", in dump_all_maps()
313 static void print_register_row(log_t* log, in print_register_row() argument
322 _LOG(log, logtype::REGISTERS, " %s\n", output.c_str()); in print_register_row()
325 void dump_registers(log_t* log, unwindstack::Regs* regs) { in dump_registers() argument
341 regs->IterateRegisters([log, ¤t_row, &special_row](const char* name, uint64_t value) { in dump_registers()
352 print_register_row(log, current_row); in dump_registers()
358 print_register_row(log, current_row); in dump_registers()
361 print_register_row(log, special_row); in dump_registers()
364 void dump_memory_and_code(log_t* log, unwindstack::Maps* maps, unwindstack::Memory* memory, in dump_memory_and_code() argument
366 regs->IterateRegisters([log, maps, memory](const char* reg_name, uint64_t reg_value) { in dump_memory_and_code()
374 dump_memory(log, memory, reg_value, label); in dump_memory_and_code()
378 static bool dump_thread(log_t* log, unwindstack::Unwinder* unwinder, const ThreadInfo& thread_info, in dump_thread() argument
381 log->current_tid = thread_info.tid; in dump_thread()
383 _LOG(log, logtype::THREAD, "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n"); in dump_thread()
385 dump_thread_info(log, thread_info); in dump_thread()
388 dump_signal_info(log, thread_info, unwinder->GetProcessMemory().get()); in dump_thread()
392 gwp_asan_crash_data.DumpCause(log); in dump_thread()
394 dump_probable_cause(log, thread_info.siginfo, unwinder->GetMaps(), in dump_thread()
399 dump_abort_message(log, unwinder->GetProcessMemory().get(), abort_msg_address); in dump_thread()
402 dump_registers(log, thread_info.registers.get()); in dump_thread()
409 _LOG(log, logtype::THREAD, "Failed to unwind"); in dump_thread()
411 _LOG(log, logtype::BACKTRACE, "\nbacktrace:\n"); in dump_thread()
412 log_backtrace(log, unwinder, " "); in dump_thread()
417 gwp_asan_crash_data.DumpDeallocationTrace(log, unwinder); in dump_thread()
421 gwp_asan_crash_data.DumpAllocationTrace(log, unwinder); in dump_thread()
425 dump_memory_and_code(log, maps, unwinder->GetProcessMemory().get(), in dump_thread()
433 dump_all_maps(log, unwinder, addr); in dump_thread()
437 log->current_tid = log->crashed_tid; in dump_thread()
447 static void dump_log_file(log_t* log, pid_t pid, const char* filename, unsigned int tail) { in dump_log_file() argument
451 if (!log->should_retrieve_logcat) { in dump_log_file()
489 _LOG(log, logtype::LOGS, "--------- %slog %s\n", in dump_log_file()
513 _LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8.*s: %s\n", timeBuf, in dump_log_file()
546 _LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8s: %s\n", timeBuf, in dump_log_file()
557 static void dump_logs(log_t* log, pid_t pid, unsigned int tail) { in dump_logs() argument
563 dump_log_file(log, pid, "system", tail); in dump_logs()
564 dump_log_file(log, pid, "main", tail); in dump_logs()
573 log_t log; in engrave_tombstone_ucontext() local
574 log.current_tid = tid; in engrave_tombstone_ucontext()
575 log.crashed_tid = tid; in engrave_tombstone_ucontext()
576 log.tfd = tombstone_fd; in engrave_tombstone_ucontext()
577 log.amfd_data = nullptr; in engrave_tombstone_ucontext()
616 log_t log; in engrave_tombstone() local
617 log.current_tid = target_thread; in engrave_tombstone()
618 log.crashed_tid = target_thread; in engrave_tombstone()
619 log.tfd = output_fd.get(); in engrave_tombstone()
620 log.amfd_data = amfd_data; in engrave_tombstone()
622 _LOG(&log, logtype::HEADER, "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n"); in engrave_tombstone()
623 dump_header_info(&log); in engrave_tombstone()
624 dump_timestamp(&log, time(nullptr)); in engrave_tombstone()
635 dump_thread(&log, unwinder, it->second, abort_msg_address, true, in engrave_tombstone()
639 dump_logs(&log, it->second.pid, 50); in engrave_tombstone()
647 dump_thread(&log, unwinder, thread_info, 0, false, gwp_asan_crash_data); in engrave_tombstone()
651 _LOG(&log, logtype::OPEN_FILES, "\nopen files:\n"); in engrave_tombstone()
652 dump_open_files_list(&log, *open_files, " "); in engrave_tombstone()
656 dump_logs(&log, it->second.pid, 0); in engrave_tombstone()