Sample resource usage of program compiled “claimed” by GCC_ARM via Mbed CLI:
Sample resource usage of program compiled “claimed” by ARM compiler via Mbed Studio:
Why is the output different? GCC_ARM completely ignores the contribution coming from model.o and also underreports the overall flash and RAM contributions of each component. Note that the program runs fine in both cases on the target hardware. This is important for me because I need to profile how much flash and RAM a tensorflow lite micro model consumes. I tried using ARM compiler with CLI but it wants license.
There is another external tool that has more options:
I have already tried to fix problems with memap.py, but its complicated because its depdending on the different compilers and linkerscripts. Maybe you can append the zipped mapfile that I can check why model.o does not appear in the statistics.
Memap.py has also a --depth argument to get a deeper walk in the module tree, and it can also export to html or csv for further analysis. I have created a branch to set these arguments via CMake variables. I wanted to make this public in a PR, but I want to change it first to cmake options which is more conveniant.
I’m not a mbed official, only contributing in my spare time. In the last month, I see less activity in the Mbed repo, this looks like a bigger problem to me.