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

BytesToHex should accept null buffers if length is 0. #19827

Conversation

bzbarsky-apple
Copy link
Contributor

Fixes #19727

Problem

BytesToHex hard to use properly with empty ByteSpan.

Change overview

Make it easier to use.

Testing

Manual testing of a case with a ByteSpan in a payload being logged by chip-tool, plus the added unit tests.

@github-actions
Copy link

github-actions bot commented Jun 21, 2022

PR #19827: Size comparison from 19a6269 to a44b58b

Increases (23 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, nrfconnect, p6, telink)
platform target config section 19a6269 a44b58b change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 660135 660143 8 0.0
.text 572584 572592 8 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 648947 648971 24 0.0
.text 557856 557880 24 0.0
lock-ftd LP_CC2652R7 (read only) 691535 691559 24 0.0
.text 591500 591524 24 0.0
lock-mtd LP_CC2652R7 (read only) 640951 640967 16 0.0
.text 541028 541044 16 0.0
pump-app LP_CC2652R7 (read only) 672799 672815 16 0.0
.text 584412 584428 16 0.0
pump-controller-app LP_CC2652R7 (read only) 658675 658699 24 0.0
.text 574448 574472 24 0.0
shell LP_CC2652R7 (read only) 689870 689886 16 0.0
.text 579536 579552 16 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 613246 613262 16 0.0
.app_xip_area 469896 469912 16 0.0
lock cyw930739m2evb_01 (read/write) 610626 610642 16 0.0
.app_xip_area 467100 467116 16 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 617134 617158 24 0.0
.app_xip_area 474672 474696 24 0.0
efr32 lock-app BRD4161A+wf200 (read only) 967144 967160 16 0.0
.text 967136 967152 16 0.0
window-app BRD4161A (read only) 910600 910616 16 0.0
.text 910592 910608 16 0.0
esp32 all-clusters-app c3devkit (read only) 1013698 1013712 14 0.0
.flash.text 1013698 1013712 14 0.0
k32w light k32w061+release (read/write) 659604 659620 16 0.0
.text 583048 583064 16 0.0
lock k32w061+release (read/write) 722156 722172 16 0.0
.text 645152 645168 16 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9887356 9887404 48 0.0
.text 7877748 7877796 48 0.0
thermostat-no-ble arm64 (read only) 2575988 2576036 48 0.0
.text 2172720 2172768 48 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1199911 1199943 32 0.0
text 823092 823116 24 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1147887 1147919 32 0.0
text 795316 795336 20 0.0
p6 light-app default (read/write) 2432000 2432016 16 0.0
.text 1390264 1390280 16 0.0
lock-app default (read/write) 2452712 2452728 16 0.0
.text 1410976 1410992 16 0.0
telink light-switch-app tlsr9518adk80d (read/write) 790480 790488 8 0.0
text 560394 560402 8 0.0
lighting-app tlsr9518adk80d (read/write) 810184 810192 8 0.0
text 576854 576862 8 0.0
Decreases (6 builds for cc13x2_26x2, esp32)
platform target config section 19a6269 a44b58b change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 190736 190728 -8 -0.0
lock-ftd LP_CC2652R7 (read/write) 149448 149424 -24 -0.0
pump-app LP_CC2652R7 (read/write) 169072 169056 -16 -0.0
pump-controller-app LP_CC2652R7 (read/write) 183308 183284 -24 -0.0
shell LP_CC2652R7 (read/write) 156496 156480 -16 -0.0
esp32 all-clusters-app m5stack (read only) 1068163 1068159 -4 -0.0
.flash.text 1062779 1062775 -4 -0.0
Full report (30 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 19a6269 a44b58b change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 660135 660143 8 0.0
(read/write) 190736 190728 -8 -0.0
.bss 73764 73764 0 0.0
.data 3356 3356 0 0.0
.rodata 87239 87239 0 0.0
.text 572584 572592 8 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 648947 648971 24 0.0
(read/write) 157324 157324 0 0.0
.bss 73052 73052 0 0.0
.data 3356 3356 0 0.0
.rodata 90771 90771 0 0.0
.text 557856 557880 24 0.0
lock-ftd LP_CC2652R7 (read only) 691535 691559 24 0.0
(read/write) 149448 149424 -24 -0.0
.bss 70764 70764 0 0.0
.data 3280 3280 0 0.0
.rodata 99551 99551 0 0.0
.text 591500 591524 24 0.0
lock-mtd LP_CC2652R7 (read only) 640951 640967 16 0.0
(read/write) 143896 143896 0 0.0
.bss 66500 66500 0 0.0
.data 3280 3280 0 0.0
.rodata 99431 99431 0 0.0
.text 541028 541044 16 0.0
pump-app LP_CC2652R7 (read only) 672799 672815 16 0.0
(read/write) 169072 169056 -16 -0.0
.bss 70884 70884 0 0.0
.data 3280 3280 0 0.0
.rodata 87903 87903 0 0.0
.text 584412 584428 16 0.0
pump-controller-app LP_CC2652R7 (read only) 658675 658699 24 0.0
(read/write) 183308 183284 -24 -0.0
.bss 70996 70996 0 0.0
.data 3276 3276 0 0.0
.rodata 83747 83747 0 0.0
.text 574448 574472 24 0.0
shell LP_CC2652R7 (read only) 689870 689886 16 0.0
(read/write) 156496 156480 -16 -0.0
.bss 76060 76060 0 0.0
.data 3360 3360 0 0.0
.rodata 110022 110022 0 0.0
.text 579536 579552 16 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 613246 613262 16 0.0
.app_xip_area 469896 469912 16 0.0
.bss 86304 86304 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) 610626 610642 16 0.0
.app_xip_area 467100 467116 16 0.0
.bss 86480 86480 0 0.0
.data 732 732 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 617134 617158 24 0.0
.app_xip_area 474672 474696 24 0.0
.bss 85472 85472 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 925456 925456 0 0.0
(read/write) 132424 132424 0 0.0
.bss 130344 130344 0 0.0
.data 2080 2080 0 0.0
.text 925448 925448 0 0.0
BRD4161A+rpc (read only) 961160 961160 0 0.0
(read/write) 149304 149304 0 0.0
.bss 147016 147016 0 0.0
.data 2284 2284 0 0.0
.text 961152 961152 0 0.0
BRD4161A+rs911x (read only) 800804 800804 0 0.0
(read/write) 128700 128700 0 0.0
.bss 126612 126612 0 0.0
.data 2088 2088 0 0.0
.text 800796 800796 0 0.0
lock-app BRD4161A+wf200 (read only) 967144 967160 16 0.0
(read/write) 129076 129076 0 0.0
.bss 126988 126988 0 0.0
.data 2088 2088 0 0.0
.text 967136 967152 16 0.0
window-app BRD4161A (read only) 910600 910616 16 0.0
(read/write) 132528 132528 0 0.0
.bss 130416 130416 0 0.0
.data 2108 2108 0 0.0
.text 910592 910608 16 0.0
esp32 all-clusters-app c3devkit (read only) 1013698 1013712 14 0.0
(read/write) 1483554 1483554 0 0.0
.dram0.bss 69400 69400 0 0.0
.dram0.data 14632 14632 0 0.0
.flash.rodata 214080 214080 0 0.0
.flash.text 1013698 1013712 14 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1068163 1068159 -4 -0.0
(read/write) 485640 485640 0 0.0
.dram0.bss 74920 74920 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 244580 244580 0 0.0
.flash.text 1062779 1062775 -4 -0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 659604 659620 16 0.0
.bss 68764 68764 0 0.0
.data 1992 1992 0 0.0
.text 583048 583064 16 0.0
lock k32w061+release (read/write) 722156 722172 16 0.0
.bss 69204 69204 0 0.0
.data 2000 2000 0 0.0
.text 645152 645168 16 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9887356 9887404 48 0.0
(read/write) 674225 674225 0 0.0
.bss 42641 42641 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 613208 613208 0 0.0
.dynamic 528 528 0 0.0
.got 13416 13416 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 473180 473180 0 0.0
.text 7877748 7877796 48 0.0
thermostat-no-ble arm64 (read only) 2575988 2576036 48 0.0
(read/write) 180577 180577 0 0.0
.bss 87889 87889 0 0.0
.data 1688 1688 0 0.0
.data.rel.ro 82928 82928 0 0.0
.dynamic 528 528 0 0.0
.got 5056 5056 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 164196 164196 0 0.0
.text 2172720 2172768 48 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2439072 2439072 0 0.0
.bss 208212 208212 0 0.0
.data 5864 5864 0 0.0
.text 1401716 1401716 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1199911 1199943 32 0.0
bss 141606 141606 0 0.0
rodata 156312 156312 0 0.0
text 823092 823116 24 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1147887 1147919 32 0.0
bss 140858 140858 0 0.0
rodata 132840 132840 0 0.0
text 795316 795336 20 0.0
p6 all-clusters-app default (read/write) 2555392 2555392 0 0.0
.bss 143392 143392 0 0.0
.data 2776 2776 0 0.0
.text 1513656 1513656 0 0.0
all-clusters-minimal-app default (read/write) 2501240 2501240 0 0.0
.bss 142672 142672 0 0.0
.data 2776 2776 0 0.0
.text 1459504 1459504 0 0.0
light-app default (read/write) 2432000 2432016 16 0.0
.bss 134752 134752 0 0.0
.data 2592 2592 0 0.0
.text 1390264 1390280 16 0.0
lock-app default (read/write) 2452712 2452728 16 0.0
.bss 134576 134576 0 0.0
.data 2600 2600 0 0.0
.text 1410976 1410992 16 0.0
telink light-switch-app tlsr9518adk80d (read/write) 790480 790488 8 0.0
bss 69900 69900 0 0.0
noinit 40416 40416 0 0.0
text 560394 560402 8 0.0
lighting-app tlsr9518adk80d (read/write) 810184 810192 8 0.0
bss 70148 70148 0 0.0
noinit 40416 40416 0 0.0
text 576854 576862 8 0.0

@tcarmelveilleux tcarmelveilleux merged commit 0a8065f into project-chip:master Jun 22, 2022
@bzbarsky-apple bzbarsky-apple deleted the fix-bytes-to-hex-null-zero-length branch June 22, 2022 03:57
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.

[pre-sve]TC-CNET-4.4 Bad response
4 participants