From a4f4f1d8287c50b258ac469410b9cbd307c3c398 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 20 Oct 2020 21:07:12 -0700 Subject: [PATCH] Log last 1000 lines of tmux output in bootlog (#2149) * log last 1000 lines of tmux output in bootlog * add to bootlog * fix tmux capture old-commit-hash: 6b4957cba10985507c5ba2337ee08b6392f86ddb --- cereal | 2 +- launch_chffrplus.sh | 3 +++ selfdrive/loggerd/loggerd.cc | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cereal b/cereal index 5c7e91abb7..7128f46571 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 5c7e91abb7fa93f86164fc48124c596bf9cfc849 +Subproject commit 7128f46571c9a2cafb350f13e8dcaf28d0f4134d diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 7d27f1c6b1..e7fd3a257b 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -113,6 +113,9 @@ function launch { ln -sfn $(pwd) /data/pythonpath export PYTHONPATH="$PWD" + # write tmux scrollback to a file + tmux capture-pane -pq -S-1000 > /tmp/launch_log + # start manager cd selfdrive ./manager.py diff --git a/selfdrive/loggerd/loggerd.cc b/selfdrive/loggerd/loggerd.cc index 105c81fd61..3a9e64e46c 100644 --- a/selfdrive/loggerd/loggerd.cc +++ b/selfdrive/loggerd/loggerd.cc @@ -593,6 +593,9 @@ static void bootlog() { std::string lastPmsg = util::read_file("/sys/fs/pstore/pmsg-ramoops-0"); boot.setLastPmsg(capnp::Data::Reader((const kj::byte*)lastPmsg.data(), lastPmsg.size())); + std::string launchLog = util::read_file("/tmp/launch_log"); + boot.setLaunchLog(capnp::Text::Reader(launchLog.data(), launchLog.size())); + auto bytes = msg.toBytes(); logger_log(&s.logger, bytes.begin(), bytes.size(), false); }