Hi Alan, I looked at PX4's cmake/bloaty.cmake, they have an opt-in bloaty_compare_master target that downloads the latest master ELF from S3 and runs Google Bloaty against the local build. It only runs when invoked (and needs Bloaty installed), and has no threshold or warning.
bloat.py just uses Python and the toolchain's size/nm to diff two local ELFs without extra tools When you mentioned a warning during local builds, what did you have in mind? For instance, comparing against a saved baseline ELF after linking and warning above a threshold, warning on linker Flash/RAM usage %, or fetching a master baseline from CI like PX4 does? I want to know which direction makes the most sense Thanks Swatantra On Tue, 1 Dec 2026 at 16:44, Alan C. Assis <[email protected]> wrote: > Hi Swatantra, > > I think PX4 has something equivalent to what you implemented. > > Please search a little bit about it. > > Yes, I think the idea of having the warning during the local building is a > good idea. > > BR, > > Alan > > On Sun, Nov 29, 2026 at 5:36 PM Swatantra <[email protected]> > wrote: > > > Hi all, > > > > While working on size patches I kept wanting to compare two local > > builds without leaving the terminal. MemBrowse covers CI, and > > tools/showsize.sh looks at one binary, but I couldn't find something in > > tools/ that compares two ELFs on any config. So I wrote tools/bloat.py: > > Python standard library only, wrapping the toolchain's size and nm, > > with unit tests in tools/test_bloat.py and a docs page. > > > > Code: https://github.com/Swatantra-66/nuttx/tree/feature/bloat-tool > > > > Example on stm32f103-minimum:nsh (arm-none-eabi-gcc 14.2.1), commit > > 10998bb416 vs 5d150b4109, which makes CONFIG_FS_IOCTL_FILEPATH optional: > > > > $ python3 tools/bloat.py -p arm-none-eabi- -A -n old.elf new.elf > > > > Section totals (Old -> New, Delta): > > text 53476 -> 53236 (-240) > > data 340 -> 340 (+0) > > bss 3144 -> 3144 (+0) > > Flash 53816 -> 53576 (-240) > > RAM 3484 -> 3484 (+0) > > > > Changed: file_vioctl 412 -> 316 (-96) > > Removed: inode_getpath (-76), strlcat (-72) > > > > (output trimmed; the flash delta matches the linker's own flash-used > > figures for the two builds.) > > > > I used AI to help draft the code. I reviewed it, ran the tests and did > > the comparison above myself. I didn't copy from Linux's bloat-o-meter > > (GPL). > > > > 1. Does an equivalent exist or is one in progress? > > 2. Is tools/ the right place, and are test files there fine? > > 3. Any objection to me sending a PR? > > > > Thanks, > > Swatantra > > >
