This proposal looks at adding command line options to customise the functionality of the footprint reporting tools.
Problem description
Currently, there are no customisation options when running west build -t rom_report/west build -t ram_report.
Proposed change
This proposal considers options to add the ability for the end user to tweak the output to their desires. My current ideas for the options are:
making report depth a configurable parameter
this is already an argument in a lower-level script, but not available from west build
allowing the sort key of the report to be changed from alphabetical to size
considering that ROM reports will be used to view which parts of the code are taking up the most space, it makes sense to be able to sort the output by size, rather than by name.
Any other suggestions welcome!
Detailed RFC
Proposed change (Detailed)
This change looks to leverage the structure of cmake/reports/CMakeLists.txt and scripts/footprint/size_report to introduce the new features:
The report script scripts/footprint/size_report is already designed to take command line arguments, including the depth parameter. The proposal also considers adding a sort key option, as well as any other options suggested by the community.
However, the tool is best used via the west build command as the cmake file loads in many of the other required arguments, and so modifications should also be made to the cmake/reports/CMakeLists.txt file.
With the proposed changes, a report might be generated like the following:
West build -t rom_report -Dsort_key=size
As a note, I have tried these changes by manually changing lines in the scripts and found them to work as expected.
Dependencies
This is a focussed change, and only affects cmake/reports/CMakeLists.txt and scripts/footprint/size_report
Concerns and Unresolved Questions
Main question point is that there needs to be a determination of which options to support and how they should be named.
Alternatives
Main alternative was to change the default sorting behaviour of the report, but that might break other people's workflows.
Introduction
This proposal looks at adding command line options to customise the functionality of the footprint reporting tools.
Problem description
Currently, there are no customisation options when running
west build -t rom_report
/west build -t ram_report
.Proposed change
This proposal considers options to add the ability for the end user to tweak the output to their desires. My current ideas for the options are:
west build
Detailed RFC
Proposed change (Detailed)
This change looks to leverage the structure of
cmake/reports/CMakeLists.txt
andscripts/footprint/size_report
to introduce the new features:The report script
scripts/footprint/size_report
is already designed to take command line arguments, including the depth parameter. The proposal also considers adding a sort key option, as well as any other options suggested by the community.However, the tool is best used via the
west build
command as the cmake file loads in many of the other required arguments, and so modifications should also be made to thecmake/reports/CMakeLists.txt
file.With the proposed changes, a report might be generated like the following:
As a note, I have tried these changes by manually changing lines in the scripts and found them to work as expected.
Dependencies
This is a focussed change, and only affects
cmake/reports/CMakeLists.txt
andscripts/footprint/size_report
Concerns and Unresolved Questions
Main question point is that there needs to be a determination of which options to support and how they should be named.
Alternatives
Main alternative was to change the default sorting behaviour of the report, but that might break other people's workflows.