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

[CI] Lint check for suspicious #includes #14704

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

kpschoedel
Copy link
Contributor

Problem

Code for embedded use should generally avoid using C++ library
features that heap allocate (e.g. STL containers) or have large data
(e.g. locale).

Change overview

scripts/tools/check_includes.sh does a simple search
for #include directives and compares them against rules
in scripts/tools/check_includes_config.py.

This can be run from a command line as well as the CI workflow.

Testing

Manual runs.

#### Problem

Code for embedded use should generally avoid using C++ library
features that heap allocate (e.g. STL containers) or have large data
(e.g. locale).

#### Change overview

`scripts/tools/check_includes.sh` does a simple search
for `#include` directives and compares them against rules
in `scripts/tools/check_includes_config.py`.

This can be run from a command line as well as the CI workflow.

#### Testing

Manual runs.
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

PR #14704: Size comparison from b8cb560 to 1260348

Full report (43 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section b8cb560 1260348 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 577442 577442 0 0.0
.app_xip_area 484680 484680 0 0.0
.bss 75508 75508 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 535078 535078 0 0.0
.app_xip_area 443884 443884 0 0.0
.bss 73980 73980 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 559658 559658 0 0.0
.app_xip_area 459144 459144 0 0.0
.bss 82972 82972 0 0.0
.data 504 504 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 843664 843664 0 0.0
(read/write) 125040 125040 0 0.0
.bss 123144 123144 0 0.0
.data 1892 1892 0 0.0
.text 843656 843656 0 0.0
BRD4161A+rpc (read only) 831032 831032 0 0.0
(read/write) 141696 141696 0 0.0
.bss 139704 139704 0 0.0
.data 1992 1992 0 0.0
.text 831024 831024 0 0.0
window-app BRD4161A (read only) 815908 815908 0 0.0
(read/write) 123668 123668 0 0.0
.bss 121820 121820 0 0.0
.data 1848 1848 0 0.0
.text 815900 815900 0 0.0
esp32 all-clusters-app c3devkit (read only) 933944 933944 0 0.0
(read/write) 1401466 1401466 0 0.0
.dram0.bss 70304 70304 0 0.0
.dram0.data 14268 14268 0 0.0
.flash.rodata 198000 198000 0 0.0
.flash.text 933944 933944 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 981987 981987 0 0.0
(read/write) 465824 465824 0 0.0
.dram0.bss 75064 75064 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 224608 224608 0 0.0
.flash.text 976603 976603 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 661652 661652 0 0.0
.bss 75204 75204 0 0.0
.data 1852 1852 0 0.0
.text 578796 578796 0 0.0
lock k32w061+release (read/write) 662820 662820 0 0.0
.bss 75524 75524 0 0.0
.data 1892 1892 0 0.0
.text 579604 579604 0 0.0
linux all-clusters-app debug (read only) 2303497 2303497 0 0.0
(read/write) 148288 148288 0 0.0
.bss 63008 63008 0 0.0
.data 1200 1200 0 0.0
.data.rel.ro 78392 78392 0 0.0
.dynamic 592 592 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 204357 204357 0 0.0
.text 1937138 1937138 0 0.0
bridge-app debug+rpc (read only) 1631053 1631053 0 0.0
(read/write) 88168 88168 0 0.0
.bss 43648 43648 0 0.0
.data 1922 1922 0 0.0
.data.rel.ro 37440 37440 0 0.0
.dynamic 592 592 0 0.0
.got 3968 3968 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 137940 137940 0 0.0
.text 1378021 1378021 0 0.0
chip-tool debug (read only) 7141725 7141725 0 0.0
(read/write) 188296 188296 0 0.0
.bss 36264 36264 0 0.0
.data 1088 1088 0 0.0
.data.rel.ro 144960 144960 0 0.0
.dynamic 608 608 0 0.0
.got 4760 4760 0 0.0
.init 27 27 0 0.0
.init_array 600 600 0 0.0
.rodata 407445 407445 0 0.0
.text 6366933 6366933 0 0.0
chip-tool-ipv6only arm64 (read only) 7093252 7093252 0 0.0
(read/write) 290977 290977 0 0.0
.bss 54577 54577 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 186256 186256 0 0.0
.dynamic 560 560 0 0.0
.got 45232 45232 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 390492 390492 0 0.0
.text 6102388 6102388 0 0.0
door-lock-app debug (read only) 1852289 1852289 0 0.0
(read/write) 118048 118048 0 0.0
.bss 49824 49824 0 0.0
.data 962 962 0 0.0
.data.rel.ro 61856 61856 0 0.0
.dynamic 592 592 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 171260 171260 0 0.0
.text 1532962 1532962 0 0.0
lighting-app debug+rpc (read only) 1953673 1953673 0 0.0
(read/write) 123168 123168 0 0.0
.bss 50776 50776 0 0.0
.data 1392 1392 0 0.0
.data.rel.ro 65504 65504 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 704 704 0 0.0
.rodata 161297 161297 0 0.0
.text 1637954 1637954 0 0.0
ota-provider-app debug (read only) 1631585 1631585 0 0.0
(read/write) 87560 87560 0 0.0
.bss 48704 48704 0 0.0
.data 1064 1064 0 0.0
.data.rel.ro 32296 32296 0 0.0
.dynamic 608 608 0 0.0
.got 4240 4240 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 147878 147878 0 0.0
.text 1366386 1366386 0 0.0
ota-requestor-app debug (read only) 1640321 1640321 0 0.0
(read/write) 90640 90640 0 0.0
.bss 50016 50016 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 34248 34248 0 0.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 144183 144183 0 0.0
.text 1379874 1379874 0 0.0
shell debug (read only) 2278121 2278121 0 0.0
(read/write) 150064 150064 0 0.0
.bss 70720 70720 0 0.0
.data 768 768 0 0.0
.data.rel.ro 72896 72896 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 205138 205138 0 0.0
.text 1916914 1916914 0 0.0
thermostat-no-ble arm64 (read only) 2086396 2086396 0 0.0
(read/write) 148817 148817 0 0.0
.bss 66129 66129 0 0.0
.data 952 952 0 0.0
.data.rel.ro 74624 74624 0 0.0
.dynamic 560 560 0 0.0
.got 4136 4136 0 0.0
.init 24 24 0 0.0
.init_array 336 336 0 0.0
.rodata 131004 131004 0 0.0
.text 1737664 1737664 0 0.0
tv-app debug (read only) 2408177 2408177 0 0.0
(read/write) 318704 318704 0 0.0
.bss 237152 237152 0 0.0
.data 3104 3104 0 0.0
.data.rel.ro 72456 72456 0 0.0
.dynamic 592 592 0 0.0
.got 4520 4520 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 192140 192140 0 0.0
.text 2044674 2044674 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2385696 2385696 0 0.0
.bss 189220 189220 0 0.0
.data 5288 5288 0 0.0
.text 1348296 1348296 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2338512 2338512 0 0.0
.bss 178144 178144 0 0.0
.data 5568 5568 0 0.0
.text 1301112 1301112 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302232 2302232 0 0.0
.bss 178024 178024 0 0.0
.data 5544 5544 0 0.0
.text 1264832 1264832 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2292740 2292740 0 0.0
.bss 175308 175308 0 0.0
.data 5368 5368 0 0.0
.text 1255312 1255312 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 980831 980831 0 0.0
bss 118512 118512 0 0.0
rodata 116532 116532 0 0.0
text 667988 667988 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 966391 966391 0 0.0
bss 115556 115556 0 0.0
rodata 108004 108004 0 0.0
text 664428 664428 0 0.0
nrf52840dongle_nrf52840 (read/write) 996915 996915 0 0.0
bss 119684 119684 0 0.0
rodata 115380 115380 0 0.0
text 673380 673380 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 890046 890046 0 0.0
bss 115300 115300 0 0.0
rodata 109824 109824 0 0.0
text 584176 584176 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 913079 913079 0 0.0
bss 116876 116876 0 0.0
rodata 104804 104804 0 0.0
text 614000 614000 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 823114 823114 0 0.0
bss 113692 113692 0 0.0
rodata 98012 98012 0 0.0
text 530968 530968 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541779 541779 0 0.0
bss 52588 52588 0 0.0
rodata 50048 50048 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 915863 915863 0 0.0
bss 116632 116632 0 0.0
rodata 105324 105324 0 0.0
text 616456 616456 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 911039 911039 0 0.0
bss 116640 116640 0 0.0
rodata 104428 104428 0 0.0
text 612516 612516 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798379 798379 0 0.0
bss 109772 109772 0 0.0
rodata 78352 78352 0 0.0
text 533752 533752 0 0.0
p6 all-clusters-app default (read/write) 2446768 2446768 0 0.0
.bss 117372 117372 0 0.0
.data 2576 2576 0 0.0
.text 1405032 1405032 0 0.0
light-app default (read/write) 2340368 2340368 0 0.0
.bss 103340 103340 0 0.0
.data 2400 2400 0 0.0
.text 1298632 1298632 0 0.0
lock-app default (read/write) 2305400 2305400 0 0.0
.bss 103060 103060 0 0.0
.data 2360 2360 0 0.0
.text 1263664 1263664 0 0.0
qpg lighting-app qpg6105+debug (read only) 571040 571040 0 0.0
(read/write) 146940 146940 0 0.0
.bss 87488 87488 0 0.0
.data 1056 1056 0 0.0
.text 565720 565720 0 0.0
lock-app qpg6105+debug (read only) 516776 516776 0 0.0
(read/write) 146940 146940 0 0.0
.bss 86928 86928 0 0.0
.data 992 992 0 0.0
.text 511456 511456 0 0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 845406 845406 0 0.0
bss 85540 85540 0 0.0
noinit 37160 37160 0 0.0
text 592178 592178 0 0.0

@andy31415 andy31415 merged commit 11182e6 into project-chip:master Feb 3, 2022
@kpschoedel kpschoedel deleted the include-1 branch February 3, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants