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

SystemLayerImplSelect: add libev support; CHIP_SYSTEM_CONFIG_USE_LIBEV #24232

Merged

Conversation

plan44
Copy link
Contributor

@plan44 plan44 commented Jan 3, 2023

[Note: this is a rebased version of #22043, which was closed by stalebot despite ongoing discussion. Details were discussed there already and led to this cleaned up and now 3month field tested version]

When CHIP_SYSTEM_CONFIG_USE_LIBEV is set, SystemLayerImplSelect expects a libev [1] mainloop to be present to schedule timers and socket watches (similar to CHIP_SYSTEM_CONFIG_USE_DISPATCH for Darwin).

A libev mainloop must be passed to SystemLayer using SetLibEvLoop() before any timers or socket watches are used - otherwise, chipDie() is invoked.

Usage

The entire project needs to be built with CHIP_SYSTEM_CONFIG_USE_LIBEV=1 (this can be done via invoking a project-specific extra config via the default_configs_extra argument in args.gni)

Setting up the libev mainloop and handing it over to SystemLayer must be done in application specific code, outside the code provided by chip examples. Also adding libev as a dependency must be done in the application's BUILD.gn.

Background

libev is a multi-platform event library often used in embedded linux context to handle events, and builds the basis for various libraries with non-blocking APIs. This changeset allows using the connectedhomeip stack with libev based applications.
In particular, CHIP_SYSTEM_CONFIG_USE_LIBEV=1 is in active use and real-world testing by the p44mbrd [2] opensource matter bridge project running mainly on openwrt linux devices.

Testing

  • verified with regular chip-tool builds for linux and darwin that change does not affect builds with CHIP_SYSTEM_CONFIG_USE_LIBEV not set.
  • tested with p44mbrd [2] which bases on libev and sets CHIP_SYSTEM_CONFIG_USE_LIBEV=1: chip timer and socket watches work the same way as with select or dispatch based applications.

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

PR #24232: Size comparison from 9a1c31c to 8c122eb

Increases (8 builds for bl602, bl702, cc13x2_26x2, psoc6, telink)
platform target config section 9a1c31c 8c122eb change % change
bl602 lighting-app bl602+rpc .text 1070614 1070616 2 0.0
bl702 lighting-app bl702+rpc .debug_info 43480352 43480353 1 0.0
.text 1030860 1030862 2 0.0
cc13x2_26x2 lock-ftd LP_CC2652R7 (read/write) 171592 171600 8 0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 27060316 27060317 1 0.0
lock cy8ckit_062s2_43012 .debug_info 22478113 22478114 1 0.0
telink all-clusters-app tlsr9518adk80d (read/write) 1071556 1071564 8 0.0
text 726280 726282 2 0.0
all-clusters-minimal-app tlsr9518adk80d text 691436 691438 2 0.0
lighting-app tlsr9518adk80d text 703822 703824 2 0.0
Decreases (9 builds for bl702, cc13x2_26x2, esp32, nrfconnect, psoc6, qpg, telink)
platform target config section 9a1c31c 8c122eb change % change
bl702 lighting-app bl702 .debug_line 5162847 5162846 -1 -0.0
bl702+rpc .debug_line 5552342 5552341 -1 -0.0
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 677415 677407 -8 -0.0
.text 599520 599512 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1219472 1219470 -2 -0.0
.flash.text 1219472 1219470 -2 -0.0
nrfconnect all-clusters-app nrf7002dk_nrf5340_cpuapp (read/write) 1349822 1349806 -16 -0.0
text 755954 755950 -4 -0.0
psoc6 all-clusters-minimal cy8ckit_062s2_43012 .debug_info 26797115 26797114 -1 -0.0
qpg lock-app qpg6105+debug (read/write) 1117556 1117548 -8 -0.0
.text 564652 564644 -8 -0.0
telink light-switch-app tlsr9518adk80d text 638046 638044 -2 -0.0
ota-requestor-app tlsr9518adk80d (read/write) 945900 945892 -8 -0.0
text 649302 649300 -2 -0.0
Full report (53 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section 9a1c31c 8c122eb change % change
bl602 lighting-app bl602 (read/write) 1356434 1356434 0 0.0
.bss 86977 86977 0 0.0
.data 9984 9984 0 0.0
.text 1039192 1039192 0 0.0
bl602+rpc (read/write) 1402218 1402218 0 0.0
.bss 95017 95017 0 0.0
.data 10384 10384 0 0.0
.text 1070614 1070616 2 0.0
bl702 lighting-app bl702 (read only) 3262 3262 0 0.0
(read/write) 1196351 1196351 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 67102 67102 0 0.0
.bss_psram 30048 30048 0 0.0
.comment 48 48 0 0.0
.data 4048 4048 0 0.0
.debug_abbrev 1529044 1529044 0 0.0
.debug_aranges 132568 132568 0 0.0
.debug_frame 486476 486476 0 0.0
.debug_info 39187934 39187934 0 0.0
.debug_line 5162847 5162846 -1 -0.0
.debug_loc 3381394 3381394 0 0.0
.debug_ranges 363816 363816 0 0.0
.debug_str 3483437 3483437 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 144 144 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 116400 116400 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 569377 569377 0 0.0
.symtab 172160 172160 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
956882 956882 0 0.0
bl702+rpc (read only) 3262 3262 0 0.0
(read/write) 1284827 1284827 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 75118 75118 0 0.0
.bss_psram 30304 30304 0 0.0
.comment 48 48 0 0.0
.data 4576 4576 0 0.0
.debug_abbrev 1676376 1676376 0 0.0
.debug_aranges 140688 140688 0 0.0
.debug_frame 513896 513896 0 0.0
.debug_info 43480352 43480353 1 0.0
.debug_line 5552342 5552341 -1 -0.0
.debug_loc 3576086 3576086 0 0.0
.debug_ranges 387352 387352 0 0.0
.debug_str 3885835 3885835 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 160 160 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 130144 130144 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 629661 629661 0 0.0
.symtab 190336 190336 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
1030860 1030862 2 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 679883 679883 0 0.0
(read/write) 171564 171564 0 0.0
.bss 81140 81140 0 0.0
.data 3380 3380 0 0.0
.rodata 89995 89995 0 0.0
.text 589576 589576 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 644139 644139 0 0.0
(read/write) 157916 157916 0 0.0
.bss 80420 80420 0 0.0
.data 3380 3380 0 0.0
.rodata 79139 79139 0 0.0
.text 564680 564680 0 0.0
lock-ftd LP_CC2652R7 (read only) 677415 677407 -8 -0.0
(read/write) 171592 171600 8 0.0
.bss 78788 78788 0 0.0
.data 3304 3304 0 0.0
.rodata 77415 77415 0 0.0
.text 599520 599512 -8 -0.0
lock-mtd LP_CC2652R7 (read only) 662203 662203 0 0.0
(read/write) 182068 182068 0 0.0
.bss 74052 74052 0 0.0
.data 3304 3304 0 0.0
.rodata 103507 103507 0 0.0
.text 558216 558216 0 0.0
pump-app LP_CC2652R7 (read only) 690439 690439 0 0.0
(read/write) 159304 159304 0 0.0
.bss 78756 78756 0 0.0
.data 3296 3296 0 0.0
.rodata 91031 91031 0 0.0
.text 598924 598924 0 0.0
pump-controller-app LP_CC2652R7 (read only) 674363 674363 0 0.0
(read/write) 175484 175484 0 0.0
.bss 78860 78860 0 0.0
.data 3292 3292 0 0.0
.rodata 86587 86587 0 0.0
.text 587296 587296 0 0.0
shell LP_CC2652R7 (read only) 671106 671106 0 0.0
(read/write) 182668 182668 0 0.0
.bss 83468 83468 0 0.0
.data 3376 3376 0 0.0
.rodata 86738 86738 0 0.0
.text 584052 584052 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 588482 588482 0 0.0
.app_xip_area 464828 464828 0 0.0
.bss 66112 66112 0 0.0
.data 728 728 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592310 592310 0 0.0
.app_xip_area 463360 463360 0 0.0
.bss 71400 71400 0 0.0
.data 736 736 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 551854 551854 0 0.0
.app_xip_area 433696 433696 0 0.0
.bss 60656 60656 0 0.0
.data 684 684 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rpc (read/write) 976468 976468 0 0.0
.bss 152172 152172 0 0.0
.data 2168 2168 0 0.0
.text 822108 822108 0 0.0
BRD4161A+rs911x (read/write) 1038920 1038920 0 0.0
.bss 186648 186648 0 0.0
.data 2012 2012 0 0.0
.text 850240 850240 0 0.0
BRD4187C (read/write) 1149948 1149948 0 0.0
.bss 138568 138568 0 0.0
.data 2516 2516 0 0.0
.text 984268 984268 0 0.0
lock-app BRD4161A+wf200 (read/write) 1069152 1069152 0 0.0
.bss 158184 158184 0 0.0
.data 2020 2020 0 0.0
.text 908924 908924 0 0.0
window-app BRD4187C (read/write) 1142592 1142592 0 0.0
.bss 139984 139984 0 0.0
.data 2540 2540 0 0.0
.text 975472 975472 0 0.0
esp32 all-clusters-app c3devkit (read only) 1219472 1219470 -2 -0.0
(read/write) 1790954 1790954 0 0.0
.dram0.bss 76912 76912 0 0.0
.dram0.data 13928 13928 0 0.0
.flash.rodata 248392 248392 0 0.0
.flash.text 1219472 1219470 -2 -0.0
.iram0.text 71188 71188 0 0.0
m5stack (read only) 1233407 1233407 0 0.0
(read/write) 564187 564187 0 0.0
.dram0.bss 82064 82064 0 0.0
.dram0.data 34224 34224 0 0.0
.flash.rodata 314180 314180 0 0.0
.flash.text 1228023 1228023 0 0.0
.iram0.text 124803 124803 0 0.0
k32w contact k32w0+release (read/write) 662716 662716 0 0.0
.bss 77032 77032 0 0.0
.data 2104 2104 0 0.0
.text 564468 564468 0 0.0
light k32w0+release (read/write) 673400 673400 0 0.0
.bss 74824 74824 0 0.0
.data 2060 2060 0 0.0
.text 593788 593788 0 0.0
lock k32w0+release (read/write) 634244 634244 0 0.0
.bss 75584 75584 0 0.0
.data 2080 2080 0 0.0
.text 553852 553852 0 0.0
linux all-clusters-app debug (read only) 3114537 3114537 0 0.0
(read/write) 158600 158600 0 0.0
.bss 62464 62464 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 87240 87240 0 0.0
.dynamic 608 608 0 0.0
.got 4768 4768 0 0.0
.init 27 27 0 0.0
.init_array 1184 1184 0 0.0
.rodata 281611 281611 0 0.0
.text 2648242 2648242 0 0.0
all-clusters-minimal-app debug (read only) 2938137 2938137 0 0.0
(read/write) 150000 150000 0 0.0
.bss 61664 61664 0 0.0
.data 2272 2272 0 0.0
.data.rel.ro 79608 79608 0 0.0
.dynamic 608 608 0 0.0
.got 4680 4680 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 281035 281035 0 0.0
.text 2475458 2475458 0 0.0
bridge-app debug (read only) 2497209 2497209 0 0.0
(read/write) 133120 133120 0 0.0
.bss 52544 52544 0 0.0
.data 3792 3792 0 0.0
.data.rel.ro 70696 70696 0 0.0
.dynamic 608 608 0 0.0
.got 4600 4600 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 212320 212320 0 0.0
.text 2113106 2113106 0 0.0
chip-tool debug (read only) 11182713 11182713 0 0.0
(read/write) 646808 646808 0 0.0
.bss 25912 25912 0 0.0
.data 2754 2754 0 0.0
.data.rel.ro 611568 611568 0 0.0
.dynamic 608 608 0 0.0
.got 5184 5184 0 0.0
.init 27 27 0 0.0
.init_array 728 728 0 0.0
.rodata 605029 605029 0 0.0
.text 9078820 9078820 0 0.0
chip-tool-ipv6only arm64 (read only) 10595932 10595932 0 0.0
(read/write) 695928 695928 0 0.0
.bss 33912 33912 0 0.0
.data 2768 2768 0 0.0
.data.rel.ro 640376 640376 0 0.0
.dynamic 560 560 0 0.0
.got 13832 13832 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 535180 535180 0 0.0
.text 8412948 8412948 0 0.0
lighting-app debug+rpc (read only) 2664337 2664337 0 0.0
(read/write) 132488 132488 0 0.0
.bss 49984 49984 0 0.0
.data 2288 2288 0 0.0
.data.rel.ro 74024 74024 0 0.0
.dynamic 608 608 0 0.0
.got 4632 4632 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 228224 228224 0 0.0
.text 2259362 2259362 0 0.0
lock-app debug (read only) 2623465 2623465 0 0.0
(read/write) 127472 127472 0 0.0
.bss 48416 48416 0 0.0
.data 1904 1904 0 0.0
.data.rel.ro 70936 70936 0 0.0
.dynamic 608 608 0 0.0
.got 4664 4664 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 244488 244488 0 0.0
.text 2207074 2207074 0 0.0
ota-provider-app debug (read only) 2197337 2197337 0 0.0
(read/write) 105904 105904 0 0.0
.bss 46592 46592 0 0.0
.data 2080 2080 0 0.0
.data.rel.ro 52120 52120 0 0.0
.dynamic 608 608 0 0.0
.got 3728 3728 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 195784 195784 0 0.0
.text 1861650 1861650 0 0.0
ota-requestor-app debug (read only) 2358841 2358841 0 0.0
(read/write) 113952 113952 0 0.0
.bss 49088 49088 0 0.0
.data 2448 2448 0 0.0
.data.rel.ro 57208 57208 0 0.0
.dynamic 608 608 0 0.0
.got 3728 3728 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 202512 202512 0 0.0
.text 2007426 2007426 0 0.0
shell debug (read only) 2646993 2646993 0 0.0
(read/write) 143064 143064 0 0.0
.bss 57864 57864 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 78136 78136 0 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 1032 1032 0 0.0
.rodata 239858 239858 0 0.0
.text 2247426 2247426 0 0.0
thermostat-no-ble arm64 (read only) 2478044 2478044 0 0.0
(read/write) 145016 145016 0 0.0
.bss 55336 55336 0 0.0
.data 1816 1816 0 0.0
.data.rel.ro 78640 78640 0 0.0
.dynamic 560 560 0 0.0
.got 5192 5192 0 0.0
.init 24 24 0 0.0
.init_array 432 432 0 0.0
.rodata 149560 149560 0 0.0
.text 2067888 2067888 0 0.0
tv-app debug (read only) 3286737 3286737 0 0.0
(read/write) 262312 262312 0 0.0
.bss 170808 170808 0 0.0
.data 4256 4256 0 0.0
.data.rel.ro 80544 80544 0 0.0
.dynamic 608 608 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 1064 1064 0 0.0
.rodata 268856 268856 0 0.0
.text 2823554 2823554 0 0.0
tv-casting-app debug (read only) 5645937 5645937 0 0.0
(read/write) 162672 162672 0 0.0
.bss 52184 52184 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 101960 101960 0 0.0
.dynamic 608 608 0 0.0
.got 4920 4920 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 359321 359321 0 0.0
.text 5009026 5009026 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2463832 2463832 0 0.0
.bss 214932 214932 0 0.0
.data 5872 5872 0 0.0
.text 1426476 1426476 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1179071 1179071 0 0.0
bss 145205 145205 0 0.0
rodata 136900 136900 0 0.0
text 815854 815854 0 0.0
nrf7002dk_nrf5340_cpuapp (read/write) 1349822 1349806 -16 -0.0
bss 105144 105144 0 0.0
rodata 204212 204212 0 0.0
text 755954 755950 -4 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1124719 1124719 0 0.0
bss 144440 144440 0 0.0
rodata 113220 113220 0 0.0
text 786010 786010 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 842056 842056 0 0.0
(read/write) 1749660 1749660 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188624 188624 0 0.0
.comment 200 200 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1238156 1238156 0 0.0
.debug_aranges 110768 110768 0 0.0
.debug_frame 371956 371956 0 0.0
.debug_info 27060316 27060317 1 0.0
.debug_line 3720067 3720067 0 0.0
.debug_loc 3624770 3624770 0 0.0
.debug_ranges 346584 346584 0 0.0
.debug_str 3453864 3453864 0 0.0
.heap 842056 842056 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 572205 572205 0 0.0
.symtab 422128 422128 0 0.0
.text 1549984 1549984 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842784 842784 0 0.0
(read/write) 1692188 1692188 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187896 187896 0 0.0
.comment 200 200 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1230047 1230047 0 0.0
.debug_aranges 110240 110240 0 0.0
.debug_frame 375012 375012 0 0.0
.debug_info 26797115 26797114 -1 -0.0
.debug_line 3738965 3738965 0 0.0
.debug_loc 3612376 3612376 0 0.0
.debug_ranges 345200 345200 0 0.0
.debug_str 3442876 3442876 0 0.0
.heap 842784 842784 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 536294 536294 0 0.0
.symtab 408560 408560 0 0.0
.text 1493240 1493240 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 850976 850976 0 0.0
(read/write) 1610404 1610404 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 179912 179912 0 0.0
.comment 200 200 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1064846 1064846 0 0.0
.debug_aranges 102440 102440 0 0.0
.debug_frame 345344 345344 0 0.0
.debug_info 22259724 22259724 0 0.0
.debug_line 3303995 3303995 0 0.0
.debug_loc 3310296 3310296 0 0.0
.debug_ranges 309336 309336 0 0.0
.debug_str 3248462 3248462 0 0.0
.heap 850976 850976 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 472619 472619 0 0.0
.symtab 376928 376928 0 0.0
.text 1419648 1419648 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 845984 845984 0 0.0
(read/write) 1644356 1644356 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184888 184888 0 0.0
.comment 200 200 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1066756 1066756 0 0.0
.debug_aranges 102824 102824 0 0.0
.debug_frame 347144 347144 0 0.0
.debug_info 22478113 22478114 1 0.0
.debug_line 3305102 3305102 0 0.0
.debug_loc 3331730 3331730 0 0.0
.debug_ranges 311192 311192 0 0.0
.debug_str 3264300 3264300 0 0.0
.heap 845984 845984 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 475336 475336 0 0.0
.symtab 378928 378928 0 0.0
.text 1448608 1448608 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1151236 1151236 0 0.0
.bss 100348 100348 0 0.0
.data 840 840 0 0.0
.text 598336 598336 0 0.0
lock-app qpg6105+debug (read/write) 1117556 1117548 -8 -0.0
.bss 95828 95828 0 0.0
.data 836 836 0 0.0
.text 564652 564644 -8 -0.0
telink all-clusters-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1071556 1071564 8 0.0
bss 98856 98856 0 0.0
text 726280 726282 2 0.0
all-clusters-minimal-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1010856 1010856 0 0.0
bss 98080 98080 0 0.0
text 691436 691438 2 0.0
light-switch-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 932296 932296 0 0.0
bss 90320 90320 0 0.0
text 638046 638044 -2 -0.0
lighting-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1010264 1010264 0 0.0
bss 98380 98380 0 0.0
text 703822 703824 2 0.0
ota-requestor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 945900 945892 -8 -0.0
bss 91276 91276 0 0.0
text 649302 649300 -2 -0.0
thermostat tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 935460 935460 0 0.0
bss 91712 91712 0 0.0
text 638746 638746 0 0.0

@plan44
Copy link
Contributor Author

plan44 commented May 17, 2023

Writing because stalebot threatens to close the issue... What are the actual roadblocks here?

While I agree with @andy31415 that separating darwin/posix/libev would be the mid term goal in this area, that should not really kill the libev integration in the current state. The libev #ifdefs are not uglier than the Darwin ones are.

The code itself is running fine and runs fine on top of recent master. Would it help to rebase the PR to current master?

@stale stale bot removed the stale Stale issue or PR label May 17, 2023
@bzbarsky-apple
Copy link
Contributor

@plan44 Looks like the main blockers are dealing with the above comments (e.g. filing issues to track them, since they did not seem to block the review) and getting a non-Google review (which I can work on).

@github-actions
Copy link

github-actions bot commented May 27, 2023

PR #24232: Size comparison from bd43948 to 467b86b

Increases (1 build for cc32xx)
platform target config section bd43948 467b86b change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 22897546 22897547 1 0.0
Decreases (2 builds for cc32xx, nrfconnect)
platform target config section bd43948 467b86b change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_line 2871877 2871873 -4 -0.0
nrfconnect all-clusters-app nrf7002dk_nrf5340_cpuapp text 779308 779304 -4 -0.0
Full report (5 builds for cc32xx, mbed, nrfconnect)
platform target config section bd43948 467b86b change % change
cc32xx lock CC3235SF_LAUNCHXL (blank) 0 0 0 0.0
(read only) 605850 605850 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 955072 955072 0 0.0
.debug_aranges 118056 118056 0 0.0
.debug_frame 403192 403192 0 0.0
.debug_info 22897546 22897547 1 0.0
.debug_line 2871877 2871873 -4 -0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1720070 1720070 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 107117 107117 0 0.0
.debug_str 3768376 3768376 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104402 104402 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 484235 484235 0 0.0
.symtab 287456 287456 0 0.0
.text 499328 499328 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2495496 2495496 0 0.0
.bss 216304 216304 0 0.0
.data 5144 5144 0 0.0
.text 1458180 1458180 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1178244 1178244 0 0.0
bss 155643 155643 0 0.0
rodata 133220 133220 0 0.0
text 808696 808696 0 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1437988 1437988 0 0.0
bss 135383 135383 0 0.0
rodata 229236 229236 0 0.0
text 779308 779304 -4 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1124332 1124332 0 0.0
bss 154784 154784 0 0.0
rodata 109900 109900 0 0.0
text 778944 778944 0 0.0

@github-actions
Copy link

github-actions bot commented May 27, 2023

PR #24232: Size comparison from bd43948 to 80ada61

Increases (9 builds for bl602, cc32xx, esp32, k32w, psoc6, telink)
platform target config section bd43948 80ada61 change % change
bl602 lighting-app bl602 (read/write) 1356558 1356566 8 0.0
.text 1036624 1036626 2 0.0
bl602+rpc .text 1067980 1067982 2 0.0
cc32xx lock CC3235SF_LAUNCHXL .debug_info 22897546 2289754 2 0.0
esp32 all-clusters-app c3devkit (read only) 1054396 1054400 4 0.0
(read/write) 1583992 1584000 8 0.0
.flash.rodata 213680 213688 8 0.0
.flash.text 1054396 1054400 4 0.0
k32w contact k32w0+release (read only) 583628 583644 16 0.0
.text 583092 583108 16 0.0
psoc6 lock cy8ckit_062s2_43012 .debug_info 25853002 25853003 1 0.0
telink all-clusters-minimal-app tlsr9518adk80d text 651014 651018 4 0.0
lighting-app-factory-data tlsr9518adk80d (read/write) 953760 953768 8 0.0
text 665164 665166 2 0.0
lock-app tlsr9518adk80d text 612000 612002 2 0.0
Decreases (16 builds for bl702, cc13x4_26x4, cc32xx, efr32, psoc6, telink)
platform target config section bd43948 80ada61 change % change
bl702 lighting-app bl702+rpc .debug_info 49712702 49712701 -1 -0.0
.text 1040214 1040212 -2 -0.0
cc13x4_26x4 lock-ftd LP_EM_CC1354P10_6 (read only) 739287 739279 -8 -0.0
.text 662540 662532 -8 -0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 666275 666267 -8 -0.0
.text 593156 593148 -8 -0.0
cc32xx lock CC3235SF_LAUNCHXL .debug_line 2871877 2871873 -4 -0.0
efr32 lock-app BRD4161A+wf200 (read/write) 1068896 1068888 -8 -0.0
.text 892580 892572 -8 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_line 3970884 3970880 -4 -0.0
all-clusters-minimal cy8ckit_062s2_43012 .debug_info 31053695 31053694 -1 -0.0
.debug_line 3984044 3984040 -4 -0.0
light cy8ckit_062s2_43012 .debug_line 3545143 3545139 -4 -0.0
lock cy8ckit_062s2_43012 .debug_line 3541623 3541619 -4 -0.0
telink bridge-app tlsr9518adk80d text 640656 640654 -2 -0.0
contact-sensor-app tlsr9518adk80d text 583334 583332 -2 -0.0
lighting-app tlsr9518adk80d text 657646 657644 -2 -0.0
lighting-app-rpc tlsr9518adk80d (read/write) 1010820 1010812 -8 -0.0
text 702106 702102 -4 -0.0
pump-app tlsr9518adk80d text 589512 589510 -2 -0.0
temperature-measurement-app tlsr9518adk80d text 575344 575340 -4 -0.0
thermostat tlsr9518adk80d text 600118 600116 -2 -0.0
Full report (66 builds for bl602, bl702, cc13x2_26x2, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section bd43948 80ada61 change % change
bl602 lighting-app bl602 (read/write) 1356558 1356566 8 0.0
.bss 87886 87886 0 0.0
.data 9648 9648 0 0.0
.text 1036624 1036626 2 0.0
bl602+rpc (read/write) 1402834 1402834 0 0.0
.bss 95934 95934 0 0.0
.data 10040 10040 0 0.0
.text 1067980 1067982 2 0.0
bl702 lighting-app bl702 (read only) 3358 3358 0 0.0
(read/write) 1188335 1188335 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 67585 67585 0 0.0
.bss_psram 24656 24656 0 0.0
.comment 48 48 0 0.0
.data 3952 3952 0 0.0
.debug_abbrev 1555681 1555681 0 0.0
.debug_aranges 148824 148824 0 0.0
.debug_frame 547952 547952 0 0.0
.debug_info 44764718 44764718 0 0.0
.debug_line 5588679 5588679 0 0.0
.debug_loc 3813354 3813354 0 0.0
.debug_ranges 393104 393104 0 0.0
.debug_str 4329351 4329351 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 140 140 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 107232 107232 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 582494 582494 0 0.0
.symtab 175632 175632 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 0 0 0 0.0
966826 966826 0 0.0
bl702+rpc (read only) 3358 3358 0 0.0
(read/write) 1277155 1277155 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 75633 75633 0 0.0
.bss_psram 25056 25056 0 0.0
.comment 48 48 0 0.0
.data 4504 4504 0 0.0
.debug_abbrev 1714664 1714664 0 0.0
.debug_aranges 157112 157112 0 0.0
.debug_frame 575964 575964 0 0.0
.debug_info 49712702 49712701 -1 -0.0
.debug_line 6004596 6004596 0 0.0
.debug_loc 4016035 4016035 0 0.0
.debug_ranges 418464 418464 0 0.0
.debug_str 4754868 4754868 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 156 156 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 121328 121328 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 643814 643814 0 0.0
.symtab 194128 194128 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 0 0 0 0.0
1040214 1040212 -2 -0.0
cc13x2_26x2 lock-mtd LP_CC2652R7 (read only) 658123 658123 0 0.0
(read/write) 158713 158713 0 0.0
.bss 80376 80376 0 0.0
.data 3272 3272 0 0.0
.rodata 77115 77115 0 0.0
.text 580516 580516 0 0.0
pump-app LP_CC2652R7 (read only) 648839 648839 0 0.0
(read/write) 153177 153177 0 0.0
.bss 74600 74600 0 0.0
.data 3264 3264 0 0.0
.rodata 79695 79695 0 0.0
.text 568656 568656 0 0.0
pump-controller-app LP_CC2652R7 (read only) 634343 634343 0 0.0
(read/write) 153317 153317 0 0.0
.bss 74744 74744 0 0.0
.data 3260 3260 0 0.0
.rodata 75575 75575 0 0.0
.text 558280 558280 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 (read only) 747267 747267 0 0.0
(read/write) 170152 170152 0 0.0
.bss 92488 92488 0 0.0
.data 3464 3464 0 0.0
.rodata 79687 79687 0 0.0
.text 667192 667192 0 0.0
lock-ftd LP_EM_CC1354P10_6 (read only) 739287 739279 -8 -0.0
(read/write) 175372 175372 0 0.0
.bss 97712 97712 0 0.0
.data 3460 3460 0 0.0
.rodata 76355 76355 0 0.0
.text 662540 662532 -8 -0.0
lock-mtd LP_EM_CC1354P10_6 (read only) 727419 727419 0 0.0
(read/write) 169980 169980 0 0.0
.bss 92320 92320 0 0.0
.data 3460 3460 0 0.0
.rodata 102319 102319 0 0.0
.text 624712 624712 0 0.0
pump-app LP_EM_CC1354P10_6 (read only) 680819 680819 0 0.0
(read/write) 164444 164444 0 0.0
.bss 86544 86544 0 0.0
.data 3452 3452 0 0.0
.rodata 76879 76879 0 0.0
.text 603548 603548 0 0.0
pump-controller-app LP_EM_CC1354P10_6 (read only) 666275 666267 -8 -0.0
(read/write) 164576 164576 0 0.0
.bss 86688 86688 0 0.0
.data 3448 3448 0 0.0
.rodata 72727 72727 0 0.0
.text 593156 593148 -8 -0.0
cc32xx lock CC3235SF_LAUNCHXL (blank) 0 0 0 0.0
(read only) 605850 605850 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 955072 955072 0 0.0
.debug_aranges 118056 118056 0 0.0
.debug_frame 403192 403192 0 0.0
.debug_info 22897546 2289754 2 0.0
.debug_line 2871877 2871873 -4 -0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1720070 1720070 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 107117 107117 0 0.0
.debug_str 3768376 3768376 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104402 104402 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 484235 484235 0 0.0
.symtab 287456 287456 0 0.0
.text 499328 499328 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 524483 524483 0 0.0
.app_xip_area 417277 417277 0 0.0
.bss 62184 62184 0 0.0
.data 712 712 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 529187 529187 0 0.0
.app_xip_area 416677 416677 0 0.0
.bss 67480 67480 0 0.0
.data 720 720 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 566355 566355 0 0.0
.app_xip_area 459909 459909 0 0.0
.bss 61472 61472 0 0.0
.data 668 668 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 530987 530987 0 0.0
.app_xip_area 421973 421973 0 0.0
.bss 63960 63960 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rs9116 (read/write) 964396 964396 0 0.0
.bss 179680 179680 0 0.0
.data 2136 2136 0 0.0
.text 782560 782560 0 0.0
BRD4187C (read/write) 1001008 1001008 0 0.0
.bss 159412 159412 0 0.0
.data 2780 2780 0 0.0
.text 838796 838796 0 0.0
lock-app BRD4161A+wf200 (read/write) 1068896 1068888 -8 -0.0
.bss 174144 174144 0 0.0
.data 2152 2152 0 0.0
.text 892580 892572 -8 -0.0
window-app BRD4187C (read/write) 1076340 1076340 0 0.0
.bss 143884 143884 0 0.0
.data 2676 2676 0 0.0
.text 929760 929760 0 0.0
esp32 all-clusters-app c3devkit (read only) 1054396 1054400 4 0.0
(read/write) 1583992 1584000 8 0.0
.dram0.bss 77216 77216 0 0.0
.dram0.data 13964 13964 0 0.0
.flash.rodata 213680 213688 8 0.0
.flash.text 1054396 1054400 4 0.0
.iram0.text 76538 76538 0 0.0
m5stack (read only) 1101711 1101711 0 0.0
(read/write) 493150 493150 0 0.0
.dram0.bss 82232 82232 0 0.0
.dram0.data 34300 34300 0 0.0
.flash.rodata 241464 241464 0 0.0
.flash.text 1096327 1096327 0 0.0
.iram0.text 126055 126055 0 0.0
k32w contact k32w0+release (read only) 583628 583644 16 0.0
(read/write) 82704 82704 0 0.0
.bss 65888 65888 0 0.0
.data 2192 2192 0 0.0
.text 583092 583108 16 0.0
light k32w0+release (read only) 582588 582588 0 0.0
(read/write) 82356 82356 0 0.0
.bss 65552 65552 0 0.0
.data 2180 2180 0 0.0
.text 582052 582052 0 0.0
lock k32w0+release (read only) 556076 556076 0 0.0
(read/write) 80352 80352 0 0.0
.bss 63624 63624 0 0.0
.data 2104 2104 0 0.0
.text 555540 555540 0 0.0
linux all-clusters-app debug (read only) 3150637 3150637 0 0.0
(read/write) 153064 153064 0 0.0
.bss 60224 60224 0 0.0
.data 2160 2160 0 0.0
.data.rel.ro 84176 84176 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 1120 1120 0 0.0
.rodata 231048 231048 0 0.0
.text 2733445 2733445 0 0.0
all-clusters-minimal-app debug (read only) 2958477 2958477 0 0.0
(read/write) 145856 145856 0 0.0
.bss 59328 59328 0 0.0
.data 2128 2128 0 0.0
.data.rel.ro 78000 78000 0 0.0
.dynamic 608 608 0 0.0
.got 4664 4664 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 224360 224360 0 0.0
.text 2551653 2551653 0 0.0
bridge-app debug (read only) 2518349 2518349 0 0.0
(read/write) 129648 129648 0 0.0
.bss 50232 50232 0 0.0
.data 3824 3824 0 0.0
.data.rel.ro 69608 69608 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 784 784 0 0.0
.rodata 173256 173256 0 0.0
.text 2172773 2172773 0 0.0
chip-tool debug (read only) 15461145 15461145 0 0.0
(read/write) 704680 704680 0 0.0
.bss 26424 26424 0 0.0
.data 3042 3042 0 0.0
.data.rel.ro 668424 668424 0 0.0
.dynamic 608 608 0 0.0
.got 5360 5360 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 683509 683509 0 0.0
.text 13142452 13142452 0 0.0
chip-tool-ipv6only arm64 (read only) 14792452 14792452 0 0.0
(read/write) 757512 757512 0 0.0
.bss 34408 34408 0 0.0
.data 3008 3008 0 0.0
.data.rel.ro 698200 698200 0 0.0
.dynamic 560 560 0 0.0
.got 16656 16656 0 0.0
.init 24 24 0 0.0
.init_array 224 224 0 0.0
.rodata 619608 619608 0 0.0
.text 12380564 12380564 0 0.0
dynamic-bridge-app-ipv6only debug (read only) 2581997 2581997 0 0.0
(read/write) 126840 126840 0 0.0
.bss 47544 47544 0 0.0
.data 2864 2864 0 0.0
.data.rel.ro 70192 70192 0 0.0
.dynamic 624 624 0 0.0
.got 4800 4800 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 175976 175976 0 0.0
.text 2228661 2228661 0 0.0
lighting-app debug+rpc+ui (read only) 3267577 3267577 0 0.0
(read/write) 134048 134048 0 0.0
.bss 49088 49088 0 0.0
.data 2704 2704 0 0.0
.data.rel.ro 75416 75416 0 0.0
.dynamic 656 656 0 0.0
.got 5264 5264 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 284884 284884 0 0.0
.text 2788994 2788994 0 0.0
lock-app debug (read only) 2658533 2658533 0 0.0
(read/write) 123624 123624 0 0.0
.bss 45952 45952 0 0.0
.data 1904 1904 0 0.0
.data.rel.ro 69648 69648 0 0.0
.dynamic 608 608 0 0.0
.got 4648 4648 0 0.0
.init 27 27 0 0.0
.init_array 832 832 0 0.0
.rodata 206312 206312 0 0.0
.text 2279525 2279525 0 0.0
ota-provider-app debug (read only) 2209469 2209469 0 0.0
(read/write) 103672 103672 0 0.0
.bss 44528 44528 0 0.0
.data 2112 2112 0 0.0
.data.rel.ro 51944 51944 0 0.0
.dynamic 608 608 0 0.0
.got 3800 3800 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 154408 154408 0 0.0
.text 1913541 1913541 0 0.0
ota-requestor-app debug (read only) 2377013 2377013 0 0.0
(read/write) 111464 111464 0 0.0
.bss 46960 46960 0 0.0
.data 2512 2512 0 0.0
.data.rel.ro 56800 56800 0 0.0
.dynamic 608 608 0 0.0
.got 3784 3784 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 158472 158472 0 0.0
.text 2068149 2068149 0 0.0
shell debug (read only) 2687257 2687257 0 0.0
(read/write) 141488 141488 0 0.0
.bss 59176 59176 0 0.0
.data 1232 1232 0 0.0
.data.rel.ro 75240 75240 0 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 1056 1056 0 0.0
.rodata 199570 199570 0 0.0
.text 2325474 2325474 0 0.0
thermostat-no-ble arm64 (read only) 2537388 2537388 0 0.0
(read/write) 142696 142696 0 0.0
.bss 53496 53496 0 0.0
.data 1736 1736 0 0.0
.data.rel.ro 77960 77960 0 0.0
.dynamic 560 560 0 0.0
.got 5416 5416 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 129288 129288 0 0.0
.text 2146228 2146228 0 0.0
tv-app debug (read only) 3314545 3314545 0 0.0
(read/write) 261512 261512 0 0.0
.bss 171232 171232 0 0.0
.data 4080 4080 0 0.0
.data.rel.ro 79480 79480 0 0.0
.dynamic 608 608 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 1088 1088 0 0.0
.rodata 222744 222744 0 0.0
.text 2895618 2895618 0 0.0
tv-casting-app debug (read only) 9047113 9047113 0 0.0
(read/write) 217904 217904 0 0.0
.bss 52064 52064 0 0.0
.data 1744 1744 0 0.0
.data.rel.ro 157528 157528 0 0.0
.dynamic 608 608 0 0.0
.got 4920 4920 0 0.0
.init 27 27 0 0.0
.init_array 1000 1000 0 0.0
.rodata 327660 327660 0 0.0
.text 8294578 8294578 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2495496 2495496 0 0.0
.bss 216304 216304 0 0.0
.data 5144 5144 0 0.0
.text 1458180 1458180 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1178244 1178244 0 0.0
bss 155643 155643 0 0.0
rodata 133220 133220 0 0.0
text 808696 808696 0 0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1437988 1437988 0 0.0
bss 135383 135383 0 0.0
rodata 229236 229236 0 0.0
text 779308 779308 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1124332 1124332 0 0.0
bss 154784 154784 0 0.0
rodata 109900 109900 0 0.0
text 778944 778944 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 840592 840592 0 0.0
(read/write) 1709452 1709452 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 190188 190188 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2560 2560 0 0.0
.debug_abbrev 1286099 1286099 0 0.0
.debug_aranges 145472 145472 0 0.0
.debug_frame 486536 486536 0 0.0
.debug_info 31497760 31497760 0 0.0
.debug_line 3970884 3970880 -4 -0.0
.debug_line_str 957 957 0 0.0
.debug_loclists 2259850 2259850 0 0.0
.debug_rnglists 141112 141112 0 0.0
.debug_str 4280988 4280988 0 0.0
.heap 840592 840592 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 720491 720491 0 0.0
.symtab 467936 467936 0 0.0
.text 1508316 1508316 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 841416 841416 0 0.0
(read/write) 1650428 1650428 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 189372 189372 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2552 2552 0 0.0
.debug_abbrev 1275833 1275833 0 0.0
.debug_aranges 144712 144712 0 0.0
.debug_frame 488960 488960 0 0.0
.debug_info 31053695 31053694 -1 -0.0
.debug_line 3984044 3984040 -4 -0.0
.debug_line_str 981 981 0 0.0
.debug_loclists 2250741 2250741 0 0.0
.debug_rnglists 140055 140055 0 0.0
.debug_str 4269668 4269668 0 0.0
.heap 841416 841416 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 676756 676756 0 0.0
.symtab 452352 452352 0 0.0
.text 1450116 1450116 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 849736 849736 0 0.0
(read/write) 1571372 1571372 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 181220 181220 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2384 2384 0 0.0
.debug_abbrev 1108703 1108703 0 0.0
.debug_aranges 134744 134744 0 0.0
.debug_frame 451792 451792 0 0.0
.debug_info 25731469 25731469 0 0.0
.debug_line 3545143 3545139 -4 -0.0
.debug_line_str 942 942 0 0.0
.debug_loclists 2080628 2080628 0 0.0
.debug_rnglists 129592 129592 0 0.0
.debug_str 4075488 4075488 0 0.0
.heap 849736 849736 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 592238 592238 0 0.0
.symtab 414352 414352 0 0.0
.text 1379380 1379380 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 821960 821960 0 0.0
(read/write) 1627988 1627988 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 208988 208988 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2392 2392 0 0.0
.debug_abbrev 1107813 1107813 0 0.0
.debug_aranges 135248 135248 0 0.0
.debug_frame 453884 453884 0 0.0
.debug_info 25853002 25853003 1 0.0
.debug_line 3541623 3541619 -4 -0.0
.debug_line_str 933 933 0 0.0
.debug_loclists 2094075 2094075 0 0.0
.debug_rnglists 130048 130048 0 0.0
.debug_str 4090399 4090399 0 0.0
.heap 821960 821960 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 596154 596154 0 0.0
.symtab 416688 416688 0 0.0
.text 1408220 1408220 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1170752 1170752 0 0.0
.bss 99928 99928 0 0.0
.data 856 856 0 0.0
.text 617852 617852 0 0.0
lock-app qpg6105+debug (read/write) 1139956 1139956 0 0.0
.bss 94824 94824 0 0.0
.data 856 856 0 0.0
.text 587056 587056 0 0.0
telink all-clusters-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1013724 1013724 0 0.0
bss 99008 99008 0 0.0
text 689154 689154 0 0.0
all-clusters-minimal-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 949252 949252 0 0.0
bss 98044 98044 0 0.0
text 651014 651018 4 0.0
bridge-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 927248 927248 0 0.0
bss 100252 100252 0 0.0
text 640656 640654 -2 -0.0
contact-sensor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 858504 858504 0 0.0
bss 89936 89936 0 0.0
text 583334 583332 -2 -0.0
light-switch-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 874808 874808 0 0.0
bss 90092 90092 0 0.0
text 597964 597964 0 0.0
lighting-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 942388 942388 0 0.0
bss 98272 98272 0 0.0
text 657646 657644 -2 -0.0
lighting-app-factory-data tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 953760 953768 8 0.0
bss 102520 102520 0 0.0
text 665164 665166 2 0.0
lighting-app-rpc tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1010820 1010812 -8 -0.0
bss 99836 99836 0 0.0
text 702106 702102 -4 -0.0
lighting-app-shell tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1043244 1043244 0 0.0
bss 110920 110920 0 0.0
text 722678 722678 0 0.0
lock-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 913556 913556 0 0.0
bss 90588 90588 0 0.0
text 612000 612002 2 0.0
ota-requestor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 881096 881096 0 0.0
bss 91192 91192 0 0.0
text 605264 605264 0 0.0
pump-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 864500 864500 0 0.0
bss 90056 90056 0 0.0
text 589512 589510 -2 -0.0
pump-controller-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 851296 851296 0 0.0
bss 89856 89856 0 0.0
text 579626 579626 0 0.0
temperature-measurement-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 847496 847496 0 0.0
bss 89776 89776 0 0.0
text 575344 575340 -4 -0.0
thermostat tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 879684 879684 0 0.0
bss 91496 91496 0 0.0
text 600118 600116 -2 -0.0
window-covering tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 875848 875848 0 0.0
bss 91892 91892 0 0.0
text 595362 595362 0 0.0

When CHIP_SYSTEM_CONFIG_USE_LIBEV is set, SystemLayerImplSelect expects a *libev* mainloop to be present to schedule timers and socket watches (similar to CHIP_SYSTEM_CONFIG_USE_DISPATCH for Darwin).

A libev mainloop must be passed to SystemLayer using `SetLibEvLoop()` before any timers or socket watches are used - otherwise, `chipDie()` is invoked.

Platform manager events are also dispatched via the libev mainloop, using
ScheduleWork(). This eliminates the need for a separate thread for
dispatching events, and makes sure event handlers cannot run in parallel
with timers or I/O handlers. In consequence PostEvent() may not be called
without holding the chip lock.

The reason for running *matter* under libev in the first place
is to allow creating single-threaded apps including all of *matter*.
So disallowing PostEvent() "from any thread" is a design choice for
the libev case.

# Usage
The entire project needs to be build with `CHIP_SYSTEM_CONFIG_USE_LIBEV=1` (this can be done via invoking a project-specific extra config via the `default_configs_extra` argument in args.gni)

Setting up the libev mainloop and handing it over to SystemLayer must be done in application specific code, outside the code provided by chip examples. Also adding libev as a dependency must be done in the application's BUILD.gn.

# Background
*libev* is a multi-platform event library often used in embedded linux context to handle events, and builds the basis for various libraries with non-blocking APIs. This changeset allows using the *matter* stack with libev based applications.

# Example
The opensource bridge project p44mbrd (https://github.com/plan44/p44mbrd) is based on libev and makes use of this changeset.
@github-actions
Copy link

github-actions bot commented May 31, 2023

PR #24232: Size comparison from 77b1596 to b9ffb72

Increases (10 builds for bl602, bl702, cc32xx, cyw30739, psoc6, telink)
platform target config section 77b1596 b9ffb72 change % change
bl602 lighting-app bl602+rpc .text 1067714 1067718 4 0.0
bl702 lighting-app bl702 .debug_info 44558674 44558675 1 0.0
.text 966574 966576 2 0.0
bl702+rpc .debug_info 49503399 49503400 1 0.0
.text 1039960 1039962 2 0.0
cc32xx lock CC3235SF_LAUNCHXL .debug_info 22708986 22708988 2 0.0
cyw30739 switch cyw930739m2evb_01 (read/write) 530931 530939 8 0.0
.app_xip_area 421917 421925 8 0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 31667593 31667594 1 0.0
telink all-clusters-minimal-app tlsr9518adk80d (read/write) 959748 959756 8 0.0
text 663824 663826 2 0.0
ota-requestor-app tlsr9518adk80d text 605936 605938 2 0.0
pump-controller-app tlsr9518adk80d text 580340 580342 2 0.0
window-covering tlsr9518adk80d text 609822 609824 2 0.0
Decreases (13 builds for cc32xx, k32w, nrfconnect, psoc6, telink)
platform target config section 77b1596 b9ffb72 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_line 2853238 2853234 -4 -0.0
k32w lock k32w0+release (read only) 556188 556172 -16 -0.0
.text 555652 555636 -16 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 text 819884 819880 -4 -0.0
nrf7002dk_nrf5340_cpuapp text 790552 790548 -4 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_line 3996331 3996327 -4 -0.0
all-clusters-minimal cy8ckit_062s2_43012 .debug_info 31220273 31220272 -1 -0.0
.debug_line 4008589 4008585 -4 -0.0
light cy8ckit_062s2_43012 .debug_info 26095257 26095255 -2 -0.0
.debug_line 3587216 3587212 -4 -0.0
lock cy8ckit_062s2_43012 .debug_line 3522646 3522642 -4 -0.0
telink contact-sensor-app tlsr9518adk80d text 584044 584042 -2 -0.0
lighting-app tlsr9518adk80d text 677790 677788 -2 -0.0
lighting-app-factory-data tlsr9518adk80d (read/write) 975464 975456 -8 -0.0
text 685310 685308 -2 -0.0
lighting-app-rpc tlsr9518adk80d text 722256 722254 -2 -0.0
pump-app tlsr9518adk80d text 590222 590220 -2 -0.0
Full report (58 builds for bl602, bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section 77b1596 b9ffb72 change % change
bl602 lighting-app bl602 (read/write) 1356274 1356274 0 0.0
.bss 87886 87886 0 0.0
.data 9648 9648 0 0.0
.text 1036360 1036360 0 0.0
bl602+rpc (read/write) 1402550 1402550 0 0.0
.bss 95934 95934 0 0.0
.data 10040 10040 0 0.0
.text 1067714 1067718 4 0.0
bl702 lighting-app bl702 (read only) 3358 3358 0 0.0
(read/write) 1188063 1188063 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 67585 67585 0 0.0
.bss_psram 24656 24656 0 0.0
.comment 48 48 0 0.0
.data 3952 3952 0 0.0
.debug_abbrev 1549961 1549961 0 0.0
.debug_aranges 148360 148360 0 0.0
.debug_frame 545636 545636 0 0.0
.debug_info 44558674 44558675 1 0.0
.debug_line 5559389 5559389 0 0.0
.debug_loc 3785221 3785221 0 0.0
.debug_ranges 388640 388640 0 0.0
.debug_str 4319908 4319908 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 140 140 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 107216 107216 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 582506 582506 0 0.0
.symtab 175584 175584 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 0 0 0 0.0
966574 966576 2 0.0
bl702+rpc (read only) 3358 3358 0 0.0
(read/write) 1276867 1276867 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 75633 75633 0 0.0
.bss_psram 25056 25056 0 0.0
.comment 48 48 0 0.0
.data 4504 4504 0 0.0
.debug_abbrev 1708971 1708971 0 0.0
.debug_aranges 156648 156648 0 0.0
.debug_frame 573648 573648 0 0.0
.debug_info 49503399 49503400 1 0.0
.debug_line 5975210 5975210 0 0.0
.debug_loc 3987899 3987899 0 0.0
.debug_ranges 414000 414000 0 0.0
.debug_str 4745416 4745416 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 156 156 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 121296 121296 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 643826 643826 0 0.0
.symtab 194080 194080 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 0 0 0 0.0
1039960 1039962 2 0.0
cc32xx lock CC3235SF_LAUNCHXL (blank) 0 0 0 0.0
(read only) 606066 606066 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 949825 949825 0 0.0
.debug_aranges 117512 117512 0 0.0
.debug_frame 400904 400904 0 0.0
.debug_info 22708986 22708988 2 0.0
.debug_line 2853238 2853234 -4 -0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1711740 1711740 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 106399 106399 0 0.0
.debug_str 3759427 3759427 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104418 104418 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 484683 484683 0 0.0
.symtab 287504 287504 0 0.0
.text 499528 499528 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 542019 542019 0 0.0
.app_xip_area 434645 434645 0 0.0
.bss 62352 62352 0 0.0
.data 712 712 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 529411 529411 0 0.0
.app_xip_area 416901 416901 0 0.0
.bss 67480 67480 0 0.0
.data 720 720 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 566243 566243 0 0.0
.app_xip_area 459797 459797 0 0.0
.bss 61472 61472 0 0.0
.data 668 668 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
switch cyw930739m2evb_01 (read/write) 530931 530939 8 0.0
.app_xip_area 421917 421925 8 0.0
.bss 63960 63960 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rs9116 (read/write) 988164 988164 0 0.0
.bss 179856 179856 0 0.0
.data 2144 2144 0 0.0
.text 806144 806144 0 0.0
BRD4187C (read/write) 1019000 1019000 0 0.0
.bss 159588 159588 0 0.0
.data 2788 2788 0 0.0
.text 856604 856604 0 0.0
lock-app BRD4161A+wf200 (read/write) 1069240 1069240 0 0.0
.bss 174160 174160 0 0.0
.data 2152 2152 0 0.0
.text 892908 892908 0 0.0
window-app BRD4187C (read/write) 1091008 1091008 0 0.0
.bss 142572 142572 0 0.0
.data 2680 2680 0 0.0
.text 945736 945736 0 0.0
esp32 all-clusters-app c3devkit (read only) 1068920 1068920 0 0.0
(read/write) 1583064 1583064 0 0.0
.dram0.bss 75536 75536 0 0.0
.dram0.data 13964 13964 0 0.0
.flash.rodata 214432 214432 0 0.0
.flash.text 1068920 1068920 0 0.0
.iram0.text 76740 76740 0 0.0
m5stack (read only) 1114679 1114679 0 0.0
(read/write) 492318 492318 0 0.0
.dram0.bss 80536 80536 0 0.0
.dram0.data 34304 34304 0 0.0
.flash.rodata 242328 242328 0 0.0
.flash.text 1109295 1109295 0 0.0
.iram0.text 126055 126055 0 0.0
k32w contact k32w0+release (read only) 583612 583612 0 0.0
(read/write) 82704 82704 0 0.0
.bss 65888 65888 0 0.0
.data 2192 2192 0 0.0
.text 583076 583076 0 0.0
light k32w0+release (read only) 582572 582572 0 0.0
(read/write) 82356 82356 0 0.0
.bss 65552 65552 0 0.0
.data 2180 2180 0 0.0
.text 582036 582036 0 0.0
lock k32w0+release (read only) 556188 556172 -16 -0.0
(read/write) 80352 80352 0 0.0
.bss 63624 63624 0 0.0
.data 2104 2104 0 0.0
.text 555652 555636 -16 -0.0
linux all-clusters-app debug (read only) 3239893 3239893 0 0.0
(read/write) 154904 154904 0 0.0
.bss 58592 58592 0 0.0
.data 2160 2160 0 0.0
.data.rel.ro 87632 87632 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 1136 1136 0 0.0
.rodata 231304 231304 0 0.0
.text 2819301 2819301 0 0.0
all-clusters-minimal-app debug (read only) 3037573 3037573 0 0.0
(read/write) 145064 145064 0 0.0
.bss 57344 57344 0 0.0
.data 2128 2128 0 0.0
.data.rel.ro 79184 79184 0 0.0
.dynamic 608 608 0 0.0
.got 4664 4664 0 0.0
.init 27 27 0 0.0
.init_array 1088 1088 0 0.0
.rodata 224168 224168 0 0.0
.text 2628229 2628229 0 0.0
bridge-app debug (read only) 2518821 2518821 0 0.0
(read/write) 129672 129672 0 0.0
.bss 50232 50232 0 0.0
.data 3824 3824 0 0.0
.data.rel.ro 69616 69616 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 172808 172808 0 0.0
.text 2173717 2173717 0 0.0
chip-tool debug (read only) 15497257 15497257 0 0.0
(read/write) 705216 705216 0 0.0
.bss 26424 26424 0 0.0
.data 3042 3042 0 0.0
.data.rel.ro 668960 668960 0 0.0
.dynamic 608 608 0 0.0
.got 5360 5360 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 683541 683541 0 0.0
.text 13177188 13177188 0 0.0
chip-tool-ipv6only arm64 (read only) 14827364 14827364 0 0.0
(read/write) 758088 758088 0 0.0
.bss 34408 34408 0 0.0
.data 3008 3008 0 0.0
.data.rel.ro 698752 698752 0 0.0
.dynamic 560 560 0 0.0
.got 16680 16680 0 0.0
.init 24 24 0 0.0
.init_array 224 224 0 0.0
.rodata 620008 620008 0 0.0
.text 12413636 12413636 0 0.0
dynamic-bridge-app-ipv6only debug (read only) 2567837 2567837 0 0.0
(read/write) 126832 126832 0 0.0
.bss 47544 47544 0 0.0
.data 2704 2704 0 0.0
.data.rel.ro 70344 70344 0 0.0
.dynamic 624 624 0 0.0
.got 4792 4792 0 0.0
.init 27 27 0 0.0
.init_array 784 784 0 0.0
.rodata 175752 175752 0 0.0
.text 2214773 2214773 0 0.0
lighting-app debug+rpc+ui (read only) 3380185 3380185 0 0.0
(read/write) 135728 135728 0 0.0
.bss 49344 49344 0 0.0
.data 2704 2704 0 0.0
.data.rel.ro 76824 76824 0 0.0
.dynamic 656 656 0 0.0
.got 5264 5264 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 286356 286356 0 0.0
.text 2897250 2897250 0 0.0
lock-app debug (read only) 2661261 2661261 0 0.0
(read/write) 123616 123616 0 0.0
.bss 45952 45952 0 0.0
.data 1904 1904 0 0.0
.data.rel.ro 69656 69656 0 0.0
.dynamic 608 608 0 0.0
.got 4648 4648 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 206056 206056 0 0.0
.text 2282533 2282533 0 0.0
ota-provider-app debug (read only) 2210101 2210101 0 0.0
(read/write) 103664 103664 0 0.0
.bss 44528 44528 0 0.0
.data 2112 2112 0 0.0
.data.rel.ro 51936 51936 0 0.0
.dynamic 608 608 0 0.0
.got 3800 3800 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 153960 153960 0 0.0
.text 1914645 1914645 0 0.0
ota-requestor-app debug (read only) 2377661 2377661 0 0.0
(read/write) 111424 111424 0 0.0
.bss 46960 46960 0 0.0
.data 2512 2512 0 0.0
.data.rel.ro 56792 56792 0 0.0
.dynamic 608 608 0 0.0
.got 3784 3784 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 157992 157992 0 0.0
.text 2069301 2069301 0 0.0
shell debug (read only) 2773497 2773497 0 0.0
(read/write) 143224 143224 0 0.0
.bss 57512 57512 0 0.0
.data 1232 1232 0 0.0
.data.rel.ro 78632 78632 0 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 1064 1064 0 0.0
.rodata 199410 199410 0 0.0
.text 2408898 2408898 0 0.0
thermostat-no-ble arm64 (read only) 2606252 2606252 0 0.0
(read/write) 142824 142824 0 0.0
.bss 52344 52344 0 0.0
.data 1736 1736 0 0.0
.data.rel.ro 79128 79128 0 0.0
.dynamic 560 560 0 0.0
.got 5520 5520 0 0.0
.init 24 24 0 0.0
.init_array 416 416 0 0.0
.rodata 129560 129560 0 0.0
.text 2211556 2211556 0 0.0
tv-app debug (read only) 3315081 3315081 0 0.0
(read/write) 261504 261504 0 0.0
.bss 171232 171232 0 0.0
.data 4080 4080 0 0.0
.data.rel.ro 79480 79480 0 0.0
.dynamic 608 608 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 222296 222296 0 0.0
.text 2896626 2896626 0 0.0
tv-casting-app debug (read only) 9078665 9078665 0 0.0
(read/write) 218440 218440 0 0.0
.bss 52064 52064 0 0.0
.data 1744 1744 0 0.0
.data.rel.ro 158072 158072 0 0.0
.dynamic 608 608 0 0.0
.got 4920 4920 0 0.0
.init 27 27 0 0.0
.init_array 992 992 0 0.0
.rodata 327564 327564 0 0.0
.text 8324882 8324882 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2495712 2495712 0 0.0
.bss 216304 216304 0 0.0
.data 5144 5144 0 0.0
.text 1458396 1458396 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1188876 1188876 0 0.0
bss 153967 153967 0 0.0
rodata 134332 134332 0 0.0
text 819884 819880 -4 -0.0
nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1448672 1448672 0 0.0
bss 133707 133707 0 0.0
rodata 230336 230336 0 0.0
text 790552 790548 -4 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1131760 1131760 0 0.0
bss 152775 152775 0 0.0
rodata 109440 109440 0 0.0
text 788880 788880 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 842264 842264 0 0.0
(read/write) 1724820 1724820 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188516 188516 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2560 2560 0 0.0
.debug_abbrev 1292067 1292067 0 0.0
.debug_aranges 146704 146704 0 0.0
.debug_frame 490768 490768 0 0.0
.debug_info 31667593 31667594 1 0.0
.debug_line 3996331 3996327 -4 -0.0
.debug_line_str 957 957 0 0.0
.debug_loclists 2281880 2281880 0 0.0
.debug_rnglists 142425 142425 0 0.0
.debug_str 4319228 4319228 0 0.0
.heap 842264 842264 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 745879 745879 0 0.0
.symtab 475904 475904 0 0.0
.text 1525356 1525356 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 843424 843424 0 0.0
(read/write) 1662476 1662476 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187356 187356 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2560 2560 0 0.0
.debug_abbrev 1281801 1281801 0 0.0
.debug_aranges 145840 145840 0 0.0
.debug_frame 492948 492948 0 0.0
.debug_info 31220273 31220272 -1 -0.0
.debug_line 4008589 4008585 -4 -0.0
.debug_line_str 981 981 0 0.0
.debug_loclists 2271760 2271760 0 0.0
.debug_rnglists 141262 141262 0 0.0
.debug_str 4305547 4305547 0 0.0
.heap 843424 843424 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 699129 699129 0 0.0
.symtab 459136 459136 0 0.0
.text 1464172 1464172 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 849560 849560 0 0.0
(read/write) 1595036 1595036 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 181388 181388 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2392 2392 0 0.0
.debug_abbrev 1120043 1120043 0 0.0
.debug_aranges 136232 136232 0 0.0
.debug_frame 457036 457036 0 0.0
.debug_info 26095257 26095255 -2 -0.0
.debug_line 3587216 3587212 -4 -0.0
.debug_line_str 942 942 0 0.0
.debug_loclists 2112306 2112306 0 0.0
.debug_rnglists 131284 131284 0 0.0
.debug_str 4119354 4119354 0 0.0
.heap 849560 849560 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 622577 622577 0 0.0
.symtab 424640 424640 0 0.0
.text 1402868 1402868 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 821960 821960 0 0.0
(read/write) 1628212 1628212 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 208988 208988 0 0.0
.comment 212 212 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2392 2392 0 0.0
.debug_abbrev 1102418 1102418 0 0.0
.debug_aranges 134704 134704 0 0.0
.debug_frame 451596 451596 0 0.0
.debug_info 25661303 25661303 0 0.0
.debug_line 3522646 3522642 -4 -0.0
.debug_line_str 933 933 0 0.0
.debug_loclists 2085726 2085726 0 0.0
.debug_rnglists 129330 129330 0 0.0
.debug_str 4081438 4081438 0 0.0
.heap 821960 821960 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 296 296 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 596602 596602 0 0.0
.symtab 416768 416768 0 0.0
.text 1408444 1408444 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1170548 1170548 0 0.0
.bss 99928 99928 0 0.0
.data 852 852 0 0.0
.text 617644 617644 0 0.0
lock-app qpg6105+debug (read/write) 1139932 1139932 0 0.0
.bss 94824 94824 0 0.0
.data 856 856 0 0.0
.text 587032 587032 0 0.0
telink all-clusters-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1027684 1027684 0 0.0
bss 97372 97372 0 0.0
text 703346 703346 0 0.0
all-clusters-minimal-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 959748 959756 8 0.0
bss 96064 96064 0 0.0
text 663824 663826 2 0.0
bridge-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 928192 928192 0 0.0
bss 100300 100300 0 0.0
text 641404 641404 0 0.0
contact-sensor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 859340 859340 0 0.0
bss 89960 89960 0 0.0
text 584044 584042 -2 -0.0
light-switch-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 875656 875656 0 0.0
bss 90128 90128 0 0.0
text 598664 598664 0 0.0
lighting-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 964084 964084 0 0.0
bss 98484 98484 0 0.0
text 677790 677788 -2 -0.0
lighting-app-factory-data tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 975464 975456 -8 -0.0
bss 102732 102732 0 0.0
text 685310 685308 -2 -0.0
lighting-app-rpc tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1032508 1032508 0 0.0
bss 100048 100048 0 0.0
text 722256 722254 -2 -0.0
lighting-app-shell tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 1064940 1064940 0 0.0
bss 111132 111132 0 0.0
text 742824 742824 0 0.0
lock-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 914764 914764 0 0.0
bss 90624 90624 0 0.0
text 613026 613026 0 0.0
ota-requestor-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 881948 881948 0 0.0
bss 91228 91228 0 0.0
text 605936 605938 2 0.0
pump-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 865356 865356 0 0.0
bss 90092 90092 0 0.0
text 590222 590220 -2 -0.0
pump-controller-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 852152 852152 0 0.0
bss 89892 89892 0 0.0
text 580340 580342 2 0.0
temperature-measurement-app tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 848276 848276 0 0.0
bss 89800 89800 0 0.0
text 575998 575998 0 0.0
thermostat tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 893688 893688 0 0.0
bss 90336 90336 0 0.0
text 614882 614882 0 0.0
window-covering tlsr9518adk80d (read only) 4 4 0 0.0
(read/write) 889084 889084 0 0.0
bss 90628 90628 0 0.0
text 609822 609824 2 0.0

@bzbarsky-apple
Copy link
Contributor

@plan44 Should #24232 (comment) just get spun off into a separate issue?

@plan44
Copy link
Contributor Author

plan44 commented Jun 1, 2023

@plan44 Should #24232 (comment) just get spun off into a separate issue?

Yes, please - as said I'd need some guidance to even understand what a "variant" would mean in that context. It is not possible to just enable CHIP_SYSTEM_CONFIG_USE_LIBEV and compile an example that way - the libev based main app would be missing.

@bzbarsky-apple
Copy link
Contributor

@plan44 Please file that issue?

@plan44
Copy link
Contributor Author

plan44 commented Jun 1, 2023

@bzbarsky-apple done -> #27022

(sorry for being a bit slow at times finding the right path to do things here 🤯 )

@bzbarsky-apple bzbarsky-apple merged commit 860e934 into project-chip:master Jun 1, 2023
plan44 added a commit to plan44/connectedhomeip that referenced this pull request Aug 22, 2023
libev based regular builds do not need a separate I/O wakeup thread, so
the wakeup thread can be eliminated in CHIP_SYSTEM_CONFIG_USE_LIBEV case.

In normal operation, libev based builds also never call Signal(), so if it
is still called it now emits a error log message, to indicate something might
be wrong in the setup.

However we keep Signal() and related LayerSocketsLoop methods, following the
Darwin dispatch implementation, as fallback to select-based event handling
seems to be needed for some I/O tests.

As noted in a comment to the original libev PR [1], eventually, the select() based
mainloop and external mainloop based solutions like Darwin Dispatch and libev
should be detangled and extracted into separate classes, adapting all the tests
that somehow rely on the select() fallback. As a single self-funded
developer however, I cannot possibly be expected to solve this for Apple ;-)

[1] project-chip#24232 (review)
plan44 added a commit to plan44/connectedhomeip that referenced this pull request Aug 22, 2023
libev based regular builds do not need a separate I/O wakeup thread, so
the wakeup thread can be eliminated in CHIP_SYSTEM_CONFIG_USE_LIBEV case.

In normal operation, libev based builds also never call Signal(), so if it
is still called it now emits a error log message, to indicate something might
be wrong in the setup.

However we keep Signal() and related LayerSocketsLoop methods, following the
Darwin dispatch implementation, as fallback to select-based event handling
seems to be needed for some I/O tests.

As noted in a comment to the original libev PR [1], eventually, the select() based
mainloop and external mainloop based solutions like Darwin Dispatch and libev
should be detangled and extracted into separate classes, adapting all the tests
that somehow rely on the select() fallback. As a single self-funded
developer however, I cannot possibly be expected to solve this for Apple ;-)

[1] project-chip#24232 (review)
plan44 added a commit to plan44/connectedhomeip that referenced this pull request Aug 29, 2023
libev based regular builds do not need a separate I/O wakeup thread, so
the wakeup thread can be eliminated in CHIP_SYSTEM_CONFIG_USE_LIBEV case.

In normal operation, libev based builds also never call Signal(), so if it
is still called it now emits a error log message, to indicate something might
be wrong in the setup.

However we keep Signal() and related LayerSocketsLoop methods, following the
Darwin dispatch implementation, as fallback to select-based event handling
seems to be needed for some I/O tests.

As noted in a comment to the original libev PR [1], eventually, the select() based
mainloop and external mainloop based solutions like Darwin Dispatch and libev
should be detangled and extracted into separate classes, adapting all the tests
that somehow rely on the select() fallback. As a single self-funded
developer however, I cannot possibly be expected to solve this for Apple ;-)

[1] project-chip#24232 (review)
mergify bot pushed a commit that referenced this pull request Aug 29, 2023
)

* SystemLayerImplSelect: libev: avoid timers firing slightly too early (#28434)

This fixes a ReportEngine problem that was caused by libev based timers
firing slightly (in the range of 20mS) too early, because libev by
default uses the time when events started processing as the "now"
reference for relative timers for efficiency reasons.

To ensure timers cannot fire early, timer setup must compensate for
any difference between ev_now() which is the time events started
processing and ev_time(), which is the actual current time (but is
a bit less efficient to obtain).

# Conflicts:
#	src/system/SystemLayerImplSelect.cpp

* SystemLayerImplSelect: libev: eliminate I/O wakeup thread

libev based regular builds do not need a separate I/O wakeup thread, so
the wakeup thread can be eliminated in CHIP_SYSTEM_CONFIG_USE_LIBEV case.

In normal operation, libev based builds also never call Signal(), so if it
is still called it now emits a error log message, to indicate something might
be wrong in the setup.

However we keep Signal() and related LayerSocketsLoop methods, following the
Darwin dispatch implementation, as fallback to select-based event handling
seems to be needed for some I/O tests.

As noted in a comment to the original libev PR [1], eventually, the select() based
mainloop and external mainloop based solutions like Darwin Dispatch and libev
should be detangled and extracted into separate classes, adapting all the tests
that somehow rely on the select() fallback. As a single self-funded
developer however, I cannot possibly be expected to solve this for Apple ;-)

[1] #24232 (review)

* SystemLayerImplSelect: reword comment: early firing timers can happen

- the fix prevents them in normal libev case
- however the caller MUST NOT rely on timers *never* firing a bit early
HunsupJung pushed a commit to HunsupJung/connectedhomeip that referenced this pull request Oct 23, 2023
…#28434) (project-chip#28740)

* SystemLayerImplSelect: libev: avoid timers firing slightly too early (project-chip#28434)

This fixes a ReportEngine problem that was caused by libev based timers
firing slightly (in the range of 20mS) too early, because libev by
default uses the time when events started processing as the "now"
reference for relative timers for efficiency reasons.

To ensure timers cannot fire early, timer setup must compensate for
any difference between ev_now() which is the time events started
processing and ev_time(), which is the actual current time (but is
a bit less efficient to obtain).

# Conflicts:
#	src/system/SystemLayerImplSelect.cpp

* SystemLayerImplSelect: libev: eliminate I/O wakeup thread

libev based regular builds do not need a separate I/O wakeup thread, so
the wakeup thread can be eliminated in CHIP_SYSTEM_CONFIG_USE_LIBEV case.

In normal operation, libev based builds also never call Signal(), so if it
is still called it now emits a error log message, to indicate something might
be wrong in the setup.

However we keep Signal() and related LayerSocketsLoop methods, following the
Darwin dispatch implementation, as fallback to select-based event handling
seems to be needed for some I/O tests.

As noted in a comment to the original libev PR [1], eventually, the select() based
mainloop and external mainloop based solutions like Darwin Dispatch and libev
should be detangled and extracted into separate classes, adapting all the tests
that somehow rely on the select() fallback. As a single self-funded
developer however, I cannot possibly be expected to solve this for Apple ;-)

[1] project-chip#24232 (review)

* SystemLayerImplSelect: reword comment: early firing timers can happen

- the fix prevents them in normal libev case
- however the caller MUST NOT rely on timers *never* firing a bit early
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.

3 participants