Files
PX4-Autopilot/Tools
Jacob Dahl 1d761cdf2e fix(ci): report flash and static RAM usage separately (#28789)
* fix(ci): report flash and static RAM usage separately

Bloaty's VM total includes zero-initialized RAM and understates the combined cost of data and code copied from flash into RAM. Report the flash load image and static RAM allocations independently so the PR headline reflects each resource's actual change.

Assisted-by: Codex

* docs(ci): trim memory analysis comment

Assisted-by: Codex

* fix(ci): diff PR flash usage against the merge commit's base

The base branch tip is fetched when the job runs, so a PR merged while its job was queued was compared against itself and reported a near-zero change, and commits landed in the meantime showed up as reverted.

* fix(ci): measure flash image from section headers

ld maps the ELF header into the first LOAD segment when its max page size exceeds the flash origin's alignment (binutils 2.34 defaults to 64 KiB), so segment-based accounting rejected valid firmware as outside the flash region.

* feat(ci): flag notable flash and RAM changes

Growth over 100 B and 1000 B gets yellow and red markers, savings over 100 B green, so reviewers can spot size regressions without reading the numbers.

* refactor(ci): derive flash and RAM totals without per-target constants

The matrix duplicated each board's flash-analysis linker region, which would drift silently. Section headers alone distinguish code executing in place (VMA == LMA) from data copied to or reserved in RAM, and the image span matches objcopy -O binary.

* fix(ci): limit the bloaty breakdown to VM sizes

Debug, symbol and string table rows only change the file size and made up most of the comment.

* fix(ci): post flash analysis only when size changes

A push that puts flash and static RAM back to zero was still rewriting the sticky comment, so a PR with no size change carried a zero report. Remove that comment instead. Fork tokens cannot delete it, so those PRs hand a delete artifact to the poster.

Assisted-by: Grok:grok-4.7
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ci): retain zero-delta flash analysis comments

Existing reports can be updated when size deltas return to zero, avoiding a separate privileged deletion path.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Assisted-by: Codex:gpt-6

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-22 16:56:58 -06:00
..
…