Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boot time speedup #110

Open
adeebshihadeh opened this issue Feb 18, 2023 · 3 comments
Open

Boot time speedup #110

adeebshihadeh opened this issue Feb 18, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@adeebshihadeh
Copy link
Contributor

adeebshihadeh commented Feb 18, 2023

AGNOS 6:

  • XBL: 3.5s
  • ABL: 4.7s
  • Kernel: 10.5s
  • setup shows on screen: 38s
@adeebshihadeh adeebshihadeh added the enhancement New feature or request label Feb 18, 2023
@adeebshihadeh
Copy link
Contributor Author

adeebshihadeh commented Feb 26, 2023

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

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
Copy link
Contributor Author

adeebshihadeh commented Jan 21, 2024

Useful commands

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

References

@andiradulescu
Copy link
Collaborator

andiradulescu commented Feb 3, 2024

Related to locking commaai/openpilot#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants