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

Make DataModel::Provider return a Complete attribute metadata as its public interface #37519

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

andy31415
Copy link
Contributor

@andy31415 andy31415 commented Feb 11, 2025

Having a split of "list attributes not reported" is an ember implementation detail. If we allow full list return, we could use optimizations for having the entire list in flash and not consume RAM to build the list.

Previous API guidance of MUST include these 2 global attributes and MUST NOT include these 3 global attributes seemed leaky in terms of implementation details. Requiring all allows us better paths to choose optimizations (pure flash const list, vs in-ram building).

Moved the "add global list attributes" logic to the codegen implementation rather than it being part of global attribute handling.

Testing

Unit tests updated and pass.

Copy link

Review changes with  SemanticDiff

Copy link

github-actions bot commented Feb 11, 2025

PR #37519: Size comparison from 63f9782 to 450c980

Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 63f9782 450c980 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094520 1094482 -38 -0.0
RAM 103354 103354 0 0.0
bl702 lighting-app bl702+eth FLASH 650346 650312 -34 -0.0
RAM 25273 25273 0 0.0
bl702+wifi FLASH 828304 828270 -34 -0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1057564 1057530 -34 -0.0
RAM 23885 23885 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888248 888214 -34 -0.0
RAM 18496 18496 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971290 971256 -34 -0.0
RAM 16360 16360 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838396 838420 24 0.0
RAM 123480 123480 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823816 823832 16 0.0
RAM 125360 125360 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770984 770992 8 0.0
RAM 113820 113820 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 755244 755260 16 0.0
RAM 114028 114028 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538894 538894 0 0.0
RAM 205208 205208 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572758 572766 8 0.0
RAM 205360 205360 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679765 679781 16 0.0
RAM 78548 78548 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699625 699641 16 0.0
RAM 81188 81188 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699625 699641 16 0.0
RAM 81188 81188 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656549 656573 24 0.0
RAM 73616 73616 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616101 616117 16 0.0
RAM 71532 71532 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635745 635753 8 0.0
RAM 74076 74076 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635745 635753 8 0.0
RAM 74076 74076 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635613 635621 8 0.0
RAM 74540 74540 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 655329 655337 8 0.0
RAM 77084 77084 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 655329 655337 8 0.0
RAM 77084 77084 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611953 611969 16 0.0
RAM 68628 68628 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631813 631829 16 0.0
RAM 71268 71268 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631813 631829 16 0.0
RAM 71268 71268 0 0.0
efr32 lock-app BRD4187C FLASH 937088 937096 8 0.0
RAM 159904 159904 0 0.0
BRD4338a FLASH 730340 730380 40 0.0
RAM 234716 234716 0 0.0
window-app BRD4187C FLASH 1029648 1029688 40 0.0
RAM 128008 128008 0 0.0
esp32 all-clusters-app c3devkit DRAM 97312 97312 0 0.0
FLASH 1577408 1577432 24 0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 116100 116100 0 0.0
FLASH 1545102 1545126 24 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4760 4760 0 0.0
FLASH 2708611 2708747 136 0.0
RAM 132784 132784 0 0.0
all-clusters-app debug unknown 5568 5568 0 0.0
FLASH 5975074 5975210 136 0.0
RAM 531600 531600 0 0.0
all-clusters-minimal-app debug unknown 5464 5464 0 0.0
FLASH 5322586 5322754 168 0.0
RAM 242712 242712 0 0.0
bridge-app debug unknown 5480 5480 0 0.0
FLASH 4681230 4681398 168 0.0
RAM 221448 221448 0 0.0
chip-tool debug unknown 6120 6120 0 0.0
FLASH 13098792 13098960 168 0.0
RAM 596578 596578 0 0.0
chip-tool-ipv6only arm64 unknown 21816 21816 0 0.0
FLASH 11162160 11162224 64 0.0
RAM 648256 648256 0 0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11387841 11387977 136 0.0
RAM 596362 596362 0 0.0
fabric-bridge-app debug unknown 4736 4736 0 0.0
FLASH 4506552 4506720 168 0.0
RAM 208632 208632 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5612805 5612965 160 0.0
RAM 483504 483504 0 0.0
lighting-app debug+rpc+ui unknown 6152 6152 0 0.0
FLASH 5645489 5645633 144 0.0
RAM 231792 231792 0 0.0
lock-app debug unknown 5416 5416 0 0.0
FLASH 4730626 4730794 168 0.0
RAM 207696 207696 0 0.0
ota-provider-app debug unknown 4776 4776 0 0.0
FLASH 4359692 4359828 136 0.0
RAM 201336 201336 0 0.0
ota-requestor-app debug unknown 4728 4728 0 0.0
FLASH 4497036 4497204 168 0.0
RAM 205920 205920 0 0.0
shell debug unknown 4256 4256 0 0.0
FLASH 3005340 3005468 128 0.0
RAM 160552 160552 0 0.0
thermostat-no-ble arm64 unknown 9512 9512 0 0.0
FLASH 4096408 4096488 80 0.0
RAM 246024 246024 0 0.0
tv-app debug unknown 5744 5744 0 0.0
FLASH 5951749 5951893 144 0.0
RAM 606904 606904 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11271549 11271725 176 0.0
RAM 710864 710864 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 907452 907464 12 0.0
RAM 142411 142411 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 901932 901920 -12 -0.0
RAM 124755 124755 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 846072 846084 12 0.0
RAM 141339 141339 0 0.0
nxp contact k32w0+release FLASH 584744 584752 8 0.0
RAM 70876 70876 0 0.0
mcxw71+release FLASH 600184 600208 24 0.0
RAM 63096 63096 0 0.0
light k32w0+release FLASH 611052 611076 24 0.0
RAM 70268 70268 0 0.0
k32w1+release FLASH 685504 685512 8 0.0
RAM 48680 48680 0 0.0
lock mcxw71+release FLASH 749008 749024 16 0.0
RAM 67500 67500 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646732 1646756 24 0.0
RAM 211576 211576 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553500 1553524 24 0.0
RAM 208392 208392 0 0.0
light cy8ckit_062s2_43012 FLASH 1469428 1469460 32 0.0
RAM 200368 200368 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467364 1467412 48 0.0
RAM 224704 224704 0 0.0
qpg lighting-app qpg6105+debug FLASH 662324 662340 16 0.0
RAM 105220 105220 0 0.0
lock-app qpg6105+debug FLASH 620112 620136 24 0.0
RAM 99664 99664 0 0.0
stm32 light STM32WB5MM-DK FLASH 482992 483008 16 0.0
RAM 144688 144688 0 0.0
telink bridge-app tl7218x FLASH 665214 665226 12 0.0
RAM 90828 90828 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 621896 621908 12 0.0
RAM 31488 31488 0 0.0
light-app-ota-shell-factory-data tl3218x FLASH 770882 770894 12 0.0
RAM 43568 43568 0 0.0
tl7218x FLASH 779352 779364 12 0.0
RAM 100752 100752 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 680666 680678 12 0.0
RAM 52192 52192 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 709228 709240 12 0.0
RAM 73400 73400 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 626174 626186 12 0.0
RAM 142032 142032 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814004 814016 12 0.0
RAM 99608 99608 0 0.0
tizen all-clusters-app arm unknown 5104 5104 0 0.0
FLASH 1751644 1751708 64 0.0
RAM 93508 93508 0 0.0
chip-tool-ubsan arm unknown 11396 11396 0 0.0
FLASH 18683046 18683110 64 0.0
RAM 8181084 8181084 0 0.0

@@ -277,6 +286,18 @@ CHIP_ERROR CodegenDataModelProvider::Attributes(const ConcreteClusterPath & path
ReturnErrorOnFailure(builder.Append(AttributeEntryFrom(path, attribute)));
}

DataModel::AttributeEntry globalListEntry;

globalListEntry.readPrivilege = Access::Privilege::kView;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth documenting that this is per-spec, and if this changes (e.g. a new global attribute with different access is added) we need to update this code?

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.

4 participants