agnos-builder icon indicating copy to clipboard operation
agnos-builder copied to clipboard

Boot time speedup

Open adeebshihadeh opened this issue 3 years ago • 3 comments

AGNOS 6:

  • XBL: 3.5s
  • ABL: 4.7s
  • Kernel: 10.5s
  • setup shows on screen: 38s

adeebshihadeh avatar Feb 18 '23 07:02 adeebshihadeh

Added a script to print boot times. Here's where we're at as of 1e0f240f38622f752e926a0edb53efe9f23d5833

comma@tici:/data$ ./analyze-boot-time.py
------  ----  -----  ---
PON     1.5   1.5    9%
XBL     2.4   3.9    14%
ABL     3.7   7.6    21%
kernel  3.59  11.19  20%
weston  6.37  17.57  36%
comma   0.01  17.58  0%
onroad  ?     ?      -
------  ----  -----  ---

Further reduction:

  • up to 3s off the ABL, if both of these are fixed
    • timeout fastboot faster if nothing plugged in (relies on USB enumeration)
    • init screen faster for factory reset
  • 1s off kernel? by turning stuff off and deferring init
  • weston includes everything from /sbin/init all the way to weston being ready, lots to cut down here
    • udev in particular is slow
  • time-to-onroad isn't measured by the script yet, but that's at least another 5s

adeebshihadeh avatar Feb 26 '23 22:02 adeebshihadeh

Useful commands

systemd-analyze time
systemctl list-dependencies comma.service
journalctl -u weston.service -u weston-ready.service -o short-monotonic

References

  • https://elinux.org/Boot_Time

adeebshihadeh avatar Jan 21 '24 00:01 adeebshihadeh

Related to locking https://github.com/commaai/openpilot/issues/30894.

My current (early) progress is running ./analyze-boot-time.py + running the useful commands from the previous comment + analyzing dmesg with initcall_debug and generating a boot.svg with scripts/bootgraph.pl.

andiradulescu avatar Feb 03 '24 09:02 andiradulescu