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: 6b4957cba1
commatwo_master
Adeeb Shihadeh 5 years ago committed by GitHub
parent e9d58939d2
commit a4f4f1d828
  1. 2
      cereal
  2. 3
      launch_chffrplus.sh
  3. 3
      selfdrive/loggerd/loggerd.cc

@ -1 +1 @@
Subproject commit 5c7e91abb7fa93f86164fc48124c596bf9cfc849 Subproject commit 7128f46571c9a2cafb350f13e8dcaf28d0f4134d

@ -113,6 +113,9 @@ function launch {
ln -sfn $(pwd) /data/pythonpath ln -sfn $(pwd) /data/pythonpath
export PYTHONPATH="$PWD" export PYTHONPATH="$PWD"
# write tmux scrollback to a file
tmux capture-pane -pq -S-1000 > /tmp/launch_log
# start manager # start manager
cd selfdrive cd selfdrive
./manager.py ./manager.py

@ -593,6 +593,9 @@ static void bootlog() {
std::string lastPmsg = util::read_file("/sys/fs/pstore/pmsg-ramoops-0"); std::string lastPmsg = util::read_file("/sys/fs/pstore/pmsg-ramoops-0");
boot.setLastPmsg(capnp::Data::Reader((const kj::byte*)lastPmsg.data(), lastPmsg.size())); 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(); auto bytes = msg.toBytes();
logger_log(&s.logger, bytes.begin(), bytes.size(), false); logger_log(&s.logger, bytes.begin(), bytes.size(), false);
} }

Loading…
Cancel
Save