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

Remove various un-necessary code from MTRDevice. #36132

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

bzbarsky-apple
Copy link
Contributor

The _deviceInternalStateChanged declaration was duplicated in MTRDevice_Concrete and only needed there.

MTRDeviceClusterData implementation can move into MTRDevice_Concrete (and should perhaps just move out into a separate file).

setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed.

setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its declaration can move to MTRDevice_Concrete and the unused implementation in MTRDevice can be removed.

Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData on MTRDevice are unused and can be removed.

At this point, _informationalVendorID, _informationalProductID, _networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all unused on MTRDevice and can be removed.

Now _informationalNumberAtAttributePath is unused on MTRDevice and can be removed.

_endpointList is also unused on MTRDevice and can be removed.

deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete, so the implementation on MTRDevice can be removed.

unitTestGetClusterDataForPath, unitTestGetPersistedClusters, unitTestClusterHasBeenPersisted, unitTestResetSubscription, unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData, unitTestInjectEventReport, unitTestInjectAttributeReport, and unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate implementations on MTRDevice can be removed.

At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be removed.

Now _getCachedDataVersions is unused on MTRDevice and can be removed.

deviceUsesThread is only used by MTRDeviceController_Concrete on MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely. Then _deviceUsesThread becomes unused on MTRDevice and can be removed.

Then _clusterDataForPath is unused on MTRDevice and can be removed.

Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be removed.

Also, _knownClusters is unused on MTRDevice and can be removed.

setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete (which has an MTRDevice_Concrete) and from unit tests (which have an MTRDevice_Concrete, though they don't know it), so it can be removed from MTRDevice. Then _resetStorageBehaviorState also becomes unused and can be removed.

At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can be removed. This makes _persistClusterDataAsNeeded and _deviceCachePrimed unused, and they can also be removed.

At this point, _persistClusterData, _deviceIsReportingExcessively, _reportToPersistenceDelayTimeAfterMutiplier,
_reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and _clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be removed.

Now _dataStoreExists, _clusterDataToPersistSnapshot, _storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier, _deviceReportingExcessivelyStartTime, and _persistedClusters are unused on MTRDevice and can be removed.

At this point _clusterDataToPersist and _persistedClusterData are unused on MTRDevice and can be removed.

_systemTimeChangeObserverToken was never actually used on MTRDevice (it's only used on MTRDevice_Concrete) and can be removed.

The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be removed.

kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed.

assertChipStackLockedByCurrentThread is not used in MTRDevice, so the LockTracker.h include can be removed.

MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke, MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload, are all unused in MTRDevice, so the imports of the corresponding headers can be removed.

arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed.

The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete and can be removed on both.

_dataValueWithoutDataVersion is unused on MTRDevice and can be removed.

@bzbarsky-apple bzbarsky-apple requested a review from a team as a code owner October 17, 2024 22:11
Copy link

Review changes with SemanticDiff.

Copy link

github-actions bot commented Oct 17, 2024

PR #36132: Size comparison from 1ae2e6e to f8af6d8

Full report (79 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 1ae2e6e f8af6d8 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1349986 1349986 0 0.0
RAM 104120 104120 0 0.0
bl702 lighting-app bl702+eth FLASH 647742 647742 0 0.0
RAM 25233 25233 0 0.0
bl702+wifi FLASH 825228 825228 0 0.0
RAM 13965 13965 0 0.0
bl706+mfd+rpc+littlefs FLASH 1054154 1054154 0 0.0
RAM 23821 23821 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 974998 974998 0 0.0
RAM 16468 16468 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 829564 829564 0 0.0
RAM 123452 123452 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 814872 814872 0 0.0
RAM 125332 125332 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 761420 761420 0 0.0
RAM 113824 113824 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 745664 745664 0 0.0
RAM 114016 114016 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 617202 617202 0 0.0
RAM 205908 205908 0 0.0
lock CC3235SF_LAUNCHXL FLASH 657258 657258 0 0.0
RAM 206060 206060 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 678549 678549 0 0.0
RAM 78668 78668 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 698393 698393 0 0.0
RAM 81300 81300 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 698393 698393 0 0.0
RAM 81300 81300 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 655329 655329 0 0.0
RAM 73736 73736 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614845 614845 0 0.0
RAM 71628 71628 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634473 634473 0 0.0
RAM 74180 74180 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634473 634473 0 0.0
RAM 74180 74180 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 634165 634165 0 0.0
RAM 74676 74676 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 653873 653873 0 0.0
RAM 77228 77228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 653873 653873 0 0.0
RAM 77228 77228 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609477 609477 0 0.0
RAM 68764 68764 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 629337 629337 0 0.0
RAM 71396 71396 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 629337 629337 0 0.0
RAM 71396 71396 0 0.0
efr32 lock-app BRD4187C FLASH 925216 925216 0 0.0
RAM 159708 159708 0 0.0
BRD4338a FLASH 741384 741376 -8 -0.0
RAM 231008 231008 0 0.0
window-app BRD4187C FLASH 1018172 1018172 0 0.0
RAM 128052 128052 0 0.0
esp32 all-clusters-app c3devkit DRAM 95256 95256 0 0.0
FLASH 1539878 1539878 0 0.0
IRAM 82538 82538 0 0.0
m5stack DRAM 116192 116192 0 0.0
FLASH 1550070 1550070 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2781147 2781147 0 0.0
RAM 129520 129520 0 0.0
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 6092126 6092126 0 0.0
RAM 524000 524000 0 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5422878 5422878 0 0.0
RAM 242416 242416 0 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4751808 4751808 0 0.0
RAM 218384 218384 0 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 13161588 13161588 0 0.0
RAM 584562 584562 0 0.0
chip-tool-ipv6only arm64 unknown 21408 21408 0 0.0
FLASH 11720208 11720208 0 0.0
RAM 635488 635488 0 0.0
fabric-admin debug unknown 5792 5792 0 0.0
FLASH 11383761 11383761 0 0.0
RAM 584650 584650 0 0.0
fabric-bridge-app debug unknown 4632 4632 0 0.0
FLASH 4578204 4578204 0 0.0
RAM 205336 205336 0 0.0
lighting-app debug+rpc+ui unknown 6056 6056 0 0.0
FLASH 5693761 5693761 0 0.0
RAM 228488 228488 0 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4801354 4801354 0 0.0
RAM 204472 204472 0 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4430736 4430736 0 0.0
RAM 198192 198192 0 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4569502 4569502 0 0.0
RAM 202760 202760 0 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3115597 3115597 0 0.0
RAM 160368 160368 0 0.0
thermostat-no-ble arm64 unknown 9448 9448 0 0.0
FLASH 4319760 4319760 0 0.0
RAM 242896 242896 0 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 6031653 6031653 0 0.0
RAM 596416 596416 0 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 11367421 11367421 0 0.0
RAM 675936 675936 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915452 915452 0 0.0
RAM 143357 143357 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 885956 885956 0 0.0
RAM 141496 141496 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848944 848944 0 0.0
RAM 142265 142265 0 0.0
nxp contact k32w0+release FLASH 582312 582312 0 0.0
RAM 70948 70948 0 0.0
mcxw71+release FLASH 596896 596896 0 0.0
RAM 63184 63184 0 0.0
light k32w0+release FLASH 618884 618884 0 0.0
RAM 70412 70412 0 0.0
k32w1+release FLASH 683112 683112 0 0.0
RAM 48816 48816 0 0.0
lock mcxw71+release FLASH 705504 705504 0 0.0
RAM 67324 67324 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647500 1647500 0 0.0
RAM 212408 212408 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553620 1553620 0 0.0
RAM 209208 209208 0 0.0
light cy8ckit_062s2_43012 FLASH 1467956 1467956 0 0.0
RAM 201200 201200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1464932 1464932 0 0.0
RAM 225560 225560 0 0.0
qpg lighting-app qpg6105+debug FLASH 660560 660560 0 0.0
RAM 105396 105396 0 0.0
lock-app qpg6105+debug FLASH 618580 618580 0 0.0
RAM 99864 99864 0 0.0
stm32 light STM32WB5MM-DK FLASH 481896 481896 0 0.0
RAM 144844 144844 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 620998 620998 0 0.0
RAM 50648 50648 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 689390 689390 0 0.0
RAM 149492 149492 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 782382 782382 0 0.0
RAM 111440 111440 0 0.0
bridge-app tlsr9258a FLASH 681112 681112 0 0.0
RAM 91304 91304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 620762 620762 0 0.0
RAM 50600 50600 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 708716 708716 0 0.0
RAM 73940 73940 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625712 625712 0 0.0
RAM 144468 144468 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811720 811720 0 0.0
RAM 99100 99100 0 0.0
lock-app-dfu tlsr9528a FLASH 656668 656668 0 0.0
RAM 66660 66660 0 0.0
ota-requestor-app tlsr9258a FLASH 697090 697090 0 0.0
RAM 90896 90896 0 0.0
pump-app-usb tlsr9518adk80d FLASH 634400 634400 0 0.0
RAM 55476 55476 0 0.0
pump-controller-app tlsr9518adk80d FLASH 611598 611598 0 0.0
RAM 52720 52720 0 0.0
shell tlsr9518adk80d FLASH 467872 467872 0 0.0
RAM 68168 68168 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 627912 627912 0 0.0
RAM 52320 52320 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 653730 653730 0 0.0
RAM 56268 56268 0 0.0
thermostat tlsr9518adk80d FLASH 638340 638340 0 0.0
RAM 53112 53112 0 0.0
window-covering tlsr9118bdk40d FLASH 524456 524456 0 0.0
RAM 97444 97444 0 0.0
tizen all-clusters-app arm unknown 4912 4912 0 0.0
FLASH 1729236 1729236 0 0.0
RAM 90108 90108 0 0.0
chip-tool-ubsan arm unknown 10792 10792 0 0.0
FLASH 18327198 18327198 0 0.0
RAM 7969512 7969512 0 0.0

The _deviceInternalStateChanged declaration was duplicated in
MTRDevice_Concrete and only needed there.

MTRDeviceClusterData implementation can move into its own file.

setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its
declaration can move to MTRDevice_Concrete and the unused implementation in
MTRDevice can be removed.

setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its
declaration can move to MTRDevice_Concrete and the unused implementation in
MTRDevice can be removed.

Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData
on MTRDevice are unused and can be removed.

At this point, _informationalVendorID, _informationalProductID,
_networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all
unused on MTRDevice and can be removed.

Now _informationalNumberAtAttributePath is unused on MTRDevice and can be
removed.

_endpointList is also unused on MTRDevice and can be removed.

deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete,
so the implementation on MTRDevice can be removed.

unitTestGetClusterDataForPath, unitTestGetPersistedClusters,
unitTestClusterHasBeenPersisted, unitTestResetSubscription,
unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData,
unitTestInjectEventReport, unitTestInjectAttributeReport, and
unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate
implementations on MTRDevice can be removed.

At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be
removed.

Now _getCachedDataVersions is unused on MTRDevice and can be removed.

deviceUsesThread is only used by MTRDeviceController_Concrete on
MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely.
Then _deviceUsesThread becomes unused on MTRDevice and can be removed.

Then _clusterDataForPath is unused on MTRDevice and can be removed.

Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be
removed.

Also, _knownClusters is unused on MTRDevice and can be removed.

setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete
(which has an MTRDevice_Concrete) and from unit tests (which have an
MTRDevice_Concrete, though they don't know it), so it can be removed from
MTRDevice.  Then _resetStorageBehaviorState also becomes unused and can be
removed.

At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can
be removed.  This makes _persistClusterDataAsNeeded and _deviceCachePrimed
unused, and they can also be removed.

At this point, _persistClusterData, _deviceIsReportingExcessively,
_reportToPersistenceDelayTimeAfterMutiplier,
_reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and
_clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be
removed.

Now _dataStoreExists, _clusterDataToPersistSnapshot,
_storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier,
_deviceReportingExcessivelyStartTime, and _persistedClusters are unused on
MTRDevice and can be removed.

At this point _clusterDataToPersist and _persistedClusterData are unused on
MTRDevice and can be removed.

_systemTimeChangeObserverToken was never actually used on MTRDevice (it's only
used on MTRDevice_Concrete) and can be removed.

The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be
removed.

kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and
ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed.

assertChipStackLockedByCurrentThread is not used in MTRDevice, so the
LockTracker.h include can be removed.

MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke,
MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload,
are all unused in MTRDevice, so the imports of the corresponding headers can be
removed.

arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed.

The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete
and can be removed on both.

_dataValueWithoutDataVersion is unused on MTRDevice and can be removed.
Copy link

github-actions bot commented Oct 18, 2024

PR #36132: Size comparison from 915fb2c to 4f29ed3

Full report (79 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 915fb2c 4f29ed3 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1349984 1349984 0 0.0
RAM 104120 104120 0 0.0
bl702 lighting-app bl702+eth FLASH 647738 647738 0 0.0
RAM 25233 25233 0 0.0
bl702+wifi FLASH 825224 825224 0 0.0
RAM 13965 13965 0 0.0
bl706+mfd+rpc+littlefs FLASH 1054150 1054150 0 0.0
RAM 23821 23821 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 974994 974994 0 0.0
RAM 16468 16468 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 829564 829564 0 0.0
RAM 123452 123452 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 814872 814872 0 0.0
RAM 125332 125332 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 761420 761420 0 0.0
RAM 113824 113824 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 745664 745664 0 0.0
RAM 114016 114016 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 617234 617234 0 0.0
RAM 205908 205908 0 0.0
lock CC3235SF_LAUNCHXL FLASH 657282 657282 0 0.0
RAM 206060 206060 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 678549 678549 0 0.0
RAM 78668 78668 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 698393 698393 0 0.0
RAM 81300 81300 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 698393 698393 0 0.0
RAM 81300 81300 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 655329 655329 0 0.0
RAM 73736 73736 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614845 614845 0 0.0
RAM 71628 71628 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634473 634473 0 0.0
RAM 74180 74180 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634473 634473 0 0.0
RAM 74180 74180 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 634165 634165 0 0.0
RAM 74676 74676 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 653873 653873 0 0.0
RAM 77228 77228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 653873 653873 0 0.0
RAM 77228 77228 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609477 609477 0 0.0
RAM 68764 68764 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 629337 629337 0 0.0
RAM 71396 71396 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 629337 629337 0 0.0
RAM 71396 71396 0 0.0
efr32 lock-app BRD4187C FLASH 925216 925216 0 0.0
RAM 159708 159708 0 0.0
BRD4338a FLASH 741416 741408 -8 -0.0
RAM 231008 231008 0 0.0
window-app BRD4187C FLASH 1018204 1018204 0 0.0
RAM 128052 128052 0 0.0
esp32 all-clusters-app c3devkit DRAM 95256 95256 0 0.0
FLASH 1539880 1539880 0 0.0
IRAM 82538 82538 0 0.0
m5stack DRAM 116192 116192 0 0.0
FLASH 1550102 1550102 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2781305 2781305 0 0.0
RAM 129520 129520 0 0.0
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 6092284 6092284 0 0.0
RAM 524000 524000 0 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5423036 5423036 0 0.0
RAM 242416 242416 0 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4751966 4751966 0 0.0
RAM 218384 218384 0 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 13162550 13162550 0 0.0
RAM 584562 584562 0 0.0
chip-tool-ipv6only arm64 unknown 21408 21408 0 0.0
FLASH 11720992 11720992 0 0.0
RAM 635488 635488 0 0.0
fabric-admin debug unknown 5792 5792 0 0.0
FLASH 11390661 11390661 0 0.0
RAM 584954 584954 0 0.0
fabric-bridge-app debug unknown 4632 4632 0 0.0
FLASH 4578362 4578362 0 0.0
RAM 205336 205336 0 0.0
lighting-app debug+rpc+ui unknown 6056 6056 0 0.0
FLASH 5693921 5693921 0 0.0
RAM 228488 228488 0 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4801512 4801512 0 0.0
RAM 204472 204472 0 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4430894 4430894 0 0.0
RAM 198192 198192 0 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4569660 4569660 0 0.0
RAM 202760 202760 0 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3115757 3115757 0 0.0
RAM 160368 160368 0 0.0
thermostat-no-ble arm64 unknown 9448 9448 0 0.0
FLASH 4319936 4319936 0 0.0
RAM 242896 242896 0 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 6031813 6031813 0 0.0
RAM 596416 596416 0 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 11367773 11367773 0 0.0
RAM 675936 675936 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915444 915444 0 0.0
RAM 143357 143357 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 885992 885992 0 0.0
RAM 141496 141496 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848936 848936 0 0.0
RAM 142265 142265 0 0.0
nxp contact k32w0+release FLASH 582296 582296 0 0.0
RAM 70948 70948 0 0.0
mcxw71+release FLASH 596888 596888 0 0.0
RAM 63184 63184 0 0.0
light k32w0+release FLASH 618884 618884 0 0.0
RAM 70412 70412 0 0.0
k32w1+release FLASH 683112 683112 0 0.0
RAM 48816 48816 0 0.0
lock mcxw71+release FLASH 705504 705504 0 0.0
RAM 67324 67324 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1647516 1647516 0 0.0
RAM 212408 212408 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553652 1553652 0 0.0
RAM 209208 209208 0 0.0
light cy8ckit_062s2_43012 FLASH 1467988 1467988 0 0.0
RAM 201200 201200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1464964 1464964 0 0.0
RAM 225560 225560 0 0.0
qpg lighting-app qpg6105+debug FLASH 660552 660552 0 0.0
RAM 105396 105396 0 0.0
lock-app qpg6105+debug FLASH 618572 618572 0 0.0
RAM 99864 99864 0 0.0
stm32 light STM32WB5MM-DK FLASH 481888 481888 0 0.0
RAM 144844 144844 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 621000 621000 0 0.0
RAM 50648 50648 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 689392 689392 0 0.0
RAM 149492 149492 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 782384 782384 0 0.0
RAM 111440 111440 0 0.0
bridge-app tlsr9258a FLASH 681114 681114 0 0.0
RAM 91304 91304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 620764 620764 0 0.0
RAM 50600 50600 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 708718 708718 0 0.0
RAM 73940 73940 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625714 625714 0 0.0
RAM 144468 144468 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811722 811722 0 0.0
RAM 99100 99100 0 0.0
lock-app-dfu tlsr9528a FLASH 656670 656670 0 0.0
RAM 66660 66660 0 0.0
ota-requestor-app tlsr9258a FLASH 697092 697092 0 0.0
RAM 90896 90896 0 0.0
pump-app-usb tlsr9518adk80d FLASH 634402 634402 0 0.0
RAM 55476 55476 0 0.0
pump-controller-app tlsr9518adk80d FLASH 611600 611600 0 0.0
RAM 52720 52720 0 0.0
shell tlsr9518adk80d FLASH 467872 467872 0 0.0
RAM 68168 68168 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 627914 627914 0 0.0
RAM 52320 52320 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 653732 653732 0 0.0
RAM 56268 56268 0 0.0
thermostat tlsr9518adk80d FLASH 638342 638342 0 0.0
RAM 53112 53112 0 0.0
window-covering tlsr9118bdk40d FLASH 524458 524458 0 0.0
RAM 97444 97444 0 0.0
tizen all-clusters-app arm unknown 4912 4912 0 0.0
FLASH 1729396 1729396 0 0.0
RAM 90108 90108 0 0.0
chip-tool-ubsan arm unknown 10792 10792 0 0.0
FLASH 18329086 18329086 0 0.0
RAM 7970352 7970352 0 0.0

Copy link
Contributor

@arkq arkq left a comment

Choose a reason for hiding this comment

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

Rubber stamping since it has Apple approval.

@mergify mergify bot merged commit 2574847 into project-chip:master Oct 18, 2024
67 checks passed
@bzbarsky-apple bzbarsky-apple deleted the remove-more-MTRDevice branch October 18, 2024 19:26
FergusHuang pushed a commit to FergusHuang/connectedhomeip that referenced this pull request Oct 20, 2024
* Remove various un-necessary code from MTRDevice.

The _deviceInternalStateChanged declaration was duplicated in
MTRDevice_Concrete and only needed there.

MTRDeviceClusterData implementation can move into its own file.

setPersistedClusterData: is only used on MTRDevice_Concrete instances, so its
declaration can move to MTRDevice_Concrete and the unused implementation in
MTRDevice can be removed.

setPersistedDeviceData: is only used on MTRDevice_Concrete instances, so its
declaration can move to MTRDevice_Concrete and the unused implementation in
MTRDevice can be removed.

Now _setLastInitialSubscribeLatency and _updateAttributeDependentDescriptionData
on MTRDevice are unused and can be removed.

At this point, _informationalVendorID, _informationalProductID,
_networkFeatures, _vid, _pid, _allNetworkFeatures, and _descriptionLock are all
unused on MTRDevice and can be removed.

Now _informationalNumberAtAttributePath is unused on MTRDevice and can be
removed.

_endpointList is also unused on MTRDevice and can be removed.

deviceCachePrimed is implemented by both MTRDevice_XPC and MTRDevice_Concrete,
so the implementation on MTRDevice can be removed.

unitTestGetClusterDataForPath, unitTestGetPersistedClusters,
unitTestClusterHasBeenPersisted, unitTestResetSubscription,
unitTestAttributesReportedSinceLastCheck, unitTestClearClusterData,
unitTestInjectEventReport, unitTestInjectAttributeReport, and
unitTestAttributeCount are only used on MTRDevice_Concrete, so the duplicate
implementations on MTRDevice can be removed.

At this point, _cachedAttributeValueForPath is unused on MTRDevice and can be
removed.

Now _getCachedDataVersions is unused on MTRDevice and can be removed.

deviceUsesThread is only used by MTRDeviceController_Concrete on
MTRDevice_Concrete instances and so can move to MTRDevice_Concrete entirely.
Then _deviceUsesThread becomes unused on MTRDevice and can be removed.

Then _clusterDataForPath is unused on MTRDevice and can be removed.

Now _reconcilePersistedClustersWithStorage is unused on MTRDevice and can be
removed.

Also, _knownClusters is unused on MTRDevice and can be removed.

setStorageBehaviorConfiguration is only used from MTRDeviceController_Concrete
(which has an MTRDevice_Concrete) and from unit tests (which have an
MTRDevice_Concrete, though they don't know it), so it can be removed from
MTRDevice.  Then _resetStorageBehaviorState also becomes unused and can be
removed.

At this point, _scheduleClusterDataPersistence is not used on MTRDevice and can
be removed.  This makes _persistClusterDataAsNeeded and _deviceCachePrimed
unused, and they can also be removed.

At this point, _persistClusterData, _deviceIsReportingExcessively,
_reportToPersistenceDelayTimeAfterMutiplier,
_reportToPersistenceDelayTimeMaxAfterMutiplier, _mostRecentReportTimes, and
_clusterDataPersistenceFirstScheduledTime are not used on MTRDevice and can be
removed.

Now _dataStoreExists, _clusterDataToPersistSnapshot,
_storageBehaviorConfiguration, _reportToPersistenceDelayCurrentMultiplier,
_deviceReportingExcessivelyStartTime, and _persistedClusters are unused on
MTRDevice and can be removed.

At this point _clusterDataToPersist and _persistedClusterData are unused on
MTRDevice and can be removed.

_systemTimeChangeObserverToken was never actually used on MTRDevice (it's only
used on MTRDevice_Concrete) and can be removed.

The MTRDeviceAttributeReportHandler typedef is unused on MTRDevice and can be
removed.

kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription and
ENABLE_CONNECTIVITY_MONITORING are unused on MTRDevice and can be removed.

assertChipStackLockedByCurrentThread is not used in MTRDevice, so the
LockTracker.h include can be removed.

MTRAsyncWorkQueue, MTRAttributeIsSpecified, MTRCommandNeedsTimedInvoke,
MTRDeviceConnectivityMonitor, MTRDeviceControllerOverXPC, MTRDecodeEventPayload,
are all unused in MTRDevice, so the imports of the corresponding headers can be
removed.

arrayOfNumbersFromAttributeValue is now unused on MTRDevice and can be removed.

The fabricIndex property is write-only on both MTRDevice and MTRDevice_Concrete
and can be removed on both.

_dataValueWithoutDataVersion is unused on MTRDevice and can be removed.

* Move MTRDeviceClusterData into a separate header/implementation file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants