From 01eb40567707c8a90b8b118d91eb251fd02ea6dd Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Wed, 15 Dec 2021 03:54:54 +0800 Subject: [PATCH] put logcat in bootlog (#23217) * put logcat in boot log * continue * use std::unique_ptr * Revert "use std::unique_ptr" This reverts commit c671f8ca7160691791bade508c4a8eb5cdb73fb8. old-commit-hash: f042962933837dbe612d4eb0f9bf5c0a0e0fb6f3 --- selfdrive/logcatd/logcatd_android.cc | 6 ++++-- selfdrive/loggerd/bootlog.cc | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/selfdrive/logcatd/logcatd_android.cc b/selfdrive/logcatd/logcatd_android.cc index 1a982a0feb..4452e2f093 100644 --- a/selfdrive/logcatd/logcatd_android.cc +++ b/selfdrive/logcatd/logcatd_android.cc @@ -14,8 +14,10 @@ int main() { ExitHandler do_exit; PubMaster pm({"androidLog"}); - log_time last_log_time = {}; - logger_list *logger_list = android_logger_list_alloc(ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK, 0, 0); + struct timespec cur_time; + clock_gettime(CLOCK_REALTIME, &cur_time); + log_time last_log_time(cur_time); + logger_list *logger_list = nullptr; while (!do_exit) { // setup android logging diff --git a/selfdrive/loggerd/bootlog.cc b/selfdrive/loggerd/bootlog.cc index 5209958377..478eb16852 100644 --- a/selfdrive/loggerd/bootlog.cc +++ b/selfdrive/loggerd/bootlog.cc @@ -11,6 +11,8 @@ static kj::Array build_boot_log() { if (Hardware::TICI()) { bootlog_commands.push_back("journalctl"); bootlog_commands.push_back("sudo nvme smart-log --output-format=json /dev/nvme0"); + } else if (Hardware::EON()) { + bootlog_commands.push_back("logcat -d"); } MessageBuilder msg;