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

[Controller] Update CHIPController to use the Invoke API instead of r… #13371

Conversation

vivien-apple
Copy link
Contributor

…elying on CHIPClusters

Problem

CHIPDeviceController and CHIPDeviceCommissioner stills uses APIs defines into CHIPClusters.cpp. As far as I know this is the last consumer of this code, which forces us to keeps ChipClusters.cpp, ChipClientCallbacks.cpp, some handler code into IMClusterCommandHandler.cpp. So removing it may allow to remove a lot of extra code.

Change overview

  • Replace IM calls to use the Invoke API

src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
@stale
Copy link

stale bot commented Jan 22, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added stale Stale issue or PR and removed stale Stale issue or PR labels Jan 22, 2022
@woody-apple
Copy link
Contributor

Fast tracking, given > 3 days for review.

@vivien-apple
Copy link
Contributor Author

To minimise the amount of changes I have rewritten this PR to "only" contains conversion from CHIPCallback to the InvokeCommand API.

@github-actions
Copy link

github-actions bot commented Jan 28, 2022

PR #13371: Size comparison from 245035c to 8447bc5

Increases above 0.2%:

platform target config section 245035c 8447bc5 change % change
linux chip-tool-ipv6only arm64 (read only) 6767748 6832204 64456 1.0
(read/write) 279201 280161 960 0.3
.data.rel.ro 175984 176424 440 0.3
.got 42784 43304 520 1.2
.rodata 386892 388340 1448 0.4
.text 5808756 5869124 60368 1.0
Increases (1 build for linux)
platform target config section 245035c 8447bc5 change % change
linux chip-tool-ipv6only arm64 (read only) 6767748 6832204 64456 1.0
(read/write) 279201 280161 960 0.3
.data.rel.ro 175984 176424 440 0.3
.got 42784 43304 520 1.2
.rodata 386892 388340 1448 0.4
.text 5808756 5869124 60368 1.0
Full report (31 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 245035c 8447bc5 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 578130 578130 0 0.0
.app_xip_area 484224 484224 0 0.0
.bss 76652 76652 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock-app CYW30739 (read/write) 536142 536142 0 0.0
.app_xip_area 443780 443780 0 0.0
.bss 75148 75148 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 842984 842984 0 0.0
(read/write) 126200 126200 0 0.0
.bss 124296 124296 0 0.0
.data 1900 1900 0 0.0
.text 842976 842976 0 0.0
BRD4161A+rpc (read only) 830336 830336 0 0.0
(read/write) 142856 142856 0 0.0
.bss 140856 140856 0 0.0
.data 2000 2000 0 0.0
.text 830328 830328 0 0.0
window-app BRD4161A (read only) 815560 815560 0 0.0
(read/write) 124852 124852 0 0.0
.bss 122996 122996 0 0.0
.data 1856 1856 0 0.0
.text 815552 815552 0 0.0
k32w light k32w061+release (read/write) 662940 662940 0 0.0
.bss 76428 76428 0 0.0
.data 1868 1868 0 0.0
.text 578844 578844 0 0.0
lock k32w061+release (read/write) 663844 663844 0 0.0
.bss 76692 76692 0 0.0
.data 1892 1892 0 0.0
.text 579460 579460 0 0.0
linux chip-tool-ipv6only arm64 (read only) 6767748 6832204 64456 1.0
(read/write) 279201 280161 960 0.3
.bss 55537 55537 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 175984 176424 440 0.3
.dynamic 560 560 0 0.0
.got 42784 43304 520 1.2
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 386892 388340 1448 0.4
.text 5808756 5869124 60368 1.0
thermostat-no-ble arm64 (read only) 2080748 2080748 0 0.0
(read/write) 149537 149537 0 0.0
.bss 67169 67169 0 0.0
.data 960 960 0 0.0
.data.rel.ro 74288 74288 0 0.0
.dynamic 560 560 0 0.0
.got 4144 4144 0 0.0
.init 24 24 0 0.0
.init_array 336 336 0 0.0
.rodata 129932 129932 0 0.0
.text 1733472 1733472 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2382472 2382472 0 0.0
.bss 188588 188588 0 0.0
.data 5288 5288 0 0.0
.text 1345072 1345072 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2338200 2338200 0 0.0
.bss 179304 179304 0 0.0
.data 5584 5584 0 0.0
.text 1300800 1300800 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2302240 2302240 0 0.0
.bss 179208 179208 0 0.0
.data 5552 5552 0 0.0
.text 1264840 1264840 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) 2292980 2292980 0 0.0
.bss 176532 176532 0 0.0
.data 5384 5384 0 0.0
.text 1255552 1255552 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 981375 981375 0 0.0
bss 119660 119660 0 0.0
rodata 115684 115684 0 0.0
text 668228 668228 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 966923 966923 0 0.0
bss 116704 116704 0 0.0
rodata 107160 107160 0 0.0
text 664672 664672 0 0.0
nrf52840dongle_nrf52840 (read/write) 997459 997459 0 0.0
bss 120832 120832 0 0.0
rodata 114516 114516 0 0.0
text 673656 673656 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 890546 890546 0 0.0
bss 116448 116448 0 0.0
rodata 108964 108964 0 0.0
text 584416 584416 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 913955 913955 0 0.0
bss 118040 118040 0 0.0
rodata 104320 104320 0 0.0
text 614212 614212 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 824006 824006 0 0.0
bss 114856 114856 0 0.0
rodata 97528 97528 0 0.0
text 531172 531172 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) 916819 916819 0 0.0
bss 117792 117792 0 0.0
rodata 104832 104832 0 0.0
text 616748 616748 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 912003 912003 0 0.0
bss 117816 117816 0 0.0
rodata 103936 103936 0 0.0
text 612788 612788 0 0.0
shell nrf52840dk_nrf52840 (read/write) 798203 798203 0 0.0
bss 109776 109776 0 0.0
rodata 78288 78288 0 0.0
text 533640 533640 0 0.0
p6 all-clusters-app default (read/write) 2441752 2441752 0 0.0
.bss 116740 116740 0 0.0
.data 2584 2584 0 0.0
.text 1400016 1400016 0 0.0
light-app default (read/write) 2338568 2338568 0 0.0
.bss 104484 104484 0 0.0
.data 2408 2408 0 0.0
.text 1296832 1296832 0 0.0
lock-app default (read/write) 2304080 2304080 0 0.0
.bss 104228 104228 0 0.0
.data 2360 2360 0 0.0
.text 1262344 1262344 0 0.0
qpg lighting-app qpg6105+debug (read only) 570884 570884 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88640 88640 0 0.0
.data 1060 1060 0 0.0
.text 565564 565564 0 0.0
lock-app qpg6105+debug (read only) 517004 517004 0 0.0
(read/write) 146940 146940 0 0.0
.bss 88112 88112 0 0.0
.data 992 992 0 0.0
.text 511684 511684 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) 845786 845786 0 0.0
bss 86440 86440 0 0.0
noinit 37160 37160 0 0.0
text 592522 592522 0 0.0

@vivien-apple vivien-apple force-pushed the Controller_InvokeInsteadOfChipCluster branch from 8447bc5 to f72f5aa Compare January 28, 2022 18:07
@github-actions
Copy link

github-actions bot commented Jan 28, 2022

PR #13371: Size comparison from c14afc5 to f72f5aa

Increases above 0.2%:

platform target config section c14afc5 f72f5aa change % change
linux chip-tool-ipv6only arm64 (read only) 6787188 6851612 64424 0.9
(read/write) 279985 280945 960 0.3
.got 43072 43592 520 1.2
.rodata 388348 389780 1432 0.4
.text 5824948 5885300 60352 1.0
Increases (1 build for linux)
platform target config section c14afc5 f72f5aa change % change
linux chip-tool-ipv6only arm64 (read only) 6787188 6851612 64424 0.9
(read/write) 279985 280945 960 0.3
.data.rel.ro 176472 176912 440 0.2
.got 43072 43592 520 1.2
.rodata 388348 389780 1432 0.4
.text 5824948 5885300 60352 1.0
Full report (18 builds for cyw30739, efr32, esp32, k32w, linux, p6, qpg, telink)
platform target config section c14afc5 f72f5aa change % change
cyw30739 light cyw930739m2evb_01 (read/write) 578114 578114 0 0.0
.app_xip_area 484208 484208 0 0.0
.bss 76652 76652 0 0.0
.data 596 596 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock-app CYW30739 (read/write) 536142 536142 0 0.0
.app_xip_area 443780 443780 0 0.0
.bss 75148 75148 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
efr32 lighting-app BRD4161A (read only) 842968 842968 0 0.0
(read/write) 126200 126200 0 0.0
.bss 124296 124296 0 0.0
.data 1900 1900 0 0.0
.text 842960 842960 0 0.0
BRD4161A+rpc (read only) 830320 830320 0 0.0
(read/write) 142856 142856 0 0.0
.bss 140856 140856 0 0.0
.data 2000 2000 0 0.0
.text 830312 830312 0 0.0
window-app BRD4161A (read only) 815560 815560 0 0.0
(read/write) 124852 124852 0 0.0
.bss 122996 122996 0 0.0
.data 1856 1856 0 0.0
.text 815552 815552 0 0.0
esp32 all-clusters-app c3devkit (read only) 932920 932920 0 0.0
(read/write) 1397322 1397322 0 0.0
.dram0.bss 69688 69688 0 0.0
.dram0.data 14244 14244 0 0.0
.flash.rodata 194480 194480 0 0.0
.flash.text 932920 932920 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 980827 980827 0 0.0
(read/write) 461692 461692 0 0.0
.dram0.bss 74432 74432 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 221108 221108 0 0.0
.flash.text 975443 975443 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 662940 662940 0 0.0
.bss 76428 76428 0 0.0
.data 1868 1868 0 0.0
.text 578844 578844 0 0.0
lock k32w061+release (read/write) 663844 663844 0 0.0
.bss 76692 76692 0 0.0
.data 1892 1892 0 0.0
.text 579460 579460 0 0.0
linux chip-tool-ipv6only arm64 (read only) 6787188 6851612 64424 0.9
(read/write) 279985 280945 960 0.3
.bss 55537 55537 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 176472 176912 440 0.2
.dynamic 560 560 0 0.0
.got 43072 43592 520 1.2
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 388348 389780 1432 0.4
.text 5824948 5885300 60352 1.0
thermostat-no-ble arm64 (read only) 2080748 2080748 0 0.0
(read/write) 149537 149537 0 0.0
.bss 67169 67169 0 0.0
.data 960 960 0 0.0
.data.rel.ro 74288 74288 0 0.0
.dynamic 560 560 0 0.0
.got 4144 4144 0 0.0
.init 24 24 0 0.0
.init_array 336 336 0 0.0
.rodata 129932 129932 0 0.0
.text 1733472 1733472 0 0.0
p6 all-clusters-app default (read/write) 2441720 2441720 0 0.0
.bss 116740 116740 0 0.0
.data 2584 2584 0 0.0
.text 1399984 1399984 0 0.0
light-app default (read/write) 2338536 2338536 0 0.0
.bss 104484 104484 0 0.0
.data 2408 2408 0 0.0
.text 1296800 1296800 0 0.0
lock-app default (read/write) 2304080 2304080 0 0.0
.bss 104228 104228 0 0.0
.data 2360 2360 0 0.0
.text 1262344 1262344 0 0.0
qpg lighting-app qpg6105+debug (read only) 570868 570868 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88640 88640 0 0.0
.data 1060 1060 0 0.0
.text 565548 565548 0 0.0
lock-app qpg6105+debug (read only) 517004 517004 0 0.0
(read/write) 146940 146940 0 0.0
.bss 88112 88112 0 0.0
.data 992 992 0 0.0
.text 511684 511684 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) 845778 845778 0 0.0
bss 86440 86440 0 0.0
noinit 37160 37160 0 0.0
text 592512 592512 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit f24e6f1 into project-chip:master Jan 29, 2022
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.

5 participants