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

feat(tools): add a script for printing Rust stacks' sizes #4716

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

romanz
Copy link
Contributor

@romanz romanz commented Mar 3, 2025

Following #4555 and #4696:

$ TREZOR_MODEL=T3T1 QUIET_MODE=1 make -C core build_firmware; tools/print-rust-stack-sizes.py | sort -k1 -n | tail
...
7256	trezor_lib::ui::api::firmware_micropython::new_show_checklist
7440	trezor_lib::ui::api::firmware_micropython::new_flow_confirm_set_new_pin
7440	trezor_lib::ui::api::firmware_micropython::new_prompt_backup
7512	trezor_lib::ui::api::firmware_micropython::new_show_share_words_delizia
9224	trezor_lib::ui::api::firmware_micropython::new_confirm_fido
13176	trezor_lib::ui::api::firmware_micropython::new_tutorial
14096	trezor_lib::ui::api::firmware_micropython::new_continue_recovery_homepage
14144	trezor_lib::ui::api::firmware_micropython::new_flow_get_address
15792	trezor_lib::ui::api::firmware_micropython::new_confirm_summary
18096	trezor_lib::ui::api::firmware_micropython::new_flow_confirm_output

Copy link

github-actions bot commented Mar 3, 2025

core UI changes device test click test persistence test
T2T1 Model T test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3B1 Safe 3 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3T1 Safe 5 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
All main(screens)

@romanz romanz requested a review from matejcik March 3, 2025 10:12
@romanz romanz self-assigned this Mar 3, 2025
@romanz romanz added core Trezor Core firmware. Runs on Trezor Model T and T2B1. dependencies Pull requests that update a dependency file labels Mar 3, 2025
@romanz
Copy link
Contributor Author

romanz commented Mar 3, 2025

Should we also add it to core_firmware CI job, e.g.:

diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml
index b3ed8bba1..b2f78736f 100644
--- a/.github/workflows/core.yml
+++ b/.github/workflows/core.yml
@@ -84,6 +84,7 @@ jobs:
       - run: nix-shell --run "poetry run make -C core build_prodtest"
         if: matrix.coins == 'universal' && matrix.type != 'debuglink'
       - run: nix-shell --run "poetry run make -C core build_firmware"
+      - run: nix-shell --run "poetry run tools/print-rust-stack-sizes.py | sort -k1 -n | tail -n 50"
       - run: nix-shell --run "poetry run make -C core sizecheck"
         if: matrix.coins == 'universal' && matrix.type != 'debuglink'
       - run: nix-shell --run "poetry run ./tools/check-bitcoin-only core/build/firmware/firmware.bin"

@romanz romanz marked this pull request as ready for review March 3, 2025 10:27
@romanz romanz added the rust Pull requests that update Rust code label Mar 3, 2025
@romanz romanz requested a review from mmilata March 4, 2025 09:52
@mmilata
Copy link
Member

mmilata commented Mar 4, 2025

Thanks for adding the script! In CI the output will probably get drowned in the rest of the logs but at least the script won't bitrot, so I'm slightly in favor of adding it.

@romanz
Copy link
Contributor Author

romanz commented Mar 4, 2025

110eb92 added it to core.yml:
image

@romanz romanz force-pushed the romanz/print-stacks branch from 110eb92 to bfa4d90 Compare March 4, 2025 15:36
@romanz romanz merged commit 11517f4 into main Mar 4, 2025
96 checks passed
@romanz romanz deleted the romanz/print-stacks branch March 4, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Trezor Core firmware. Runs on Trezor Model T and T2B1. dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

2 participants